Bug 636689 - Rename the HTML5 parser enablement pref and make it show in about:support. r+a=jst.
authorHenri Sivonen <hsivonen@iki.fi>
Fri, 25 Feb 2011 18:23:02 +0200
changeset 63185 41ce2958892a57845739f76bf6acbde432b9152a
parent 63184 47e21ce142a6918da1cbb9cc8bf538f6e7c926de
child 63186 4ff62915a2b4856b7b92a87b419a4587d49a3e73
push idunknown
push userunknown
push dateunknown
bugs636689
milestone2.0b13pre
Bug 636689 - Rename the HTML5 parser enablement pref and make it show in about:support. r+a=jst.
content/base/test/test_bug503473.html
content/base/test/test_bug527896.html
content/html/content/test/test_bug389797.html
content/html/content/test/test_bug555567.html
content/html/content/test/test_bug562932.html
content/html/document/test/test_bug255820.html
content/html/document/test/test_bug570376.html
layout/reftests/bugs/reftest.list
modules/libpref/src/init/all.js
parser/html/nsHtml5Module.cpp
parser/htmlparser/tests/mochitest/parser_web_testrunner.js
parser/htmlparser/tests/mochitest/test_bug502091.html
parser/htmlparser/tests/mochitest/test_compatmode.html
toolkit/content/aboutSupport.js
--- a/content/base/test/test_bug503473.html
+++ b/content/base/test/test_bug503473.html
@@ -15,28 +15,28 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 503473 **/
 
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var prefs = Components.classes["@mozilla.org/preferences-service;1"]
           .getService(Components.interfaces.nsIPrefBranch);
-var gOriginalHtml5Pref = prefs.getBoolPref("html5.enable");
-prefs.setBoolPref("html5.enable", true);
+var gOriginalHtml5Pref = prefs.getBoolPref("html5.parser.enable");
+prefs.setBoolPref("html5.parser.enable", true);
 
 SimpleTest.waitForExplicitFinish();
 
 function done() {
   var iframe = document.getElementById("iframe");
   var divs = iframe.contentWindow.document.getElementsByTagName("div").length;
   is(divs, 0, "Div wasn't blown away.")
 
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  prefs.setBoolPref("html5.enable", gOriginalHtml5Pref);
+  prefs.setBoolPref("html5.parser.enable", gOriginalHtml5Pref);
 
   SimpleTest.finish();
 }
 
 </script>
 </pre>
 <div id="content" style="display: none">
   <iframe id='iframe' src="file_bug503473-frame.sjs">
--- a/content/base/test/test_bug527896.html
+++ b/content/base/test/test_bug527896.html
@@ -18,18 +18,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 527896 **/
 
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var prefs = Components.classes["@mozilla.org/preferences-service;1"]
           .getService(Components.interfaces.nsIPrefBranch);
-var gOriginalHtml5Pref = prefs.getBoolPref("html5.enable");
-prefs.setBoolPref("html5.enable", true);
+var gOriginalHtml5Pref = prefs.getBoolPref("html5.parser.enable");
+prefs.setBoolPref("html5.parser.enable", true);
 
 SimpleTest.waitForExplicitFinish();
 
 var docWrittenSrcExecuted = false;
 var scriptInsertedSrcExecuted = false;
 
 // the iframe test runs with the HTML5 parser
 
@@ -56,17 +56,17 @@ todo(false, "Add SVG tests after bug 528
 
 function done() {
   ok(docWrittenSrcExecuted, "document.written src didn't execute");
   ok(scriptInsertedSrcExecuted, "script-inserted src didn't execute");
 
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
             .getService(Components.interfaces.nsIPrefBranch);
-  prefs.setBoolPref("html5.enable", gOriginalHtml5Pref);
+  prefs.setBoolPref("html5.parser.enable", gOriginalHtml5Pref);
 
   SimpleTest.finish();
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/html/content/test/test_bug389797.html
+++ b/content/html/content/test/test_bug389797.html
@@ -176,17 +176,17 @@ HTML_TAG("image", "Span");
 HTML_TAG("img", "Image", [], [ "imgIDecoderObserver",
                                "nsIImageLoadingContent" ]);
 HTML_TAG("input", "Input", [], [ "imgIDecoderObserver",
                                  "nsIImageLoadingContent",
                                  "nsIDOMNSEditableElement" ]);
 HTML_TAG("ins", "Ins", [ "nsIDOMHTMLModElement" ]);
 
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-if (prefs.getBoolPref("html5.enable")) {
+if (prefs.getBoolPref("html5.parser.enable")) {
   HTML_TAG("isindex", ""); // HTMLElement
 } else {
   HTML_TAG("isindex", "IsIndex");
 }
 
 HTML_TAG("kbd", ""); // HTMLElement
 HTML_TAG("keygen", "Span");
 HTML_TAG("label", "Label");
--- a/content/html/content/test/test_bug555567.html
+++ b/content/html/content/test/test_bug555567.html
@@ -26,17 +26,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 555567 **/
 
 // This test works only with html5 parser.
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var prefs = Components.classes["@mozilla.org/preferences-service;1"]
             .getService(Components.interfaces.nsIPrefBranch);
 
-if (prefs.getBoolPref("html5.enable")) {
+if (prefs.getBoolPref("html5.parser.enable")) {
   var a = document.getElementById('a');
   var b = document.getElementById('b');
   var c = document.getElementById('c');
 
   isnot(a.form, null,
     "First legend element should have a not null form IDL attribute");
   is(b.form, null,
     "Second legend element should have a null form IDL attribute");
--- a/content/html/content/test/test_bug562932.html
+++ b/content/html/content/test/test_bug562932.html
@@ -38,17 +38,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 562932 **/
 
 // Check if we are using the html5 parser
 // because some tests will fail otherwise.
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var gHtml5Parser = Components.classes["@mozilla.org/preferences-service;1"]
                    .getService(Components.interfaces.nsIPrefBranch)
-                   .getBoolPref("html5.enable");
+                   .getBoolPref("html5.parser.enable");
 
 function checkControl(aLabelId, aElementId, aMsg)
 {
   var element = null;
 
   if (aElementId != null) {
     element = document.getElementById(aElementId);
   }
--- a/content/html/document/test/test_bug255820.html
+++ b/content/html/document/test/test_bug255820.html
@@ -67,17 +67,17 @@ function f3Continue() {
                  "charsetTestFinished('f1', this.contentDocument, 'UTF-8')");
   $("f3").contentWindow.location.reload();
 }
 
 function runTest() {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
     .getService(Components.interfaces.nsIPrefBranch);
-  var html5enabled = prefs.getBoolPref("html5.enable");
+  var html5enabled = prefs.getBoolPref("html5.parser.enable");
 
   var doc = $("f1").contentDocument;
   is(doc.characterSet, "UTF-8",
      "Unexpected initial character set for first frame");
   doc.open();
   doc.write('<html></html>');
   doc.close();
   is(doc.characterSet, "UTF-8",
--- a/content/html/document/test/test_bug570376.html
+++ b/content/html/document/test/test_bug570376.html
@@ -21,24 +21,24 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 570376
     Don't crash loading <form><legend> with the html5 parser preffed off.
  **/
 
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var prefs = Components.classes["@mozilla.org/preferences-service;1"]
                       .getService(Components.interfaces.nsIPrefBranch);
-var gOriginalHtml5Pref = prefs.getBoolPref("html5.enable");
-prefs.setBoolPref("html5.enable", false);
+var gOriginalHtml5Pref = prefs.getBoolPref("html5.parser.enable");
+prefs.setBoolPref("html5.parser.enable", false);
 
 $("testiframe").onload = function () {
   ok(true, "Shouldn't crash loading a form containing a legend with the html5 parser preffed off");
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
                         .getService(Components.interfaces.nsIPrefBranch);
-  prefs.setBoolPref("html5.enable", gOriginalHtml5Pref);
+  prefs.setBoolPref("html5.parser.enable", gOriginalHtml5Pref);
 }
 $("testiframe").src = "data:text/html,<form><legend>";
 
 </script>
 </pre>
 </body>
 </html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -326,17 +326,17 @@ random-if(d2d) == 299837-3.xul 299837-3-
 == 307102-3.html 307102-3-ref.html
 == 307102-4.html 307102-4-ref.html
 == 308406-1.html 308406-1-ref.html
 == 308406-2.html 308406-2-ref.html
 == 309550-1.html 309550-1-ref.html
 == 309914-1.xul 309914-1-ref.xul
 == 311366-unknown-inline-1.html 311366-unknown-inline-1-ref.html
 == 311366-unknown-block-1.html 311366-unknown-block-1-ref.html
-fails-if(!prefs.getBoolPref("html5.enable")) == 311366-unknown-block-3.html 311366-unknown-block-3-ref.html
+fails-if(!prefs.getBoolPref("html5.parser.enable")) == 311366-unknown-block-3.html 311366-unknown-block-3-ref.html
 == 311366-unknown-block-2.html 311366-unknown-block-2-ref.html
 == 311366-unknown-inline-2.html 311366-unknown-inline-2-ref.html
 == 311822-1.html 311822-1-ref-a.html
 == 311822-1.html 311822-1-ref-b.html
 == 315620-1a.html 315620-1-ref.html
 != 315620-1b.html 315620-1-ref.html
 == 315620-2a.xhtml 315620-2-ref.xhtml
 != 315620-2b.xhtml 315620-2-ref.xhtml
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -3254,17 +3254,17 @@ pref("layers.prefer-d3d9", false);
 
 // Enable/Disable the geolocation API for content
 pref("geo.enabled", true);
 
 // Enable/Disable the orientation API for content
 pref("accelerometer.enabled", true);
 
 // Enable/Disable HTML5 parser
-pref("html5.enable", true);
+pref("html5.parser.enable", true);
 // Toggle which thread the HTML5 parser uses for stream parsing
 pref("html5.offmainthread", true);
 // Toggle old parser use for document.open() on Hotmail (bug 627729)
 pref("html5.hotmailworkaround", true);
 // Time in milliseconds between the time a network buffer is seen and the 
 // timer firing when the timer hasn't fired previously in this parse in the 
 // off-the-main-thread HTML5 parser.
 pref("html5.flushtimer.initialdelay", 120);
--- a/parser/html/nsHtml5Module.cpp
+++ b/parser/html/nsHtml5Module.cpp
@@ -56,17 +56,17 @@ PRBool nsHtml5Module::sOffMainThread = P
 PRBool nsHtml5Module::sHotmailWorkaround = PR_TRUE;
 nsIThread* nsHtml5Module::sStreamParserThread = nsnull;
 nsIThread* nsHtml5Module::sMainThread = nsnull;
 
 // static
 void
 nsHtml5Module::InitializeStatics()
 {
-  nsContentUtils::AddBoolPrefVarCache("html5.enable", &sEnabled);
+  nsContentUtils::AddBoolPrefVarCache("html5.parser.enable", &sEnabled);
   nsContentUtils::AddBoolPrefVarCache("html5.offmainthread", &sOffMainThread);
   nsContentUtils::AddBoolPrefVarCache("html5.hotmailworkaround",
                                       &sHotmailWorkaround);
   nsHtml5Atoms::AddRefAtoms();
   nsHtml5AttributeName::initializeStatics();
   nsHtml5ElementName::initializeStatics();
   nsHtml5HtmlAttributes::initializeStatics();
   nsHtml5NamedCharacters::initializeStatics();
--- a/parser/htmlparser/tests/mochitest/parser_web_testrunner.js
+++ b/parser/htmlparser/tests/mochitest/parser_web_testrunner.js
@@ -134,17 +134,17 @@ function nextTest(testframe) {
                                        testframe));
     } else {
       dataURL = "data:text/html;charset=utf-8," + encodeURIComponent(input);
       testframe.onload = makeTestChecker(input, output, errors);
       testframe.src = dataURL;
     }
   } catch (err if err instanceof StopIteration) {
     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-    prefService.setBoolPref("html5.enable", origPref);
+    prefService.setBoolPref("html5.parser.enable", origPref);
     SimpleTest.finish();
   }
 }
 
 var testFileContents = [];
 function loadNextTestFile() {
   var datFile = parserDatFiles.shift();
   if (datFile) {
@@ -162,12 +162,12 @@ function loadNextTestFile() {
     nextTest($("testframe"));
   }
 }
 
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var prefService = Components.classes["@mozilla.org/preferences-service;1"]
                   .getService(Components.interfaces.nsIPrefBranch)
                   .QueryInterface(Components.interfaces.nsIPrefService);
-var origPref = prefService.getBoolPref("html5.enable");
-prefService.setBoolPref("html5.enable", true);
+var origPref = prefService.getBoolPref("html5.parser.enable");
+prefService.setBoolPref("html5.parser.enable", true);
 addLoadEvent(loadNextTestFile);
 SimpleTest.waitForExplicitFinish();
--- a/parser/htmlparser/tests/mochitest/test_bug502091.html
+++ b/parser/htmlparser/tests/mochitest/test_bug502091.html
@@ -19,31 +19,31 @@ Adding a <meta> element by writing to in
 </div>
 <div id="test">
 <script class="testbody" type="text/javascript">
   function $(id) { return document.getElementById(id); }
 
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
             .getService(Components.interfaces.nsIPrefBranch);
-  var gOriginalHtml5Pref = prefs.getBoolPref("html5.enable");
-  prefs.setBoolPref("html5.enable", true);
+  var gOriginalHtml5Pref = prefs.getBoolPref("html5.parser.enable");
+  prefs.setBoolPref("html5.parser.enable", true);
 
   var iframe=document.createElement("iframe");
   iframe.setAttribute("id", "iframe");
   iframe.src = "bug_502091_iframe.html";
   iframe.onload = function () {
     var div = $("iframe").contentDocument.getElementById("testdiv");
     var meta = div.getElementsByTagName("meta");
     is(meta.length, 1, "meta element not added to div");
 
     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     var prefs = Components.classes["@mozilla.org/preferences-service;1"]
               .getService(Components.interfaces.nsIPrefBranch);
-    prefs.setBoolPref("html5.enable", gOriginalHtml5Pref);
+    prefs.setBoolPref("html5.parser.enable", gOriginalHtml5Pref);
   };
   $("test").appendChild(iframe);
 
 </script>
 </div>
 </body>
 </html>
 
--- a/parser/htmlparser/tests/mochitest/test_compatmode.html
+++ b/parser/htmlparser/tests/mochitest/test_compatmode.html
@@ -49,33 +49,33 @@ var doctypes = [
 'BackCompat' , '<!DOCTYPE HTMLz PUBLIC "DTD HTML 3.2">',
 'BackCompat' , '<!DOCTYPE "DTD HTML 3.2">',
 /* end from bug 363883 */
 // from bug 502600
 'BackCompat' , '<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">',
 ];
 
 ////
-// Restore the original value of the html5.enable pref,
+// Restore the original value of the html5.parser.enable pref,
 // and finish.
 //
 function finishTest() {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
             .getService(Components.interfaces.nsIPrefBranch);
-  prefs.setBoolPref("html5.enable", gOriginalHtml5Pref);
+  prefs.setBoolPref("html5.parser.enable", gOriginalHtml5Pref);
   SimpleTest.finish();  
 }
 
 ////
 // Verify that the iframe's compatibility mode matches
 // the expected value.  This function is called from the
 // test iframe's onload handler.  When verifying the
 // last test in the group, if there is no original
-// value for the html5.enable pref stored in the
+// value for the html5.parser.enable pref stored in the
 // 'gOriginalHtml5Pref' variable, then run the tests
 // again in HTML5 mode.  Otherwise, finish the test.
 //
 function test(mode,i){
   is(mode,doctypes[i],doctypes[i+1]);
   if (i == doctypes.length - 2) {
     if (typeof(gOriginalHtml5Pref) == "undefined") {
       doTestHtml5();
@@ -89,18 +89,18 @@ function test(mode,i){
 ////
 // Enable the HTML5 parser, then iterate through the tests
 // a second time.
 //
 function doTestHtml5() {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
             .getService(Components.interfaces.nsIPrefBranch);
-  gOriginalHtml5Pref = prefs.getBoolPref("html5.enable");
-  prefs.setBoolPref("html5.enable", true);
+  gOriginalHtml5Pref = prefs.getBoolPref("html5.parser.enable");
+  prefs.setBoolPref("html5.parser.enable", true);
   
   doTest();
 }
 
 ////
 // Insert a hidden iframe into the document, with the src 
 // containing the test doctype.  The iframe's onload
 // function is set to call the test's verification step.
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -60,16 +60,17 @@ const PREFS_WHITELIST = [
   "browser.tabs.",
   "browser.zoom.",
   "dom.",
   "extensions.checkCompatibility",
   "extensions.lastAppVersion",
   "font.",
   "general.useragent.",
   "gfx.",
+  "html5.",
   "mozilla.widget.render-mode",
   "layers.",
   "javascript.",
   "keyword.",
   "layout.css.dpi",
   "network.",
   "places.",
   "print.",