Bug 1409114 - Part 4: Hoist outline skipping into col(group) frame code. r=dbaron
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 20 May 2019 23:14:59 +0000
changeset 474630 5137a23cfbba44349e31649fb11e57b7fd3eeeba
parent 474629 1782b76bbc228f32d9056415a831fdba1034ca5a
child 474631 34651ebcbaf4c94329b367e1752ba15dc0d25604
push id36042
push userdvarga@mozilla.com
push dateTue, 21 May 2019 04:19:40 +0000
treeherdermozilla-central@ca560ff55451 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1409114
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1409114 - Part 4: Hoist outline skipping into col(group) frame code. r=dbaron Differential Revision: https://phabricator.services.mozilla.com/D29275
layout/generic/nsFrame.cpp
layout/tables/nsTableColFrame.cpp
layout/tables/nsTableColGroupFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2346,28 +2346,26 @@ void nsFrame::DisplaySelectionOverlay(ns
   }
 
   aList->AppendNewToTop<nsDisplaySelectionOverlay>(aBuilder, this,
                                                    selectionValue);
 }
 
 void nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
                                           const nsDisplayListSet& aLists) {
+  // Per https://drafts.csswg.org/css-tables-3/#global-style-overrides:
+  // "All css properties of table-column and table-column-group boxes are
+  // ignored, except when explicitly specified by this specification."
+  // CSS outlines fall into this category, so we skip them on these boxes.
+  MOZ_ASSERT(!IsTableColGroupFrame() && !IsTableColFrame());
+
   if (!StyleOutline()->ShouldPaintOutline()) {
     return;
   }
 
-  if (IsTableColGroupFrame() || IsTableColFrame()) {
-    // Per https://drafts.csswg.org/css-tables-3/#global-style-overrides:
-    // "All css properties of table-column and table-column-group boxes are
-    // ignored, except when explicitly specified by this specification."
-    // CSS outlines fall into this category, so we skip them on these boxes.
-    return;
-  }
-
   if (HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT) &&
       GetScrollableOverflowRect().IsEmpty()) {
     // Skip parts of IB-splits with an empty overflow rect, see bug 434301.
     // We may still want to fix some of the overflow area calculations over in
     // that bug.
     return;
   }
 
--- a/layout/tables/nsTableColFrame.cpp
+++ b/layout/tables/nsTableColFrame.cpp
@@ -131,17 +131,20 @@ void nsTableColFrame::BuildDisplayList(n
       continue;
     }
     rowGroup->PaintCellBackgroundsForColumns(this, aBuilder, aLists, colIdx,
                                              offset);
   }
 
   DisplayInsetBoxShadow(aBuilder, aLists.BorderBackground());
 
-  DisplayOutline(aBuilder, aLists);
+  // Per https://drafts.csswg.org/css-tables-3/#global-style-overrides:
+  // "All css properties of table-column and table-column-group boxes are
+  // ignored, except when explicitly specified by this specification."
+  // CSS outlines fall into this category, so we skip them on these boxes.
 
   for (nsIFrame* kid : PrincipalChildList()) {
     BuildDisplayListForChild(aBuilder, kid, aLists);
   }
 }
 
 int32_t nsTableColFrame::GetSpan() { return StyleTable()->mSpan; }
 
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -375,17 +375,20 @@ void nsTableColGroupFrame::BuildDisplayL
       }
       rowGroup->PaintCellBackgroundsForColumns(this, aBuilder, aLists, colIdx,
                                                offset);
     }
   }
 
   DisplayInsetBoxShadow(aBuilder, aLists.BorderBackground());
 
-  DisplayOutline(aBuilder, aLists);
+  // Per https://drafts.csswg.org/css-tables-3/#global-style-overrides:
+  // "All css properties of table-column and table-column-group boxes are
+  // ignored, except when explicitly specified by this specification."
+  // CSS outlines fall into this category, so we skip them on these boxes.
 
   for (nsIFrame* kid : PrincipalChildList()) {
     BuildDisplayListForChild(aBuilder, kid, aLists);
   }
 }
 
 nsTableColFrame* nsTableColGroupFrame::GetFirstColumn() {
   return GetNextColumn(nullptr);