DescriptionFix 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".
On December 27 & 28, 2014, 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.
On January 23, 2015, another CL attempt was made, but this was reverted
for different performance regressions. The regressions were due to the
change that the stroke bounding box would always be computed for <path>s.
The modified fix implemented by this commit has four parts:
1. m_innerStrokeRect/m_outerStrokeRect are deleted from LayoutSVGRect.
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. 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.
3. LayoutSVGShape::hitTestStrokeBoundingBox() is added to estimate the
hit test stroke bounding box.
4. LayoutSVGShape::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, 452284, 435097
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193216
Patch Set 1 #
Total comments: 3
Patch Set 2 : Addressing feedback #Patch Set 3 : Rebase #Messages
Total messages: 15 (4 generated)
|