This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch tor-browser-91.13.0esr-11.5-1 in repository tor-browser.
commit be6e2ad78a9a2c6dd7b00a02a961009403305098 Author: Timothy Nikkel tnikkel@gmail.com AuthorDate: Wed Oct 5 22:03:29 2022 +0000
Bug 1792643. Set clip on background items for table cols and colgroups, when the table row, rowgroup or table has captured clip. r=mstange, a=dmeehan
Exactly like bug 1735265 except a frame other then the cell, between the cell and the table frame is a stacking context.
Differential Revision: https://phabricator.services.mozilla.com/D158471 --- layout/reftests/bugs/1792643-1-ref.html | 36 +++++++++++++++++++++++++++++ layout/reftests/bugs/1792643-1.html | 40 +++++++++++++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 1 + layout/tables/nsTableCellFrame.cpp | 28 +++++++++++++---------- 4 files changed, 93 insertions(+), 12 deletions(-)
diff --git a/layout/reftests/bugs/1792643-1-ref.html b/layout/reftests/bugs/1792643-1-ref.html new file mode 100644 index 000000000000..444853c34151 --- /dev/null +++ b/layout/reftests/bugs/1792643-1-ref.html @@ -0,0 +1,36 @@ +<html> + +<head> + <meta charset="utf-8"> + <title>Test for bug 1792643</title> + <style> + table { + width: 500px; + } + + th { + background-color: green; + } + + div { + width: 300px; + overflow: hidden; + } + </style> +</head> + +<body> + <div> + <table> + <colgroup></colgroup> + <tr style="filter: hue-rotate(0);"> + <th>foo</th> + </tr> + <tr style="will-change: transform;"> + <th>bar</th> + </tr> + </table> + </div> +</body> + +</html> diff --git a/layout/reftests/bugs/1792643-1.html b/layout/reftests/bugs/1792643-1.html new file mode 100644 index 000000000000..8391f64fd1b1 --- /dev/null +++ b/layout/reftests/bugs/1792643-1.html @@ -0,0 +1,40 @@ +<html> + +<head> + <meta charset="utf-8"> + <title>Test for bug 1792643</title> + <style> + table { + width: 500px; + } + + th { + background-color: green; + } + + colgroup { + background-color: red; + } + + div { + width: 300px; + overflow: hidden; + } + </style> +</head> + +<body> + <div> + <table> + <colgroup></colgroup> + <tr style="filter: hue-rotate(0);"> + <th>foo</th> + </tr> + <tr style="will-change: transform;"> + <th>bar</th> + </tr> + </table> + </div> +</body> + +</html> diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 470027f91dd9..1c2461782174 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -2105,3 +2105,4 @@ fuzzy(0-2,0-96600) == 1648282-1b.html 1648282-1-ref.html != chrome://reftest/content/bugs/1688004.xhtml about:blank == 1726663-1.html 1726663-1-ref.html == 1735265-1.html 1735265-1-ref.html +== 1792643-1.html 1792643-1-ref.html diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 163de5ac03a2..385a68d57232 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -483,7 +483,8 @@ void nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, }
// display borders if we need to - ProcessBorders(GetTableFrame(), aBuilder, aLists); + nsTableFrame* tableFrame = GetTableFrame(); + ProcessBorders(tableFrame, aBuilder, aLists);
// and display the selection border if we need to if (IsSelected()) { @@ -513,17 +514,20 @@ void nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, DisplayListClipState::AutoSaveRestore clipState(aBuilder); nsDisplayListBuilder::AutoCurrentActiveScrolledRootSetter asrSetter( aBuilder); - if (IsStackingContext()) { - // The col/colgroup items we create below will be inserted directly into the - // BorderBackgrounds list of the table frame. That means that they'll be moved - // *outside* of any wrapper items from this table cell, and will not participate in - // this table cell's opacity / transform / filter / mask effects. - // If this cell is a stacking context, then we may have one or more of those - // wrapper items, and one of them may have captured a clip. In order to ensure - // correct clipping and scrolling of the col/colgroup items, restore the clip and ASR - // that we observed when we entered the table frame. - // If this cell is a stacking context but doesn't have any clip capturing wrapper items, - // then we'll double-apply the clip. That's ok. + if (IsStackingContext() || row->IsStackingContext() || + rowGroup->IsStackingContext() || tableFrame->IsStackingContext()) { + // The col/colgroup items we create below will be inserted directly into + // the BorderBackgrounds list of the table frame. That means that + // they'll be moved *outside* of any wrapper items created for any + // frames between this table cell frame and the table wrapper frame, and + // will not participate in those frames's opacity / transform / filter / + // mask effects. If one of those frames is a stacking context, then we + // may have one or more of those wrapper items, and one of them may have + // captured a clip. In order to ensure correct clipping and scrolling of + // the col/colgroup items, restore the clip and ASR that we observed + // when we entered the table frame. If that frame is a stacking context + // but doesn't have any clip capturing wrapper items, then we'll + // double-apply the clip. That's ok. clipState.SetClipChainForContainingBlockDescendants( backgrounds->GetTableClipChain()); asrSetter.SetCurrentActiveScrolledRoot(backgrounds->GetTableASR());