Bug 1545360: Make nsBoxFrame and nsLeafBoxFrame invoke (or inherit) superclass MarkIntrinsicISizesDirty() method. r=emilio a=pascalc
authorDaniel Holbert <dholbert@cs.stanford.edu>
Sun, 21 Apr 2019 01:47:36 +0000
changeset 523304 9c937da2511daebe7f34ad3a89e53c87ff56ae5e
parent 523303 26a86dd8c8bc764d88320c9723e4d3135fed1137
child 523305 3a1b53518d5ff472eb17f214bb02fc82b1675890
push id11138
push userarchaeopteryx@coole-files.de
push dateTue, 23 Apr 2019 19:02:09 +0000
treeherdermozilla-beta@c53e3fd76964 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio, pascalc
bugs1545360
milestone67.0
Bug 1545360: Make nsBoxFrame and nsLeafBoxFrame invoke (or inherit) superclass MarkIntrinsicISizesDirty() method. r=emilio a=pascalc These functions have a comment that suggests that the inherited functionality isn't applicable and would all be skipped. This comment is no longer true, so let's make use of the inherited function. Differential Revision: https://phabricator.services.mozilla.com/D28264
layout/reftests/bugs/1545360-1-ref.xhtml
layout/reftests/bugs/1545360-1.xhtml
layout/reftests/bugs/reftest.list
layout/xul/nsBoxFrame.cpp
layout/xul/nsLeafBoxFrame.cpp
layout/xul/nsLeafBoxFrame.h
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1545360-1-ref.xhtml
@@ -0,0 +1,27 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+<style>
+  .container {
+      display: flex;
+      flex-direction: column;
+      outline: 1px solid black;
+  }
+  .item {
+      border: 0px solid pink;
+      box-sizing: content-box;
+  }
+  .withBorderTop {
+      border-top-width: 20px;
+  }
+</style>
+<body>
+  <div class="container">
+    <xul:toolbarpaletteitem
+      class="item withBorderTop">abc</xul:toolbarpaletteitem>
+    <xul:toolbarpaletteitem
+      class="item">def</xul:toolbarpaletteitem>
+    <xul:toolbarpaletteitem
+      class="item">ghi</xul:toolbarpaletteitem>
+  </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1545360-1.xhtml
@@ -0,0 +1,35 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+      class="reftest-wait">
+<style>
+  .container {
+      display: flex;
+      flex-direction: column;
+      outline: 1px solid black;
+  }
+  .item {
+      border: 0px solid pink;
+      box-sizing: content-box;
+  }
+  .withBorderTop {
+      border-top-width: 20px;
+  }
+</style>
+<script>
+  function doTest() {
+    tweakMe.classList.add('withBorderTop');
+    document.documentElement.removeAttribute("class");
+  }
+  window.addEventListener("MozReftestInvalidate", doTest);
+</script>
+<body>
+  <div class="container">
+    <xul:toolbarpaletteitem
+      class="item" id="tweakMe">abc</xul:toolbarpaletteitem>
+    <xul:toolbarpaletteitem
+      class="item">def</xul:toolbarpaletteitem>
+    <xul:toolbarpaletteitem
+      class="item">ghi</xul:toolbarpaletteitem>
+  </div>
+</body>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -2100,8 +2100,9 @@ fuzzy(0-1,0-625) == 1466638-1.html 14666
 test-pref(layout.css.contain.enabled,true) == 1483946.html 1483946-ref.html
 test-pref(layout.css.visited_links_enabled,false) == 1488155.html 1488155-ref.html
 == 1492660-1.html 1492660-1-ref.html
 pref(layout.css.supports-selector.enabled,true) == 1499386.html 1499386-ref.html
 pref(layout.css.supports-selector.enabled,false) != 1499386.html 1499386-ref.html
 == 1509425-1.html 1509425-1-ref.html
 == 1511570.html 1511570-ref.html
 == 1535040-1.html 1535040-1-ref.html
+== 1545360-1.xhtml 1545360-1-ref.xhtml
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -851,18 +851,17 @@ void nsBoxFrame::MarkIntrinsicISizesDirt
   CoordNeedsRecalc(mFlex);
   CoordNeedsRecalc(mAscent);
 
   if (mLayoutManager) {
     nsBoxLayoutState state(PresContext());
     mLayoutManager->IntrinsicISizesDirty(this, state);
   }
 
-  // Don't call base class method, since everything it does is within an
-  // IsXULBoxWrapped check.
+  nsContainerFrame::MarkIntrinsicISizesDirty();
 }
 
 void nsBoxFrame::RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) {
   MOZ_ASSERT(aListID == kPrincipalList, "We don't support out-of-flow kids");
 
   nsPresContext* presContext = PresContext();
   nsBoxLayoutState state(presContext);
 
--- a/layout/xul/nsLeafBoxFrame.cpp
+++ b/layout/xul/nsLeafBoxFrame.cpp
@@ -329,18 +329,12 @@ nsSize nsLeafBoxFrame::GetXULMaxSize(nsB
 /* virtual */
 nscoord nsLeafBoxFrame::GetXULFlex() { return nsBox::GetXULFlex(); }
 
 /* virtual */
 nscoord nsLeafBoxFrame::GetXULBoxAscent(nsBoxLayoutState& aState) {
   return nsBox::GetXULBoxAscent(aState);
 }
 
-/* virtual */
-void nsLeafBoxFrame::MarkIntrinsicISizesDirty() {
-  // Don't call base class method, since everything it does is within an
-  // IsXULBoxWrapped check.
-}
-
 NS_IMETHODIMP
 nsLeafBoxFrame::DoXULLayout(nsBoxLayoutState& aState) {
   return nsBox::DoXULLayout(aState);
 }
--- a/layout/xul/nsLeafBoxFrame.h
+++ b/layout/xul/nsLeafBoxFrame.h
@@ -32,17 +32,16 @@ class nsLeafBoxFrame : public nsLeafFram
   }
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
   // nsIHTMLReflow overrides
 
-  virtual void MarkIntrinsicISizesDirty() override;
   virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
   virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
 
   // Our auto size is that provided by nsFrame, not nsLeafFrame
   virtual mozilla::LogicalSize ComputeAutoSize(
       gfxContext* aRenderingContext, mozilla::WritingMode aWM,
       const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize,
       const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorder,