Bug 1398963 part 5: Treat XUL Popups like other OOF boxes when generating anon flex items, since they spawn placeholders. r?mats draft
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 18 Dec 2017 12:17:10 -0600
changeset 712753 9108124d2884dc0bf3448f82b8f829e56c46e77c
parent 712752 4000ef01995d563d73a232709fdf5e91aefa7480
child 712754 0fa6b57e0a117564594baad354c09c9f5fbde8d6
push id93413
push userdholbert@mozilla.com
push dateMon, 18 Dec 2017 18:17:28 +0000
reviewersmats
bugs1398963
milestone59.0a1
Bug 1398963 part 5: Treat XUL Popups like other OOF boxes when generating anon flex items, since they spawn placeholders. r?mats XUL popups (i.e. FrameConstructionItem instances with mIsPopup==true) behave like out-of-flow content -- in particular, they generate nsPlaceholderFrame instances. So, they need the same placeholder-wrapping behavior that we have for other out-of-flow frames inside of an emulated legacy box, in order to satisfy our existing invariants. MozReview-Commit-ID: KnspN4kTPnx
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -12900,23 +12900,25 @@ nsCSSFrameConstructor::FrameConstruction
   }
 
   if (aIsLegacyBox) {
     if (mStyleContext->StyleDisplay()->IsInlineOutsideStyle()) {
       // In an emulated legacy box, all inline-level content gets wrapped in an
       // anonymous flex item.
       return true;
     }
-    if (!(mFCData->mBits & FCDATA_DISALLOW_OUT_OF_FLOW) &&
-        aState.GetGeometricParent(mStyleContext->StyleDisplay(), nullptr)) {
-      // We're abspos or fixedpos, which means we'll spawn a placeholder which
-      // (because our container is an emulated legacy box) we'll need to wrap
-      // in an anonymous flex item.  So, we just treat _this_ frame as if _it_
-      // needs to be wrapped in an anonymous flex item, and then when we spawn
-      // the placeholder, it'll end up in the right spot.
+    if (mIsPopup ||
+        (!(mFCData->mBits & FCDATA_DISALLOW_OUT_OF_FLOW) &&
+         aState.GetGeometricParent(mStyleContext->StyleDisplay(), nullptr))) {
+      // We're abspos or fixedpos (or a XUL popup), which means we'll spawn a
+      // placeholder which (because our container is an emulated legacy box)
+      // we'll need to wrap in an anonymous flex item.  So, we just treat
+      // _this_ frame as if _it_ needs to be wrapped in an anonymous flex item,
+      // and then when we spawn the placeholder, it'll end up in the right
+      // spot.
       return true;
     }
   }
 
   return false;
 }
 
 inline bool