New issue
Advanced search Search tips

Issue 833076 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Clip-path clipping <foreignObject> broken with non rectangular and/or complex paths

Project Member Reported by chrishtr@chromium.org, Apr 14 2018

Issue description

Non-simple clip paths have no clip node:

https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/object_paint_properties.h?q=object_paint_properties.h&sq=package:chromium&dr=CSs&l=103


Also, here is the code for avoiding clip-path during hit testing:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/paint_layer.cc?type=cs&q=hittestclippedoutbyclippath&l=2360

It relies on the element that has a clip path having a PaintLayer, which is not the
case for SVG clips. e.g.

https://jsfiddle.net/vk8achyg/1/
 
Project Member

Comment 1 by sheriffbot@chromium.org, Apr 17 2018

This issue is marked as a release blocker with no milestone associated. Please add an appropriate milestone.

All release blocking issues should have milestones associated to it, so that the issue can tracked and the fixes can be pushed promptly.

This issue is marked as a release blocker with no OS labels associated. Please add an appropriate OS label.

All release blocking issues should have OS labels associated to it, so that the issue can tracked and promptly verified, once it gets fixed.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: M-67

Comment 3 by gov...@chromium.org, Apr 18 2018

Labels: OS-Android OS-Chrome OS-Linux OS-Mac OS-Windows

Comment 4 by gov...@chromium.org, Apr 25 2018

M67 Stable promotion is coming soon. Your bug is labelled as Stable ReleaseBlock, pls make sure to land the fix and request a merge into the release branch ASAP. Thank you.


*** Bulk Edit ***
M67 Stable promotion is coming soon. Your bug is labelled as Stable ReleaseBlock, pls make sure to land the fix and request a merge into the release branch ASAP. 

If fix is already merged to M67 and nothing else is pending, pls mark the bug as fixed. Thank you.
*** Bulk Edit ***
M67 Stable promotion is coming VERY soon. Your bug is labelled as Stable ReleaseBlock, pls make sure to land the fix and request a merge into the release branch ASAP. 

If fix is already merged to M67 and nothing else is pending, pls mark the bug as fixed. Thank you.

Comment 7 by cma...@chromium.org, May 10 2018

chrishtr@ please take a look and update the status of this stable blocker as soon as possible

Comment 8 by gov...@chromium.org, May 10 2018

*** Bulk Edit ***
M67 Stable promotion is coming VERY soon. Your bug is labelled as Stable ReleaseBlock, pls make sure to land the fix and request a merge into the release branch ASAP. 

If fix is already merged to M67 and nothing else is pending, pls mark the bug as fixed. Thank you.
An example that actually reproduces attached.

Hovering over an area outside of the circle but inside of its bounding
rect should not cause a hit test to return true.
test.html
410 bytes View Download
Project Member

Comment 10 by bugdroid1@chromium.org, May 11 2018

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

commit e718b946295929125f8c3283f9c94338e1eb4224
Author: Chris Harrelson <chrishtr@chromium.org>
Date: Fri May 11 23:01:36 2018

[ForeignObject PaintLayer] Fix <foreignObject> hit testing under simple SVG clip-path.

Now that <foreignObject> gets a PaintLayer, hit testing no longer works correctly
in the presence of a non-rectangular SVG clip path. This is because SVG children elements
which are not <foreignObject> cannot have a PaintLayer, and PaintLayer is the only way
hit testing currently knows how to account for clip-path.

Fix this for "simple" clip-paths by adding a method to perform hit test clipping
on the clip paint property tree. It works by checking all clips and clip-paths
stored on the clip paint property tree between the local and ancestor points
(in this use-case the ancestor is the containing PaintLayer), applying transforms
as necessary.

Non-"simple" clip paths (defined as SVG clip paths which have more than 42 edges
or having text) are not fixed by this CL. The former condition could be handled in the
future by adding a ClipPathForHitTesting to ClipPaintPropertyNode which stores the
clip-path beyond 42 edges.

Bug:833076

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Iabbce97d412fe38a4b775739517d28628ef67964
Reviewed-on: https://chromium-review.googlesource.com/1055788
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Tien-Ren Chen <trchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558049}
[modify] https://crrev.com/e718b946295929125f8c3283f9c94338e1eb4224/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc
[modify] https://crrev.com/e718b946295929125f8c3283f9c94338e1eb4224/third_party/blink/renderer/core/paint/paint_layer.cc
[modify] https://crrev.com/e718b946295929125f8c3283f9c94338e1eb4224/third_party/blink/renderer/platform/graphics/paint/geometry_mapper.cc
[modify] https://crrev.com/e718b946295929125f8c3283f9c94338e1eb4224/third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h
[modify] https://crrev.com/e718b946295929125f8c3283f9c94338e1eb4224/third_party/blink/renderer/platform/graphics/paint/geometry_mapper_test.cc

How is the change listed at #10 looking in canary?
Looks correct in Canary. Ready to merge.
Labels: Merge-Request-67
Project Member

Comment 14 by sheriffbot@chromium.org, May 14 2018

Labels: -Merge-Request-67 Merge-Review-67 Hotlist-Merge-Review
This bug requires manual review: M67 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), kbleicher@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-67 Merge-Approved-67
Approving merge to M67 branch 3396 based on comment #12. Please merge. Thank you.
Project Member

Comment 16 by bugdroid1@chromium.org, May 14 2018

Labels: -merge-approved-67 merge-merged-3396
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c7f11ffece231f155b53e0fd3334ac3f20eef6b5

commit c7f11ffece231f155b53e0fd3334ac3f20eef6b5
Author: Chris Harrelson <chrishtr@chromium.org>
Date: Mon May 14 22:10:30 2018

[ForeignObject PaintLayer] Fix <foreignObject> hit testing under simple SVG clip-path.

Now that <foreignObject> gets a PaintLayer, hit testing no longer works correctly
in the presence of a non-rectangular SVG clip path. This is because SVG children elements
which are not <foreignObject> cannot have a PaintLayer, and PaintLayer is the only way
hit testing currently knows how to account for clip-path.

Fix this for "simple" clip-paths by adding a method to perform hit test clipping
on the clip paint property tree. It works by checking all clips and clip-paths
stored on the clip paint property tree between the local and ancestor points
(in this use-case the ancestor is the containing PaintLayer), applying transforms
as necessary.

Non-"simple" clip paths (defined as SVG clip paths which have more than 42 edges
or having text) are not fixed by this CL. The former condition could be handled in the
future by adding a ClipPathForHitTesting to ClipPaintPropertyNode which stores the
clip-path beyond 42 edges.

Bug:833076

TBR=chrishtr@chromium.org

(cherry picked from commit e718b946295929125f8c3283f9c94338e1eb4224)

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Iabbce97d412fe38a4b775739517d28628ef67964
Reviewed-on: https://chromium-review.googlesource.com/1055788
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Tien-Ren Chen <trchen@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#558049}
Reviewed-on: https://chromium-review.googlesource.com/1058371
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/branch-heads/3396@{#598}
Cr-Branched-From: 9ef2aa869bc7bc0c089e255d698cca6e47d6b038-refs/heads/master@{#550428}
[modify] https://crrev.com/c7f11ffece231f155b53e0fd3334ac3f20eef6b5/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc
[modify] https://crrev.com/c7f11ffece231f155b53e0fd3334ac3f20eef6b5/third_party/blink/renderer/core/paint/paint_layer.cc
[modify] https://crrev.com/c7f11ffece231f155b53e0fd3334ac3f20eef6b5/third_party/blink/renderer/platform/graphics/paint/geometry_mapper.cc
[modify] https://crrev.com/c7f11ffece231f155b53e0fd3334ac3f20eef6b5/third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h
[modify] https://crrev.com/c7f11ffece231f155b53e0fd3334ac3f20eef6b5/third_party/blink/renderer/platform/graphics/paint/geometry_mapper_test.cc

Status: Fixed (was: Assigned)

Sign in to add a comment