New issue
Advanced search Search tips

Issue 820482 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

[SPv175] Hit testing of foreignObject broken under browser zoom

Project Member Reported by chrishtr@chromium.org, Mar 9 2018

Issue description

Load the attached testcase. Zoom the browser to 150%. Click on the
bottom-right of the colored area.

Expected: see "hittest" appear in the console.
Actual: doesn't.

The area that causes "hittest" is the same areas of the div as if it
was not zoomed. Non-SPv175 "works" but only because the div under
foreignObject is not zoomed at all ( issue 771852 ).
 
Labels: -Pri-3 Pri-2
Actual reduced testcase now attached.

test.html
295 bytes View Download
After https://chromium.googlesource.com/chromium/src/+/2a94373409feaf9794c2489ba9563fe67a8eabbd landed we now paint the foreignObject content with the correct transform. Hit testing is still broken.
It works fine with transform of a div above the content, but not zoom.
I think we need to expand the rect computed in HitTestAllPhases to account
for zoom. SVG does this internally.
Blocking: -771643
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 14 2018

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

commit b19cea8da334391dc1a51e2d386b10b25e354a69
Author: Chris Harrelson <chrishtr@chromium.org>
Date: Sat Apr 14 00:19:40 2018

[SPv175] Fix hittesting of <foreignObject> under non-identity SVG-related transform

If the SVG to border box transform or any other transform in SVG above <foreignObject>
is non-identity, then hit testing of the <foreignObject> and content below it is incorrect,
because it does not take into account such transforms.

Before SPv175 + <foreignObject> as stacking context, content underneath the
<foreignObject> did not paint with the correct sizing either, which hid this bug to
some extent.

To make this work requires a little bit of special-casing of foreignObject, because of
the quirk that its location offset is applied *after* transform, not before.

Bug:  820482 , 831591 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ided2b46f2ea12dd61c254892f5fbabb821f6229e
Reviewed-on: https://chromium-review.googlesource.com/974568
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550825}
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/transform-foreign-object-expected.txt
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/WebKit/LayoutTests/paint/invalidation/svg/transform-foreign-object-expected.txt
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/layout_object.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/layout_object.h
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_container.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.h
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_resource_clipper.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_root.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/svg_layout_support.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/svg_layout_support.h
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/paint/paint_layer.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/paint/paint_layer.h
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/paint/svg_foreign_object_painter.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 15 2018

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

commit 4e1b455c022b92eb15193fd74a353a91c9a12f55
Author: Chris Harrelson <chrishtr@chromium.org>
Date: Sun Apr 15 16:11:50 2018

[SPv175] Fix hittesting of <foreignObject> under non-identity SVG-related transform

If the SVG to border box transform or any other transform in SVG above <foreignObject>
is non-identity, then hit testing of the <foreignObject> and content below it is incorrect,
because it does not take into account such transforms.

Before SPv175 + <foreignObject> as stacking context, content underneath the
<foreignObject> did not paint with the correct sizing either, which hid this bug to
some extent.

To make this work requires a little bit of special-casing of foreignObject, because of
the quirk that its location offset is applied *after* transform, not before.

TBR=chrishtr@chromium.org

(cherry picked from commit b19cea8da334391dc1a51e2d386b10b25e354a69)

Bug:  820482 , 831591 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ided2b46f2ea12dd61c254892f5fbabb821f6229e
Reviewed-on: https://chromium-review.googlesource.com/974568
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#550825}
Reviewed-on: https://chromium-review.googlesource.com/1012537
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/branch-heads/3396@{#11}
Cr-Branched-From: 9ef2aa869bc7bc0c089e255d698cca6e47d6b038-refs/heads/master@{#550428}
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/transform-foreign-object-expected.txt
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/WebKit/LayoutTests/paint/invalidation/svg/transform-foreign-object-expected.txt
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/layout_object.cc
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/layout_object.h
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/svg/layout_svg_container.cc
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.cc
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.h
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/svg/layout_svg_resource_clipper.cc
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/svg/layout_svg_root.cc
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/svg/svg_layout_support.cc
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/layout/svg/svg_layout_support.h
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/paint/paint_layer.cc
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/paint/paint_layer.h
[modify] https://crrev.com/4e1b455c022b92eb15193fd74a353a91c9a12f55/third_party/blink/renderer/core/paint/svg_foreign_object_painter.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b19cea8da334391dc1a51e2d386b10b25e354a69

commit b19cea8da334391dc1a51e2d386b10b25e354a69
Author: Chris Harrelson <chrishtr@chromium.org>
Date: Sat Apr 14 00:19:40 2018

[SPv175] Fix hittesting of <foreignObject> under non-identity SVG-related transform

If the SVG to border box transform or any other transform in SVG above <foreignObject>
is non-identity, then hit testing of the <foreignObject> and content below it is incorrect,
because it does not take into account such transforms.

Before SPv175 + <foreignObject> as stacking context, content underneath the
<foreignObject> did not paint with the correct sizing either, which hid this bug to
some extent.

To make this work requires a little bit of special-casing of foreignObject, because of
the quirk that its location offset is applied *after* transform, not before.

Bug:  820482 , 831591 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ided2b46f2ea12dd61c254892f5fbabb821f6229e
Reviewed-on: https://chromium-review.googlesource.com/974568
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550825}
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/transform-foreign-object-expected.txt
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/WebKit/LayoutTests/paint/invalidation/svg/transform-foreign-object-expected.txt
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/layout_object.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/layout_object.h
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_container.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.h
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_resource_clipper.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/layout_svg_root.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/svg_layout_support.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/layout/svg/svg_layout_support.h
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/paint/paint_layer.cc
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/paint/paint_layer.h
[modify] https://crrev.com/b19cea8da334391dc1a51e2d386b10b25e354a69/third_party/blink/renderer/core/paint/svg_foreign_object_painter.cc

Status: Fixed (was: Assigned)

Sign in to add a comment