This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch base-browser-102.5.0esr-12.0-1 in repository tor-browser.
commit 9197bcb4a35ea86fd3f63ca5e1a5e1d31b27d5c0 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 | 15 ++++++++----- 4 files changed, 86 insertions(+), 6 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 03dcde776fc1..b9e87886b5e9 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -2116,3 +2116,4 @@ pref(image.downscale-during-decode.enabled,true) == 1744468-1.html 1744468-1-ref == 1747272-1.html 1747272-1-ref.html == 1750146-1.html 1750146-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 c9bfbe9aaf08..0849f27d1846 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -1066,7 +1066,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()) { @@ -1096,16 +1097,18 @@ void nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, DisplayListClipState::AutoSaveRestore clipState(aBuilder); nsDisplayListBuilder::AutoCurrentActiveScrolledRootSetter asrSetter( aBuilder); - if (IsStackingContext()) { + 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 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 + // 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 this cell is a stacking context + // 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(