Changeset 206591 in webkit


Ignore:
Timestamp:
Sep 29, 2016 11:09:59 AM (8 years ago)
Author:
Simon Fraser
Message:

Fix hit testing on display:block <svg> elements
https://bugs.webkit.org/show_bug.cgi?id=162717
rdar://problem/23261130

Reviewed by Zalan Bujtas.
Source/WebCore:

RenderSVGRoot::nodeAtPoint() needs to test for both the HitTestBlockBackground and
HitTestChildBlockBackground phases, since we only get the HitTestChildBlockBackground
phase when the <svg> is a block. This is similar to code in RenderTable::nodeAtPoint(),
and matches Blink code.

This fixes the point dragging on http://anthonydugois.com/svg-path-builder/.

Test: svg/hittest/block-svg.html

  • rendering/svg/RenderSVGRoot.cpp:

(WebCore::RenderSVGRoot::nodeAtPoint):

LayoutTests:

Test hit testing on inline and block <svg> elements.

  • svg/hittest/block-svg-expected.txt: Added.
  • svg/hittest/block-svg.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r206590 r206591  
     12016-09-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix hit testing on display:block <svg> elements
     4        https://bugs.webkit.org/show_bug.cgi?id=162717
     5        rdar://problem/23261130
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        Test hit testing on inline and block <svg> elements.
     10
     11        * svg/hittest/block-svg-expected.txt: Added.
     12        * svg/hittest/block-svg.html: Added.
     13
    1142016-09-29  Saam Barati  <sbarati@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r206588 r206591  
     12016-09-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix hit testing on display:block <svg> elements
     4        https://bugs.webkit.org/show_bug.cgi?id=162717
     5        rdar://problem/23261130
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        RenderSVGRoot::nodeAtPoint() needs to test for both the HitTestBlockBackground and
     10        HitTestChildBlockBackground phases, since we only get the HitTestChildBlockBackground
     11        phase when the <svg> is a block. This is similar to code in RenderTable::nodeAtPoint(),
     12        and matches Blink code.
     13       
     14        This fixes the point dragging on http://anthonydugois.com/svg-path-builder/.
     15
     16        Test: svg/hittest/block-svg.html
     17
     18        * rendering/svg/RenderSVGRoot.cpp:
     19        (WebCore::RenderSVGRoot::nodeAtPoint):
     20
    1212016-09-29  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r204872 r206591  
    445445
    446446    // If we didn't early exit above, we've just hit the container <svg> element. Unlike SVG 1.1, 2nd Edition allows container elements to be hit.
    447     if (hitTestAction == HitTestBlockBackground && visibleToHitTesting()) {
     447    if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) && visibleToHitTesting()) {
    448448        // Only return true here, if the last hit testing phase 'BlockBackground' is executed. If we'd return true in the 'Foreground' phase,
    449449        // hit testing would stop immediately. For SVG only trees this doesn't matter. Though when we have a <foreignObject> subtree we need
Note: See TracChangeset for help on using the changeset viewer.