Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Issue 810343003: Fix pointer-events:all when stroke="none" (Closed)

Created:
5 years, 11 months ago by dtrebbien
Modified:
5 years, 11 months ago
CC:
blink-reviews, blink-reviews-rendering, zoltan1, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, kouhei+svg_chromium.org, Dominik Röttsches, ed+blinkwatch_opera.com, krit, f(malita), gyuyoung.kim_webkit.org, jchaffraix+rendering, Stephen Chennney, rwlbuis, pdr+svgwatchlist_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix pointer-events:all when stroke="none" pointer-events:all should make event processing unaffected by the values of the 'stroke' and 'fill' properties. However, when the 'stroke' of a shape was set to "none", hit detection would fail for points that would be in the shape's stroke area if the 'stroke' were not "none". Originally, two CLs were committed implementing a fix for the issue, but they were reverted due to a 200%-225% regression of a performance test: PerformanceTests/SVG/SvgHitTesting.html The performance regression was due to the change in strokeContains() that skipped the check whether the stroke bounding box contained the point if !requiresStroke. The modified fix implemented by this commit has three parts: 1. m_innerStrokeRect/m_outerStrokeRect are deleted from RenderSVGRect. This is because shapeDependentStrokeContains(), which was the only user of these FloatRect objects, should ignore whether the shape actually has a stroke, but m_innerStrokeRect and m_outerStrokeRect were equal to the m_fillBoundingBox if the <rect> had no stroke. 2. The notion of the hit test stroke bounding box is introduced and a new RenderSVGShape member is added: m_hitTestStrokeBoundingBox. The hit test stroke bounding box of a shape is considered to be the bounding box of the stroke, regardless of whether the shape has a stroke. The stroke bounding box is usually m_hitTestStrokeBoundingBox if the shape has a stroke; otherwise, it's m_fillBoundingBox. In the case of RenderSVGPath, though, the stroke bounding box includes the markerRect. 3. RenderSVGShape::strokeContains() was changed so that if !requiresStroke, then we check whether the point is within the hit test stroke bounding box. If requiresStroke, then we check whether the point is within the stroke bounding box. BUG=350338, 445410 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=188888

Patch Set 1 #

Patch Set 2 : Remove braces from single-line if statement #

Total comments: 1

Patch Set 3 : Rename m_strokeBoundingBox to m_hitTestStrokeBoundingBox #

Total comments: 1

Patch Set 4 : Add back m_strokeBoundingBox #

Total comments: 3

Patch Set 5 : Addressing feedback #

Total comments: 1

Patch Set 6 : Remove line uniting m_hitTestStrokeBoundingBox with markerRect #

Unified diffs Side-by-side diffs Delta from patch set Stats (+550 lines, -55 lines) Patch
A LayoutTests/svg/hittest/pointer-events-all.html View 1 chunk +173 lines, -0 lines 0 comments Download
A LayoutTests/svg/hittest/pointer-events-all-expected.txt View 1 chunk +108 lines, -0 lines 0 comments Download
A LayoutTests/svg/hittest/rect-hittest.html View 1 chunk +146 lines, -0 lines 0 comments Download
A LayoutTests/svg/hittest/rect-hittest-expected.txt View 1 chunk +57 lines, -0 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGEllipse.cpp View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGPath.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGPath.cpp View 1 2 3 4 5 2 chunks +15 lines, -13 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGRect.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGRect.cpp View 1 2 3 4 chunks +20 lines, -16 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGShape.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGShape.cpp View 1 2 3 4 3 chunks +23 lines, -19 lines 0 comments Download

Messages

Total messages: 20 (2 generated)
dtrebbien
5 years, 11 months ago (2015-01-04 23:28:47 UTC) #2
fs
https://codereview.chromium.org/810343003/diff/20001/Source/core/rendering/svg/RenderSVGShape.h File Source/core/rendering/svg/RenderSVGShape.h (right): https://codereview.chromium.org/810343003/diff/20001/Source/core/rendering/svg/RenderSVGShape.h#newcode111 Source/core/rendering/svg/RenderSVGShape.h:111: virtual FloatRect strokeBoundingBox() const override final { return actualStrokeBoundingBox(); ...
5 years, 11 months ago (2015-01-05 10:08:14 UTC) #3
fs
On 2015/01/05 10:08:14, fs wrote: > https://codereview.chromium.org/810343003/diff/20001/Source/core/rendering/svg/RenderSVGShape.h > File Source/core/rendering/svg/RenderSVGShape.h (right): > > https://codereview.chromium.org/810343003/diff/20001/Source/core/rendering/svg/RenderSVGShape.h#newcode111 > ...
5 years, 11 months ago (2015-01-05 10:17:08 UTC) #4
dtrebbien
On 2015/01/05 10:17:08, fs wrote: > On 2015/01/05 10:08:14, fs wrote: > > > https://codereview.chromium.org/810343003/diff/20001/Source/core/rendering/svg/RenderSVGShape.h ...
5 years, 11 months ago (2015-01-05 17:10:14 UTC) #5
fs
On 2015/01/05 17:10:14, dtrebbien wrote: > On 2015/01/05 10:17:08, fs wrote: > > On 2015/01/05 ...
5 years, 11 months ago (2015-01-05 17:50:30 UTC) #6
dtrebbien
On 2015/01/05 17:50:30, fs wrote: > Yes, what I was trying to express was that ...
5 years, 11 months ago (2015-01-06 12:52:59 UTC) #7
fs
On 2015/01/06 12:52:59, dtrebbien wrote: > On 2015/01/05 17:50:30, fs wrote: > > Yes, what ...
5 years, 11 months ago (2015-01-07 12:56:22 UTC) #8
dtrebbien
On 2015/01/07 12:56:22, fs wrote: > On 2015/01/06 12:52:59, dtrebbien wrote: > > On 2015/01/05 ...
5 years, 11 months ago (2015-01-10 18:06:04 UTC) #9
fs
On 2015/01/10 18:06:04, dtrebbien wrote: ... > A new version of the patch has been ...
5 years, 11 months ago (2015-01-12 13:00:04 UTC) #10
dtrebbien
On 2015/01/12 13:00:04, fs wrote: > On 2015/01/10 18:06:04, dtrebbien wrote: > ... > > ...
5 years, 11 months ago (2015-01-22 00:57:07 UTC) #11
fs
I think it should be possible to do this without the additional rect (by using ...
5 years, 11 months ago (2015-01-22 12:15:59 UTC) #12
dtrebbien
On 2015/01/22 12:15:59, fs wrote: > I think it should be possible to do this ...
5 years, 11 months ago (2015-01-22 23:04:47 UTC) #13
fs
LGTM with the issue in RenderSVGPath (below) addressed. On 2015/01/22 23:04:47, dtrebbien wrote: > On ...
5 years, 11 months ago (2015-01-23 11:26:48 UTC) #14
dtrebbien
On 2015/01/23 11:26:48, fs wrote: > LGTM with the issue in RenderSVGPath (below) addressed. > ...
5 years, 11 months ago (2015-01-23 12:26:21 UTC) #15
fs
On 2015/01/23 12:26:21, dtrebbien wrote: > On 2015/01/23 11:26:48, fs wrote: > > LGTM with ...
5 years, 11 months ago (2015-01-23 12:41:35 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/810343003/100001
5 years, 11 months ago (2015-01-23 13:01:05 UTC) #18
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://src.chromium.org/viewvc/blink?view=rev&revision=188888
5 years, 11 months ago (2015-01-23 14:41:09 UTC) #19
dtrebbien
5 years, 11 months ago (2015-01-27 15:50:08 UTC) #20
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.chromium.org/882443006/ by dtrebbien@gmail.com.

The reason for reverting is: Issue 452284:	10.1%-69.4% regression in
blink_perf.svg at 312837:312949.

Powered by Google App Engine
This is Rietveld 408576698