Commit 9197bcb4 authored by Timothy Nikkel's avatar Timothy Nikkel
Browse files

Bug 1792643. Set clip on background items for table cols and colgroups, when...

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
parent 6ab474fe
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
<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>
+40 −0
Original line number Diff line number Diff line
<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>
+1 −0
Original line number Diff line number Diff line
@@ -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
+9 −6
Original line number Diff line number Diff line
@@ -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(