Welcome…

…to the Front Page of BinOC!


# HG changeset patch
# Parent  7037f62ad7cd2336ec2d6268d9ffb0a66d00870d
[DOM:HTML] Add prefs to disable rendering html content and treat html as xhtml

These prefs will optionally either treat html as plain text (rendered by the
html5 parser) or treat html as xhtml and send it through the xml parser.

It is currently unknown if the DOM API for creating html documents
programatically is affected.

diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -575,6 +575,15 @@ nsHTMLDocument::StartDocumentLoad(const 
         loadAsHtml5 = false;
       }
     }
+
+    // Treat HTML as XHTML by pref
+    if (!isAbout && html &&
+        Preferences::GetBool("content.html.isXHTML", false) &&
+        !Preferences::GetBool("content.html.disable", false)) {
+      mType = eXHTML;
+      mCompatMode = eCompatibility_FullStandards;
+      loadAsHtml5 = false;
+    }
   }
 
   CSSLoader()->SetCompatibilityMode(mCompatMode);
@@ -608,6 +617,13 @@ nsHTMLDocument::StartDocumentLoad(const 
       }
     } else if (viewSource && !html) {
       mParser->MarkAsNotScriptCreated("view-source-xml");
+    } else if (html && Preferences::GetBool("content.html.disable", false)) {
+      // HTML is rendered as plain-text unless view-source
+      if (viewSource) {
+        mParser->MarkAsNotScriptCreated("view-source");
+      } else {
+        mParser->MarkAsNotScriptCreated("plain-text");
+      }
     } else {
       mParser->MarkAsNotScriptCreated(aCommand);
     }

"Moonchild-free since 2022"

What is Binary Outcast?Last updated: Soon...

Binary Outcast, increasingly shorted to BinOC (pronounced ben-oh-sea), is first and foremost the home of Matt A. Tobin. I have accomplished many things since 2001 and attempted many others with varying levels of success. Sometimes others may pitch in. Today, the whole thing stands once again as a multi-faceted and expanding .. uhh thing. From my self, through any that come along to help, to your screen. This is BinOC. Stay tuned!