Clip-path clipping <foreignObject> broken with non rectangular and/or complex paths |
||||||||
Issue descriptionNon-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/
,
Apr 17 2018
,
Apr 18 2018
,
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.
,
May 2 2018
*** 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.
,
May 7 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.
,
May 10 2018
chrishtr@ please take a look and update the status of this stable blocker as soon as possible
,
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.
,
May 10 2018
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.
,
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
,
May 14 2018
How is the change listed at #10 looking in canary?
,
May 14 2018
Looks correct in Canary. Ready to merge.
,
May 14 2018
,
May 14 2018
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
,
May 14 2018
Approving merge to M67 branch 3396 based on comment #12. Please merge. Thank you.
,
May 14 2018
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
,
May 14 2018
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by sheriffbot@chromium.org
, Apr 17 2018