From b2a1045016f62063ccf8b119ec46bd4c24b058e3 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Fri, 6 Dec 2013 15:08:15 +0100 Subject: [PATCH 1/4] Bug 947216 - Remove special case for about:config's form data collection r=smacleod From 1c6cfab02eab4fcb0fb3200a4c12c760ae411a77 Mon Sep 17 00:00:00 2001 --- .../components/sessionstore/src/DocumentUtils.jsm | 3 ++- .../sessionstore/src/TextAndScrollData.jsm | 7 ------- .../components/sessionstore/src/XPathGenerator.jsm | 13 +++++++++++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/browser/components/sessionstore/src/DocumentUtils.jsm b/browser/components/sessionstore/src/DocumentUtils.jsm index 32202dab3c22..af4328144bb1 100644 --- a/browser/components/sessionstore/src/DocumentUtils.jsm +++ b/browser/components/sessionstore/src/DocumentUtils.jsm @@ -55,7 +55,8 @@ this.DocumentUtils = { } if (node instanceof Ci.nsIDOMHTMLInputElement || - node instanceof Ci.nsIDOMHTMLTextAreaElement) { + node instanceof Ci.nsIDOMHTMLTextAreaElement || + node instanceof Ci.nsIDOMXULTextBoxElement) { switch (node.type) { case "checkbox": case "radio": diff --git a/browser/components/sessionstore/src/TextAndScrollData.jsm b/browser/components/sessionstore/src/TextAndScrollData.jsm index 042bc2145056..b0c52dac800d 100644 --- a/browser/components/sessionstore/src/TextAndScrollData.jsm +++ b/browser/components/sessionstore/src/TextAndScrollData.jsm @@ -86,13 +86,6 @@ let TextAndScrollDataInternal = { let scrollX = {}, scrollY = {}; domWindowUtils.getScrollXY(false, scrollX, scrollY); entry.scroll = scrollX.value + "," + scrollY.value; - - if (topURL == "about:config") { - entry.formdata = { - id: { "textbox": content.top.document.getElementById("textbox").value }, - xpath: {} - }; - } }, isAboutSessionRestore: function (url) { diff --git a/browser/components/sessionstore/src/XPathGenerator.jsm b/browser/components/sessionstore/src/XPathGenerator.jsm index 15b56fe1ce86..19222c126c54 100644 --- a/browser/components/sessionstore/src/XPathGenerator.jsm +++ b/browser/components/sessionstore/src/XPathGenerator.jsm @@ -8,8 +8,14 @@ this.EXPORTED_SYMBOLS = ["XPathGenerator"]; this.XPathGenerator = { // these two hashes should be kept in sync - namespaceURIs: { "xhtml": "http://www.w3.org/1999/xhtml" }, - namespacePrefixes: { "http://www.w3.org/1999/xhtml": "xhtml" }, + namespaceURIs: { + "xhtml": "http://www.w3.org/1999/xhtml", + "xul": "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + }, + namespacePrefixes: { + "http://www.w3.org/1999/xhtml": "xhtml", + "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul": "xul" + }, /** * Generates an approximate XPath query to an (X)HTML node @@ -93,6 +99,9 @@ this.XPathGenerator = { let formNodesXPath = "//textarea|//select|//xhtml:textarea|//xhtml:select|" + "//input[" + ignore + "]|//xhtml:input[" + ignore + "]"; + // Special case for about:config's search field. + formNodesXPath += '|/xul:window[@id="config"]//xul:textbox[@id="textbox"]'; + delete this.restorableFormNodes; return (this.restorableFormNodes = formNodesXPath); } From fd75b335c57261d6eb6d71d9f6aa19eacff762d1 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Fri, 6 Dec 2013 16:54:43 +0100 Subject: [PATCH 2/4] Bug 947262 - Don't dispatch a change event when trying to restore an invalid