New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 792280 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[SPv1/SPv175] Composited clip-path applies in wrong order.

Project Member Reported by trchen@chromium.org, Dec 6 2017

Issue description

CSS clip-path is a stacking context effect, and should be applied to effect output. In our current code CLM applies clip-path to composited children as a mask layer child_clipping_mask_layer_. 

For non-pixel-moving effects, it is alright because clip and effect commute. However for pixel-moving effects like blur, the result will be incorrect.

For example (http://jsbin.com/mituqevama/):
<div style="clip-path:circle(); filter:blur(10px); width:100px; height:100px;">
  <div style="background:red; position:relative; left:-100px; top:-100px; width:300px; height:300px; will-change:transform;"></div>
</div>

Expectation(http://jsbin.com/godopuwiqi/):
<div style="clip-path:circle(); width:100px; height:100px; background:red;"></div>
The expected result should be a sharp red circle, not blurry red circle.
 
Components: Blink>Compositing Blink>Paint
Status: Assigned (was: Untriaged)
Upon further inspection, the bug description is not quite accurate.

Our actual implementation does have a hack that applies child_clipping_mask_layer_ to the main graphics layer instead, when clip-path is present. However this have a number of side-effects:

1. Composited border-radius will be applied in incorrect order instead.
2. Composited mask no longer applies.

Also CompositedLayerMapping::UpdateChildClippingMaskLayerGeometry() doesn't set OffsetFromLayoutObject on the child clipping mask layer properly.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f89ae106e06d15200d783cb6950961ba999edebe

commit f89ae106e06d15200d783cb6950961ba999edebe
Author: Tien-Ren Chen <trchen@chromium.org>
Date: Mon Jan 29 23:19:28 2018

[Blink/SPv1] Move composited clip-path to share layer with masks

Previously composited clip-path are applied multiple times, and can be
applied in the wrong order. This CL makes it so that composited
clip-path is always and only painted in the mask layer.

BUG= 792280 , 792311 

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I4544c1709e98ca70996655e2e4bbbdc8fc7bd78a
Reviewed-on: https://chromium-review.googlesource.com/858299
Commit-Queue: Tien-Ren Chen <trchen@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532650}
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v175
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/compositing/images/direct-image-clip-path-expected.png
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/compositing/images/direct-image-dynamic-clip-path-expected.png
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/compositing/masks/mask-layer-size-expected.txt
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/compositing/overflow/accelerated-scrolling-with-clip-path-expected.png
[add] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/paint/clipath/clip-path-with-background-and-box-behind-expected.png
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/paint/invalidation/clip/clip-path-constant-repaint-expected.txt
[add] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/platform/linux/virtual/spv175/compositing/masks/mask-layer-size-expected.txt
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/platform/mac/compositing/masks/multiple-masks-expected.png
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/LayoutTests/platform/mac/compositing/masks/simple-composited-mask-expected.png
[delete] https://crrev.com/e34e01b1b0987e418bc22e3ef1cf2e4ecaead264/third_party/WebKit/LayoutTests/platform/mac/paint/clipath/clip-path-with-background-and-box-behind-expected.png
[delete] https://crrev.com/e34e01b1b0987e418bc22e3ef1cf2e4ecaead264/third_party/WebKit/LayoutTests/platform/win/paint/clipath/clip-path-with-background-and-box-behind-expected.png
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/layout/LayoutBox.cpp
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/layout/LayoutInline.cpp
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/layout/LayoutObject.cpp
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/layout/LayoutObject.h
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/layout/LayoutTableRow.h
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/BUILD.gn
[add] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/CSSMaskPainter.cpp
[add] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/CSSMaskPainter.h
[add] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/CSSMaskPainterTest.cpp
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/PaintLayer.cpp
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/PaintLayerPaintingInfo.h
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.h
[modify] https://crrev.com/f89ae106e06d15200d783cb6950961ba999edebe/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinder.cpp

Status: Fixed (was: Assigned)
There is still a bug in SPv1 that the main graphics layer is clipped inadvertently, although the effect application order is correct now. This has been fixed by BGPT. Yay!

Sign in to add a comment