Bug 591619 followup. Need to allow the <select>'s anonymous kids. a=orange
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 03 Dec 2010 23:16:07 -0500
changeset 58594 e19fb998583e3484ce77557d47710d00c0737de2
parent 58593 e6267230056e50d19ea3f104fa03a343e4d9409e
child 58595 ec5c700a5f7e88919a17886450de9897d74caacf
push idunknown
push userunknown
push dateunknown
reviewersorange
bugs591619
milestone2.0b8pre
Bug 591619 followup. Need to allow the <select>'s anonymous kids. a=orange
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -5170,17 +5170,19 @@ nsCSSFrameConstructor::AddFrameConstruct
     // Check tag first, since that check will usually fail
     nsIAtom* parentTag = parent->Tag();
     if ((parentTag == nsGkAtoms::select || parentTag == nsGkAtoms::optgroup) &&
         parent->IsHTML() &&
         // <option> is ok no matter what
         !aContent->IsHTML(nsGkAtoms::option) &&
         // <optgroup> is OK in <select> but not in <optgroup>
         (!aContent->IsHTML(nsGkAtoms::optgroup) ||
-         parentTag != nsGkAtoms::select)) {
+         parentTag != nsGkAtoms::select) &&
+        // Allow native anonymous content no matter what
+        !aContent->IsRootOfNativeAnonymousSubtree()) {
       // No frame for aContent
       if (!isText) {
         SetAsUndisplayedContent(aState.mFrameManager, aContent, styleContext,
                                 isGeneratedContent);
       }
       return;
     }
   }