Skip to content
  • krit@webkit.org's avatar
    -webkit-clip-path should parse IRIs · de10ea72
    krit@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=96381
    
    Patch by Raul Hudea <rhudea@adobe.com> on 2012-10-06
    Reviewed by Andreas Kling.
    
    Source/WebCore:
    
    Implemented the clipping via referencing a SVG clipPath. Currently it works only if the clipPath is defined
    before using it on an HTML element. The forward reference issue is tracked via https://bugs.webkit.org/show_bug.cgi?id=90405.
    
    Tests: css3/masking/clip-path-reference-userSpaceOnUse.html
           css3/masking/clip-path-reference.html
           fast/masking/parsing-clip-path-iri.html
    
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Add handling for SVG clipPath references.
    * css/CSSParser.cpp:
    (WebCore::CSSParser::parseValue): Add handling for SVG clipPath references.
    * css/StyleBuilder.cpp:
    (WebCore::ApplyPropertyClipPath::applyValue): Add handling for SVG references.
    * rendering/ClipPathOperation.h:
    (ReferenceClipPathOperation): Added a new class corresponding to SVG referenced clipPath.
    (WebCore::ReferenceClipPathOperation::create):
    (WebCore::ReferenceClipPathOperation::url):
    (WebCore::ReferenceClipPathOperation::fragment):
    (WebCore::ReferenceClipPathOperation::operator==):
    (WebCore::ReferenceClipPathOperation::ReferenceClipPathOperation):
    (WebCore):
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::paintLayerContents): Add handling for ReferenceClipPathOperation.
    * rendering/svg/RenderSVGResourceClipper.h:
    (RenderSVGResourceClipper): Made applyClippingToContext public as it needs to be called directly for HTML elements.
    
    LayoutTests:
    
    Tests for SVG referenced clipPath with both types of clipPathUnits: "userSpaceOnUse" and "objectBoundingBox".
    
    * css3/masking/clip-path-reference-expected.html: Added.
    * css3/masking/clip-path-reference-userSpaceOnUse-expected.html: Added.
    * css3/masking/clip-path-reference-userSpaceOnUse.html: Added.
    * css3/masking/clip-path-reference.html: Added.
    * fast/masking/parsing-clip-path-iri-expected.txt: Added.
    * fast/masking/parsing-clip-path-iri.html: Added.
    * platform/chromium/TestExpectations:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    de10ea72