Bug 490173. Switching display from -moz-popup to block in an HTML document doesn't trigger a frame reconstruct. r+sr=dbaron
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 07 May 2009 15:21:54 -0400
changeset 28079 6aa0cb2a52fb28ddc616b4c0ecb910e26c8d83c4
parent 28078 53eebf02eac766300426cb0d386eb4a61564cd61
child 28080 55339f8d68fa5fcae6dffe4bb538e5345afee9b8
push id6886
push userbzbarsky@mozilla.com
push dateThu, 07 May 2009 19:24:34 +0000
treeherdermozilla-central@55339f8d68fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs490173
milestone1.9.2a1pre
Bug 490173. Switching display from -moz-popup to block in an HTML document doesn't trigger a frame reconstruct. r+sr=dbaron
layout/base/nsCSSFrameConstructor.cpp
layout/reftests/bugs/490173-1-ref.html
layout/reftests/bugs/490173-1.html
layout/reftests/bugs/490173-2-ref.html
layout/reftests/bugs/490173-2.html
layout/reftests/bugs/reftest.list
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -5295,40 +5295,43 @@ nsCSSFrameConstructor::AddFrameConstruct
     // And general display types
     if (!data) {
       data = FindDisplayData(display, aContent, styleContext);
     }
 
     NS_ASSERTION(data, "Should have frame construction data now");
 
     if (data->mBits & FCDATA_SUPPRESS_FRAME) {
+      aState.mFrameManager->SetUndisplayedContent(aContent, styleContext);
       return;
     }
 
 #ifdef MOZ_XUL
     if ((data->mBits & FCDATA_IS_POPUP) &&
         (!aParentFrame || // Parent is inline
          aParentFrame->GetType() != nsGkAtoms::menuFrame)) {
       if (!aState.mPopupItems.containingBlock &&
           !aState.mHavePendingPopupgroup) {
+        aState.mFrameManager->SetUndisplayedContent(aContent, styleContext);
         return;
       }
 
       isPopup = PR_TRUE;
     }
 #endif /* MOZ_XUL */
   }
 
   PRUint32 bits = data->mBits;
 
   // Inside colgroups, suppress everything except columns.
   if (aParentFrame &&
       aParentFrame->GetType() == nsGkAtoms::tableColGroupFrame &&
       (!(bits & FCDATA_IS_TABLE_PART) ||
        display->mDisplay != NS_STYLE_DISPLAY_TABLE_COLUMN)) {
+    aState.mFrameManager->SetUndisplayedContent(aContent, styleContext);
     return;
   }
 
   PRBool canHavePageBreak =
     (aFlags & ITEM_ALLOW_PAGE_BREAK) &&
     aState.mPresContext->IsPaginated() &&
     !display->IsAbsolutelyPositioned() &&
     !(bits & FCDATA_IS_TABLE_PART);
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/490173-1-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div>Foo</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/490173-1.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body onload="document.getElementById('f1').style.display = '';">
+<div id="f1" style="display: -moz-popup;">Foo</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/490173-2-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <table border="1">
+    <colgroup>
+      <col width="200">
+    </colgroup>
+    <tr><td>Foo</tr></td>
+  </table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/490173-2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body onload="document.getElementById('c1').style.display = '';">
+  <table border="1">
+    <colgroup>
+      <col id="c1" width="200" style="display: block">
+    </colgroup>
+    <tr><td>Foo</tr></td>
+  </table>
+</body>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1224,9 +1224,11 @@ fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 
 == 486052-2d.html 486052-2-ref.html
 == 486052-2e.html 486052-2-ref.html
 == 486052-2f.html 486052-2-ref.html
 == 486052-2g.html 486052-2-ref.html
 == 486848-1.xul 486848-1-ref.xul
 == 487539-1.html about:blank
 == 488390-1.html 488390-1-ref.html
 == 488685-1.html 488685-1-ref.html
+-- 490173-1.html 490173-1-ref.html
+-- 490173-2.html 490173-2-ref.html
 fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs EXTEND_PAD on non-Mac for correct scaling behaviour