Landing fix for bug 419716. Make us consistently deal how we're pass param tags to object tags when parsing XHTML. Patch by mrbkap@gmail.com and bent.mozilla@gmail.com, r+sr=jonas@sicking.cc, a=beltzner
authorjst@mozilla.org
Thu, 17 Apr 2008 15:30:51 -0700
changeset 14437 88f8ba037468cf1855fb11c9164016822762521c
parent 14436 dabf1468a101807c8e732fa25a38356edd5843b0
child 14438 4ba52349a1bace18a0c3a06becb241dc9f2737c1
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbeltzner
bugs419716
milestone1.9pre
Landing fix for bug 419716. Make us consistently deal how we're pass param tags to object tags when parsing XHTML. Patch by mrbkap@gmail.com and bent.mozilla@gmail.com, r+sr=jonas@sicking.cc, a=beltzner
content/base/public/nsContentCreatorFunctions.h
content/base/src/nsDocument.cpp
content/base/src/nsNameSpaceManager.cpp
content/html/document/src/nsHTMLContentSink.cpp
content/html/document/src/nsHTMLFragmentContentSink.cpp
content/html/document/src/nsPluginDocument.cpp
content/xml/document/src/nsXMLContentSink.cpp
content/xml/document/src/nsXMLContentSink.h
content/xslt/src/xslt/txMozillaTextOutput.cpp
content/xslt/src/xslt/txMozillaXMLOutput.cpp
content/xul/document/src/nsXULDocument.cpp
content/xul/templates/src/nsXULContentBuilder.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsFileControlFrame.cpp
layout/forms/nsIsIndexFrame.cpp
layout/forms/nsTextControlFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
--- a/content/base/public/nsContentCreatorFunctions.h
+++ b/content/base/public/nsContentCreatorFunctions.h
@@ -53,17 +53,17 @@ class nsIContent;
 class nsIDocument;
 class nsINodeInfo;
 class imgIRequest;
 class nsNodeInfoManager;
 class nsGenericHTMLElement;
 
 nsresult
 NS_NewElement(nsIContent** aResult, PRInt32 aElementType,
-              nsINodeInfo* aNodeInfo);
+              nsINodeInfo* aNodeInfo, PRBool aFromParser);
 
 nsresult
 NS_NewXMLElement(nsIContent** aResult, nsINodeInfo* aNodeInfo);
 
 /**
  * aNodeInfoManager must not be null.
  */
 nsresult
@@ -95,17 +95,18 @@ NS_NewXMLStylesheetProcessingInstruction
 /**
  * aNodeInfoManager must not be null.
  */
 nsresult
 NS_NewXMLCDATASection(nsIContent** aInstancePtrResult,
                       nsNodeInfoManager *aNodeInfoManager);
 
 nsresult
-NS_NewHTMLElement(nsIContent** aResult, nsINodeInfo *aNodeInfo);
+NS_NewHTMLElement(nsIContent** aResult, nsINodeInfo *aNodeInfo,
+                  PRBool aFromParser);
 
 // First argument should be nsHTMLTag, but that adds dependency to parser
 // for a bunch of files.
 already_AddRefed<nsGenericHTMLElement>
 CreateHTMLElement(PRUint32 aNodeType, nsINodeInfo *aNodeInfo,
                   PRBool aFromParser);
 
 #ifdef MOZ_MATHML
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -3025,17 +3025,18 @@ nsDocument::CreateElementNS(const nsAStr
   nsCOMPtr<nsINodeInfo> nodeInfo;
   nsresult rv = nsContentUtils::GetNodeInfoFromQName(aNamespaceURI,
                                                      aQualifiedName,
                                                      mNodeInfoManager,
                                                      getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIContent> content;
-  NS_NewElement(getter_AddRefs(content), nodeInfo->NamespaceID(), nodeInfo);
+  NS_NewElement(getter_AddRefs(content), nodeInfo->NamespaceID(), nodeInfo,
+                PR_FALSE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return CallQueryInterface(content, aReturn);
 }
 
 NS_IMETHODIMP
 nsDocument::CreateTextNode(const nsAString& aData, nsIDOMText** aReturn)
 {
@@ -5368,17 +5369,17 @@ nsDocument::CreateElem(nsIAtom *aName, n
   PRInt32 elementType = aDocumentDefaultType ? mDefaultElementType :
                                                aNamespaceID;
 
   nsCOMPtr<nsINodeInfo> nodeInfo;
   rv = mNodeInfoManager->GetNodeInfo(aName, aPrefix, aNamespaceID,
                                      getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return NS_NewElement(aResult, elementType, nodeInfo);
+  return NS_NewElement(aResult, elementType, nodeInfo, PR_FALSE);
 }
 
 PRBool
 nsDocument::IsSafeToFlush() const
 {
   PRBool isSafeToFlush = PR_TRUE;
   nsPresShellIterator iter(const_cast<nsIDocument*>
                                      (static_cast<const nsIDocument*>(this)));
--- a/content/base/src/nsNameSpaceManager.cpp
+++ b/content/base/src/nsNameSpaceManager.cpp
@@ -221,20 +221,20 @@ NameSpaceManagerImpl::GetNameSpaceID(con
     return nameSpaceID;
   }
 
   return kNameSpaceID_Unknown;
 }
 
 nsresult
 NS_NewElement(nsIContent** aResult, PRInt32 aElementType,
-              nsINodeInfo* aNodeInfo)
+              nsINodeInfo* aNodeInfo, PRBool aFromParser)
 {
   if (aElementType == kNameSpaceID_XHTML) {
-    return NS_NewHTMLElement(aResult, aNodeInfo);
+    return NS_NewHTMLElement(aResult, aNodeInfo, aFromParser);
   }
 #ifdef MOZ_XUL
   if (aElementType == kNameSpaceID_XUL) {
     return NS_NewXULElement(aResult, aNodeInfo);
   }
 #endif
 #ifdef MOZ_MATHML
   if (aElementType == kNameSpaceID_MathML) {
--- a/content/html/document/src/nsHTMLContentSink.cpp
+++ b/content/html/document/src/nsHTMLContentSink.cpp
@@ -563,17 +563,18 @@ HTMLContentSink::CreateContentObject(con
 
   NS_ENSURE_TRUE(nodeInfo, nsnull);
 
   // Make the content object
   return CreateHTMLElement(aNodeType, nodeInfo, PR_TRUE);
 }
 
 nsresult
-NS_NewHTMLElement(nsIContent** aResult, nsINodeInfo *aNodeInfo)
+NS_NewHTMLElement(nsIContent** aResult, nsINodeInfo *aNodeInfo,
+                  PRBool aFromParser)
 {
   *aResult = nsnull;
 
   nsIParserService* parserService = nsContentUtils::GetParserService();
   if (!parserService)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsIAtom *name = aNodeInfo->NameAtom();
@@ -585,17 +586,17 @@ NS_NewHTMLElement(nsIContent** aResult, 
     ToLowerCase(nameStr, lname);
     NS_ASSERTION(nameStr.Equals(lname), "name should be lowercase by now");
     NS_ASSERTION(!aNodeInfo->GetPrefixAtom(), "should not have a prefix");
   }
 #endif
   
   *aResult = CreateHTMLElement(parserService->
                                  HTMLCaseSensitiveAtomTagToId(name),
-                               aNodeInfo, PR_FALSE).get();
+                               aNodeInfo, aFromParser).get();
   return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 already_AddRefed<nsGenericHTMLElement>
 CreateHTMLElement(PRUint32 aNodeType, nsINodeInfo *aNodeInfo,
                   PRBool aFromParser)
 {
   NS_ASSERTION(aNodeType <= NS_HTML_TAG_MAX ||
@@ -2930,17 +2931,17 @@ HTMLContentSink::ProcessLINKTag(const ns
 
   if (parent) {
     // Create content object
     nsCOMPtr<nsIContent> element;
     nsCOMPtr<nsINodeInfo> nodeInfo;
     mNodeInfoManager->GetNodeInfo(nsGkAtoms::link, nsnull, kNameSpaceID_None,
                                   getter_AddRefs(nodeInfo));
 
-    result = NS_NewHTMLElement(getter_AddRefs(element), nodeInfo);
+    result = NS_NewHTMLElement(getter_AddRefs(element), nodeInfo, PR_FALSE);
     NS_ENSURE_SUCCESS(result, result);
 
     nsCOMPtr<nsIStyleSheetLinkingElement> ssle(do_QueryInterface(element));
 
     if (ssle) {
       // XXX need prefs. check here.
       if (!mInsideNoXXXTag) {
         ssle->InitStyleLinkElement(PR_FALSE);
--- a/content/html/document/src/nsHTMLFragmentContentSink.cpp
+++ b/content/html/document/src/nsHTMLFragmentContentSink.cpp
@@ -1193,17 +1193,17 @@ nsHTMLParanoidFragmentSink::AddLeaf(cons
       nsCOMPtr<nsINodeInfo> nodeInfo;
       nsIParserService* parserService = nsContentUtils::GetParserService();
       if (!parserService)
         return NS_ERROR_OUT_OF_MEMORY;
       rv = mNodeInfoManager->GetNodeInfo(name, nsnull,
                                          kNameSpaceID_None,
                                          getter_AddRefs(nodeInfo));
       NS_ENSURE_SUCCESS(rv, rv);
-      rv = NS_NewHTMLElement(getter_AddRefs(content), nodeInfo);
+      rv = NS_NewHTMLElement(getter_AddRefs(content), nodeInfo, PR_FALSE);
       NS_ENSURE_SUCCESS(rv, rv);
       AddAttributes(aNode, content);
       ProcessBaseTag(content);
       return NS_OK;
     }
 
     if (!sAllowedTags || !sAllowedTags->GetEntry(name)) {
       return NS_OK;
--- a/content/html/document/src/nsPluginDocument.cpp
+++ b/content/html/document/src/nsPluginDocument.cpp
@@ -240,17 +240,17 @@ nsPluginDocument::CreateSyntheticPluginD
 
 
   // make plugin content
   nsCOMPtr<nsINodeInfo> nodeInfo;
   rv = mNodeInfoManager->GetNodeInfo(nsGkAtoms::embed, nsnull,
                                      kNameSpaceID_None,
                                     getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
-  rv = NS_NewHTMLElement(getter_AddRefs(mPluginContent), nodeInfo);
+  rv = NS_NewHTMLElement(getter_AddRefs(mPluginContent), nodeInfo, PR_FALSE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // make it a named element
   mPluginContent->SetAttr(kNameSpaceID_None, nsGkAtoms::name,
                           NS_LITERAL_STRING("plugin"), PR_FALSE);
 
   // fill viewport and auto-resize
   NS_NAMED_LITERAL_STRING(percent100, "100%");
--- a/content/xml/document/src/nsXMLContentSink.cpp
+++ b/content/xml/document/src/nsXMLContentSink.cpp
@@ -1,9 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 sw=2 et tw=78: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -501,27 +502,29 @@ nsXMLContentSink::CreateElement(const PR
   NS_ASSERTION(aNodeInfo, "can't create element without nodeinfo");
 
   *aResult = nsnull;
   *aAppendContent = PR_TRUE;
   nsresult rv = NS_OK;
 
   nsCOMPtr<nsIContent> content;
   rv = NS_NewElement(getter_AddRefs(content), aNodeInfo->NamespaceID(),
-                     aNodeInfo);
+                     aNodeInfo, PR_TRUE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_XHTML)
 #ifdef MOZ_SVG
       || aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_SVG)
 #endif
     ) {
     nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(content);
     sele->SetScriptLineNumber(aLineNumber);
-    sele->WillCallDoneAddingChildren();
+    if (aNodeInfo->Equals(nsGkAtoms::script, kNameSpaceID_SVG)) {
+      sele->WillCallDoneAddingChildren();
+    }
     mConstrainSize = PR_FALSE;
   }
 
   // XHTML needs some special attention
   if (aNodeInfo->NamespaceEquals(kNameSpaceID_XHTML)) {
     mPrettyPrintHasFactoredElements = PR_TRUE;
   }
   else {
@@ -587,17 +590,17 @@ nsXMLContentSink::CloseElement(nsIConten
        (nodeInfo->NameAtom() == nsGkAtoms::select ||
         nodeInfo->NameAtom() == nsGkAtoms::textarea ||
         nodeInfo->NameAtom() == nsGkAtoms::object ||
         nodeInfo->NameAtom() == nsGkAtoms::applet))
 #ifdef MOZ_XTF
       || nodeInfo->NamespaceID() > kNameSpaceID_LastBuiltin
 #endif
       ) {
-    aContent->DoneAddingChildren(PR_FALSE);
+    aContent->DoneAddingChildren(HaveNotifiedForCurrentContent());
   }
   
   if (IsMonolithicContainer(nodeInfo)) {
     mInMonolithicContainer--;
   }
 
   if (!nodeInfo->NamespaceEquals(kNameSpaceID_XHTML) &&
       !nodeInfo->NamespaceEquals(kNameSpaceID_SVG)) {
@@ -904,16 +907,28 @@ nsXMLContentSink::PopContent()
   if (count == 0) {
     NS_WARNING("Popping empty stack");
     return;
   }
 
   mContentStack.RemoveElementAt(count - 1);
 }
 
+PRBool
+nsXMLContentSink::HaveNotifiedForCurrentContent() const
+{
+  PRUint32 stackLength = mContentStack.Length();
+  if (stackLength) {
+    const StackNode& stackNode = mContentStack[stackLength - 1];
+    nsIContent* parent = stackNode.mContent;
+    return stackNode.mNumFlushed == parent->GetChildCount();
+  }
+  return PR_TRUE;
+}
+
 void
 nsXMLContentSink::MaybeStartLayout(PRBool aIgnorePendingSheets)
 {
   // XXXbz if aIgnorePendingSheets is true, what should we do when
   // mXSLTProcessor or CanStillPrettyPrint()?
   if (mLayoutStarted || mXSLTProcessor || CanStillPrettyPrint()) {
     return;
   }
--- a/content/xml/document/src/nsXMLContentSink.h
+++ b/content/xml/document/src/nsXMLContentSink.h
@@ -142,16 +142,17 @@ protected:
   virtual nsresult FlushText();
 
   nsresult AddContentAsLeaf(nsIContent *aContent);
 
   nsIContent* GetCurrentContent();
   StackNode & GetCurrentStackNode();
   nsresult PushContent(nsIContent *aContent);
   void PopContent();
+  PRBool HaveNotifiedForCurrentContent() const;
 
   nsresult ProcessBASETag(nsIContent* aContent);
 
   nsresult FlushTags();
 
   void UpdateChildCounts();
 
   void DidAddContent()
--- a/content/xslt/src/xslt/txMozillaTextOutput.cpp
+++ b/content/xslt/src/xslt/txMozillaTextOutput.cpp
@@ -285,11 +285,11 @@ txMozillaTextOutput::createXHTMLElement(
 {
     *aResult = nsnull;
 
     nsCOMPtr<nsINodeInfo> ni;
     nsresult rv = mDocument->NodeInfoManager()->
         GetNodeInfo(aName, nsnull, kNameSpaceID_XHTML, getter_AddRefs(ni));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    return NS_NewHTMLElement(aResult, ni);
+    return NS_NewHTMLElement(aResult, ni, PR_FALSE);
 }
 
--- a/content/xslt/src/xslt/txMozillaXMLOutput.cpp
+++ b/content/xslt/src/xslt/txMozillaXMLOutput.cpp
@@ -544,17 +544,17 @@ txMozillaXMLOutput::startElementInternal
     mOpenedElementIsHTML = PR_FALSE;
 
     // Create the element
     nsCOMPtr<nsINodeInfo> ni;
     rv = mNodeInfoManager->GetNodeInfo(aLocalName, aPrefix, aNsID,
                                        getter_AddRefs(ni));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    NS_NewElement(getter_AddRefs(mOpenedElement), aElemType, ni);
+    NS_NewElement(getter_AddRefs(mOpenedElement), aElemType, ni, PR_FALSE);
 
     // Set up the element and adjust state
     if (!mNoFixup) {
         if (aElemType == kNameSpaceID_XHTML) {
             mOpenedElementIsHTML = aNsID != kNameSpaceID_XHTML;
             rv = startHTMLElement(mOpenedElement, mOpenedElementIsHTML);
             NS_ENSURE_SUCCESS(rv, rv);
 
@@ -983,17 +983,17 @@ txMozillaXMLOutput::createHTMLElement(ns
     *aResult = nsnull;
 
     nsCOMPtr<nsINodeInfo> ni;
     nsresult rv = mNodeInfoManager->GetNodeInfo(aName, nsnull,
                                                 kNameSpaceID_None,
                                                 getter_AddRefs(ni));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    return NS_NewHTMLElement(aResult, ni);
+    return NS_NewHTMLElement(aResult, ni, PR_FALSE);
 }
 
 txTransformNotifier::txTransformNotifier()
     : mPendingStylesheetCount(0),
       mInTransform(PR_FALSE)      
 {
 }
 
--- a/content/xul/document/src/nsXULDocument.cpp
+++ b/content/xul/document/src/nsXULDocument.cpp
@@ -3522,17 +3522,17 @@ nsXULDocument::CreateElementFromPrototyp
         // for this node.
         nsCOMPtr<nsINodeInfo> newNodeInfo;
         rv = mNodeInfoManager->GetNodeInfo(aPrototype->mNodeInfo->NameAtom(),
                                            aPrototype->mNodeInfo->GetPrefixAtom(),
                                            aPrototype->mNodeInfo->NamespaceID(),
                                            getter_AddRefs(newNodeInfo));
         if (NS_FAILED(rv)) return rv;
         rv = NS_NewElement(getter_AddRefs(result), newNodeInfo->NamespaceID(),
-                           newNodeInfo);
+                           newNodeInfo, PR_FALSE);
         if (NS_FAILED(rv)) return rv;
 
 #ifdef MOZ_XTF
         if (result && newNodeInfo->NamespaceID() > kNameSpaceID_LastBuiltin) {
             result->BeginAddingChildren();
         }
 #endif
 
--- a/content/xul/templates/src/nsXULContentBuilder.cpp
+++ b/content/xul/templates/src/nsXULContentBuilder.cpp
@@ -1625,17 +1625,18 @@ nsXULContentBuilder::CreateElement(PRInt
 
     nsresult rv;
     nsCOMPtr<nsIContent> result;
 
     nsCOMPtr<nsINodeInfo> nodeInfo;
     doc->NodeInfoManager()->GetNodeInfo(aTag, nsnull, aNameSpaceID,
                                         getter_AddRefs(nodeInfo));
 
-    rv = NS_NewElement(getter_AddRefs(result), aNameSpaceID, nodeInfo);
+    rv = NS_NewElement(getter_AddRefs(result), aNameSpaceID, nodeInfo,
+                       PR_FALSE);
     if (NS_FAILED(rv))
         return rv;
 
     *aResult = result;
     NS_ADDREF(*aResult);
     return NS_OK;
 }
 
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -1044,17 +1044,17 @@ nsComboboxControlFrame::CreateAnonymousC
   if (!aElements.AppendElement(mDisplayContent))
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsCOMPtr<nsINodeInfo> nodeInfo;
   nimgr->GetNodeInfo(nsGkAtoms::input, nsnull, kNameSpaceID_None,
                      getter_AddRefs(nodeInfo));
 
   // create button which drops the list down
-  NS_NewHTMLElement(getter_AddRefs(mButtonContent), nodeInfo);
+  NS_NewHTMLElement(getter_AddRefs(mButtonContent), nodeInfo, PR_FALSE);
   if (!mButtonContent)
     return NS_ERROR_OUT_OF_MEMORY;
 
   // make someone to listen to the button. If its pressed by someone like Accessibility
   // then open or close the combo box.
   mButtonListener = new nsComboButtonListener(this);
   if (!mButtonListener)
     return NS_ERROR_OUT_OF_MEMORY;
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -153,17 +153,17 @@ nsFileControlFrame::CreateAnonymousConte
   nsCOMPtr<nsIDocument> doc = mContent->GetDocument();
 
   nsCOMPtr<nsINodeInfo> nodeInfo;
   doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::input, nsnull,
                                       kNameSpaceID_None,
                                       getter_AddRefs(nodeInfo));
 
   // Create the text content
-  NS_NewHTMLElement(getter_AddRefs(mTextContent), nodeInfo);
+  NS_NewHTMLElement(getter_AddRefs(mTextContent), nodeInfo, PR_FALSE);
   if (!mTextContent)
     return NS_ERROR_OUT_OF_MEMORY;
 
   mTextContent->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
                         NS_LITERAL_STRING("text"), PR_FALSE);
 
   nsCOMPtr<nsIDOMHTMLInputElement> textControl = do_QueryInterface(mTextContent);
   if (textControl) {
@@ -190,17 +190,17 @@ nsFileControlFrame::CreateAnonymousConte
     do_QueryInterface(mTextContent);
   NS_ENSURE_STATE(dom3TextContent);
   // Register as an event listener of the textbox
   // to open file dialog on mouse click
   dom3TextContent->AddGroupedEventListener(click, mMouseListener, PR_FALSE,
                                            systemGroup);
 
   // Create the browse button
-  NS_NewHTMLElement(getter_AddRefs(mBrowse), nodeInfo);
+  NS_NewHTMLElement(getter_AddRefs(mBrowse), nodeInfo, PR_FALSE);
   if (!mBrowse)
     return NS_ERROR_OUT_OF_MEMORY;
 
   mBrowse->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
                    NS_LITERAL_STRING("button"), PR_FALSE);
   nsCOMPtr<nsIDOMHTMLInputElement> fileContent = do_QueryInterface(mContent);
   nsCOMPtr<nsIDOMHTMLInputElement> browseControl = do_QueryInterface(mBrowse);
   if (fileContent && browseControl) {
--- a/layout/forms/nsIsIndexFrame.cpp
+++ b/layout/forms/nsIsIndexFrame.cpp
@@ -189,17 +189,17 @@ nsIsIndexFrame::CreateAnonymousContent(n
   nsCOMPtr<nsIDocument> doc = mContent->GetDocument();
   nsNodeInfoManager *nimgr = doc->NodeInfoManager();
 
   // Create an hr
   nsCOMPtr<nsINodeInfo> hrInfo;
   nimgr->GetNodeInfo(nsGkAtoms::hr, nsnull, kNameSpaceID_None,
                      getter_AddRefs(hrInfo));
 
-  NS_NewHTMLElement(getter_AddRefs(mPreHr), hrInfo);
+  NS_NewHTMLElement(getter_AddRefs(mPreHr), hrInfo, PR_FALSE);
   if (!mPreHr || !aElements.AppendElement(mPreHr))
     return NS_ERROR_OUT_OF_MEMORY;
 
   // Add a child text content node for the label
   NS_NewTextNode(getter_AddRefs(mTextContent), nimgr);
   if (!mTextContent)
     return NS_ERROR_OUT_OF_MEMORY;
 
@@ -208,31 +208,31 @@ nsIsIndexFrame::CreateAnonymousContent(n
   if (!aElements.AppendElement(mTextContent))
     return NS_ERROR_OUT_OF_MEMORY;
 
   // Create text input field
   nsCOMPtr<nsINodeInfo> inputInfo;
   nimgr->GetNodeInfo(nsGkAtoms::input, nsnull, kNameSpaceID_None,
                      getter_AddRefs(inputInfo));
 
-  NS_NewHTMLElement(getter_AddRefs(mInputContent), inputInfo);
+  NS_NewHTMLElement(getter_AddRefs(mInputContent), inputInfo, PR_FALSE);
   if (!mInputContent)
     return NS_ERROR_OUT_OF_MEMORY;
 
   mInputContent->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
                          NS_LITERAL_STRING("text"), PR_FALSE);
 
   if (!aElements.AppendElement(mInputContent))
     return NS_ERROR_OUT_OF_MEMORY;
 
   // Register as an event listener to submit on Enter press
   mInputContent->AddEventListenerByIID(this, NS_GET_IID(nsIDOMKeyListener));
 
   // Create an hr
-  NS_NewHTMLElement(getter_AddRefs(mPostHr), hrInfo);
+  NS_NewHTMLElement(getter_AddRefs(mPostHr), hrInfo, PR_FALSE);
   if (!mPostHr || !aElements.AppendElement(mPostHr))
     return NS_ERROR_OUT_OF_MEMORY;
 
   return NS_OK;
 }
 
 // Frames are not refcounted, no need to AddRef
 NS_IMETHODIMP
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -1695,17 +1695,17 @@ nsTextControlFrame::CreateAnonymousConte
 
   // Now create a DIV and add it to the anonymous content child list.
   nsCOMPtr<nsINodeInfo> nodeInfo;
   nsresult rv = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::div, nsnull,
                                                     kNameSpaceID_XHTML,
                                                     getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = NS_NewHTMLElement(getter_AddRefs(mAnonymousDiv), nodeInfo);
+  rv = NS_NewHTMLElement(getter_AddRefs(mAnonymousDiv), nodeInfo, PR_FALSE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Set the div native anonymous, so CSS will be its style language
   // no matter what.
   mAnonymousDiv->SetNativeAnonymous();
 
   // Set the necessary style attributes on the text control.
 
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1696,39 +1696,39 @@ nsGfxScrollFrameInner::CreateAnonymousCo
     presContext->Document()->NodeInfoManager();
   nsCOMPtr<nsINodeInfo> nodeInfo;
   rv = nodeInfoManager->GetNodeInfo(nsGkAtoms::scrollbar, nsnull,
                                     kNameSpaceID_XUL, getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (canHaveHorizontal) {
     rv = NS_NewElement(getter_AddRefs(mHScrollbarContent),
-                       kNameSpaceID_XUL, nodeInfo);
+                       kNameSpaceID_XUL, nodeInfo, PR_FALSE);
     NS_ENSURE_SUCCESS(rv, rv);
     mHScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::orient,
                                 NS_LITERAL_STRING("horizontal"), PR_FALSE);
     if (!aElements.AppendElement(mHScrollbarContent))
       return NS_ERROR_OUT_OF_MEMORY;
   }
 
   if (canHaveVertical) {
     rv = NS_NewElement(getter_AddRefs(mVScrollbarContent),
-                       kNameSpaceID_XUL, nodeInfo);
+                       kNameSpaceID_XUL, nodeInfo, PR_FALSE);
     NS_ENSURE_SUCCESS(rv, rv);
     mVScrollbarContent->SetAttr(kNameSpaceID_None, nsGkAtoms::orient,
                                 NS_LITERAL_STRING("vertical"), PR_FALSE);
     if (!aElements.AppendElement(mVScrollbarContent))
       return NS_ERROR_OUT_OF_MEMORY;
   }
 
   if (canHaveHorizontal && canHaveVertical) {
     nodeInfoManager->GetNodeInfo(nsGkAtoms::scrollcorner, nsnull,
                                  kNameSpaceID_XUL, getter_AddRefs(nodeInfo));
     rv = NS_NewElement(getter_AddRefs(mScrollCornerContent),
-                       kNameSpaceID_XUL, nodeInfo);
+                       kNameSpaceID_XUL, nodeInfo, PR_FALSE);
     NS_ENSURE_SUCCESS(rv, rv);
     if (!aElements.AppendElement(mScrollCornerContent))
       return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }