Skip to content

Commit

Permalink
Don't ever check for fragment intersections when painting ancestor cl…
Browse files Browse the repository at this point in the history
…ipping

masks, or clip to the compositing container.

It doesn't make sense to do this, because (a) it doesn't achieve anything,
and similar optimizations are already implemented in CompositedLayerMapping, and
(b) it is not quite correct, because the overflow clip of the stacking ancestor
is applied before checking fragment intersections, which can be wrong if the
descendant is not clipped. This latter condition caused issue 747364.

Bug: 749760, 747364
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I1485cc86c2f0dfc222171d1b53eb27f083d2c2c8
Reviewed-on: https://chromium-review.googlesource.com/589825
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490502}
  • Loading branch information
chrishtr authored and Commit Bot committed Jul 28, 2017
1 parent 4735fae commit a1fa33f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions third_party/WebKit/LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,9 @@ crbug.com/492664 external/wpt/css/css-writing-modes-3/clip-rect-vrl-006.xht [ Fa
crbug.com/492664 external/wpt/css/css-writing-modes-3/clip-rect-vrl-008.xht [ Failure ]
crbug.com/492664 external/wpt/css/css-writing-modes-3/line-box-direction-vrl-009.xht [ Failure ]

crbug.com/749760 compositing/overflow/relpos-under-abspos-border-radius.html [ Failure ]
crbug.com/749760 virtual/prefer_compositing_to_lcd_text/compositing/overflow/relpos-under-abspos-border-radius.html [ Failure ]

crbug.com/637255 [ Win10 ] media/video-transformed.html [ Pass Failure ]

# These tests pass but images do not match because tests are stricter than the spec.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE html>
<div id=border-radius style="border-radius: 5px; overflow: hidden; position: absolute; width: 100px; height: 100px; top: 0px; left: 0px; backface-visibility: hidden; ">
<div id=child style="width: 25px; height: 25px; position: relative; background: green; ">
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<!-- Passes if there is a rounded green rect at the top left -->
<div id=root style="margin-left: 200px; margin-top: 200px; width: 20px; height: 20px; opacity: 0.99999; overflow: hidden;">
<div id=border-radius style="border-radius: 5px; overflow: hidden; position: absolute; width: 100px; height: 100px; top: 0px; left: 0px; backface-visibility: hidden; ">
<div id=child style="width: 25px; height: 25px; position: relative; background: green; ">
</div>
</div>
</div>
6 changes: 3 additions & 3 deletions third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ PaintResult PaintLayerPainter::PaintLayerContents(
paint_layer_.ConvertToLayerCoords(local_painting_info.root_layer,
offset_to_clipper);
local_painting_info.paint_dirty_rect.MoveBy(offset_to_clipper);
// Overflow clip of the compositing container is irrelevant.
respect_overflow_clip = kIgnoreOverflowClip;
}

// TODO(trchen): We haven't decided how to handle visual fragmentation with
Expand Down Expand Up @@ -509,9 +511,7 @@ PaintResult PaintLayerPainter::PaintLayerContents(
fragment.foreground_rect.Move(negative_offset);
fragment.pagination_offset.Move(negative_offset);
}
}

if (should_paint_content) {
} else if (should_paint_content) {
// TODO(wangxianzhu): This is for old slow scrolling. Implement similar
// optimization for slimming paint v2.
should_paint_content = AtLeastOneFragmentIntersectsDamageRect(
Expand Down

0 comments on commit a1fa33f

Please sign in to comment.