Bug 1409114 - Part 5: Skip box-shadow for table column and column groups. r=dbaron
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 20 May 2019 23:15:19 +0000
changeset 474631 34651ebcbaf4c94329b367e1752ba15dc0d25604
parent 474630 5137a23cfbba44349e31649fb11e57b7fd3eeeba
child 474632 e88eae3b48a71d611ae395582d170548caf9bd28
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 5: Skip box-shadow for table column and column groups. r=dbaron This is a behaviour change, but I believe it matches the quoted spec text, and neither blink nor WebKit render these. Differential Revision: https://phabricator.services.mozilla.com/D29276
layout/tables/nsTableColFrame.cpp
layout/tables/nsTableColGroupFrame.cpp
--- a/layout/tables/nsTableColFrame.cpp
+++ b/layout/tables/nsTableColFrame.cpp
@@ -109,17 +109,21 @@ void nsTableColFrame::Reflow(nsPresConte
   if (collapseCol) {
     GetTableFrame()->SetNeedToCollapse(true);
   }
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void nsTableColFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
                                        const nsDisplayListSet& aLists) {
-  DisplayOutsetBoxShadow(aBuilder, aLists.BorderBackground());
+  // 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 and box-shadows fall into this category, so we skip them
+  // on these boxes.
 
   // Compute background rect by iterating all cell frame.
   AutoTArray<uint32_t, 1> colIdx;
   colIdx.AppendElement(GetColIndex());
 
   nsTableFrame* table = GetTableFrame();
   nsTableFrame::RowGroupArray rowGroups;
   table->OrderRowGroups(rowGroups);
@@ -129,23 +133,16 @@ void nsTableColFrame::BuildDisplayList(n
     if (!aBuilder->GetDirtyRect().Intersects(
             nsRect(offset, rowGroup->GetSize()))) {
       continue;
     }
     rowGroup->PaintCellBackgroundsForColumns(this, aBuilder, aLists, colIdx,
                                              offset);
   }
 
-  DisplayInsetBoxShadow(aBuilder, aLists.BorderBackground());
-
-  // 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; }
 
 #ifdef DEBUG
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -347,17 +347,21 @@ void nsTableColGroupFrame::Reflow(nsPres
   }
 
   aDesiredSize.ClearSize();
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void nsTableColGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
                                             const nsDisplayListSet& aLists) {
-  DisplayOutsetBoxShadow(aBuilder, aLists.BorderBackground());
+  // 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 and box-shadows fall into this category, so we skip them
+  // on these boxes.
 
   // Collecting column index.
   AutoTArray<uint32_t, 1> colIdx;
   for (nsTableColFrame* col = GetFirstColumn(); col; col = col->GetNextCol()) {
     MOZ_ASSERT(colIdx.IsEmpty() || static_cast<uint32_t>(col->GetColIndex()) >
                                        colIdx.LastElement());
     colIdx.AppendElement(col->GetColIndex());
   }
@@ -373,23 +377,16 @@ void nsTableColGroupFrame::BuildDisplayL
               nsRect(offset, rowGroup->GetSize()))) {
         continue;
       }
       rowGroup->PaintCellBackgroundsForColumns(this, aBuilder, aLists, colIdx,
                                                offset);
     }
   }
 
-  DisplayInsetBoxShadow(aBuilder, aLists.BorderBackground());
-
-  // 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);
 }