Changeset 195397 in webkit


Ignore:
Timestamp:
Jan 20, 2016 7:50:45 PM (8 years ago)
Author:
Alan Bujtas
Message:

http://victordarras.fr/cssgame/ doesn't work in Safari.
https://bugs.webkit.org/show_bug.cgi?id=153285
<rdar://problem/24212369>

Reviewed by Tim Horton.

This patch adds support for hittesting ClipPathOperation::Reference.

Source/WebCore:

Tests: svg/clip-path/hittest-clip-path-reference-miss.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::nodeAtPoint):

  • rendering/RenderObject.h:

(WebCore::RenderObject::isSVGResourceClipper):

  • rendering/svg/RenderSVGResourceClipper.h:

(isType):

LayoutTests:

  • svg/clip-path/hittest-clip-path-reference-miss-expected.html: Added.
  • svg/clip-path/hittest-clip-path-reference-miss.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195394 r195397  
     12016-01-20  Zalan Bujtas  <zalan@apple.com>
     2
     3        http://victordarras.fr/cssgame/ doesn't work in Safari.
     4        https://bugs.webkit.org/show_bug.cgi?id=153285
     5        <rdar://problem/24212369>
     6
     7        Reviewed by Tim Horton.
     8
     9        This patch adds support for hittesting ClipPathOperation::Reference.
     10
     11        * svg/clip-path/hittest-clip-path-reference-miss-expected.html: Added.
     12        * svg/clip-path/hittest-clip-path-reference-miss.html: Added.
     13
    1142016-01-20  Brady Eidson  <beidson@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r195393 r195397  
     12016-01-20  Zalan Bujtas  <zalan@apple.com>
     2
     3        http://victordarras.fr/cssgame/ doesn't work in Safari.
     4        https://bugs.webkit.org/show_bug.cgi?id=153285
     5        <rdar://problem/24212369>
     6
     7        Reviewed by Tim Horton.
     8
     9        This patch adds support for hittesting ClipPathOperation::Reference.
     10
     11        Tests: svg/clip-path/hittest-clip-path-reference-miss.html
     12
     13        * rendering/RenderBlock.cpp:
     14        (WebCore::RenderBlock::nodeAtPoint):
     15        * rendering/RenderObject.h:
     16        (WebCore::RenderObject::isSVGResourceClipper):
     17        * rendering/svg/RenderSVGResourceClipper.h:
     18        (isType):
     19
    1202016-01-20  David Kilzer  <ddkilzer@apple.com>
    221
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r194819 r195397  
    6060#include "RenderNamedFlowThread.h"
    6161#include "RenderRegion.h"
     62#include "RenderSVGResourceClipper.h"
    6263#include "RenderTableCell.h"
    6364#include "RenderTextFragment.h"
     
    24632464            break;
    24642465        }
    2465         // FIXME: handle Reference/Box
    2466         case ClipPathOperation::Reference:
     2466        case ClipPathOperation::Reference: {
     2467            const auto& referenceClipPathOperation = downcast<ReferenceClipPathOperation>(*style().clipPath());
     2468            auto* element = document().getElementById(referenceClipPathOperation.fragment());
     2469            if (!element || !element->renderer())
     2470                break;
     2471            if (!is<SVGClipPathElement>(*element))
     2472                break;
     2473            auto& clipper = downcast<RenderSVGResourceClipper>(*element->renderer());
     2474            if (!clipper.hitTestClipContent(FloatRect(borderBoxRect()), FloatPoint(locationInContainer.point() - localOffset)))
     2475                return false;
     2476            break;
     2477        }
    24672478        case ClipPathOperation::Box:
    24682479            break;
  • trunk/Source/WebCore/rendering/RenderObject.h

    r194638 r195397  
    420420    virtual bool isSVGResourceContainer() const { return false; }
    421421    virtual bool isSVGResourceFilter() const { return false; }
     422    virtual bool isSVGResourceClipper() const { return false; }
    422423    virtual bool isSVGResourceFilterPrimitive() const { return false; }
    423424
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h

    r189144 r195397  
    6464
    6565    virtual const char* renderName() const override { return "RenderSVGResourceClipper"; }
     66    bool isSVGResourceClipper() const override { return true; }
    6667
    6768    bool pathOnlyClipping(GraphicsContext&, const AffineTransform&, const FloatRect&);
     
    7677}
    7778
    78 SPECIALIZE_TYPE_TRAITS_RENDER_SVG_RESOURCE(RenderSVGResourceClipper, ClipperResourceType)
     79SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::RenderSVGResourceClipper)
     80static bool isType(const WebCore::RenderObject& renderer) { return renderer.isSVGResourceClipper(); }
     81static bool isType(const WebCore::RenderSVGResource& resource) { return resource.resourceType() == WebCore::ClipperResourceType; }
     82SPECIALIZE_TYPE_TRAITS_END()
    7983
    8084#endif
Note: See TracChangeset for help on using the changeset viewer.