Changeset 130592 in webkit
- Timestamp:
- Oct 6, 2012 6:35:26 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r130589 r130592 1 2012-10-06 Raul Hudea <rhudea@adobe.com> 2 3 -webkit-clip-path should parse IRIs 4 https://bugs.webkit.org/show_bug.cgi?id=96381 5 6 Reviewed by Andreas Kling. 7 8 Tests for SVG referenced clipPath with both types of clipPathUnits: "userSpaceOnUse" and "objectBoundingBox". 9 10 * css3/masking/clip-path-reference-expected.html: Added. 11 * css3/masking/clip-path-reference-userSpaceOnUse-expected.html: Added. 12 * css3/masking/clip-path-reference-userSpaceOnUse.html: Added. 13 * css3/masking/clip-path-reference.html: Added. 14 * fast/masking/parsing-clip-path-iri-expected.txt: Added. 15 * fast/masking/parsing-clip-path-iri.html: Added. 16 * platform/chromium/TestExpectations: 17 1 18 2012-10-06 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 19 -
trunk/LayoutTests/platform/chromium/TestExpectations
r130575 r130592 1445 1445 crbug.com/10342 [ Android Linux Mac ] fast/loader/file-URL-with-port-number.html [ WontFix ] 1446 1446 1447 # Clipping differences between Chromium platforms. Needs investigation. 1448 webkit.org/b/98599 css3/masking/clip-path-reference-userSpaceOnUse.html [ ImageOnlyFailure ] 1447 1449 1448 1450 # Started timing out with agl's complex text change. Page is verrry slow. -
trunk/Source/WebCore/ChangeLog
r130591 r130592 1 2012-10-06 Raul Hudea <rhudea@adobe.com> 2 3 -webkit-clip-path should parse IRIs 4 https://bugs.webkit.org/show_bug.cgi?id=96381 5 6 Reviewed by Andreas Kling. 7 8 Implemented the clipping via referencing a SVG clipPath. Currently it works only if the clipPath is defined 9 before using it on an HTML element. The forward reference issue is tracked via https://bugs.webkit.org/show_bug.cgi?id=90405. 10 11 Tests: css3/masking/clip-path-reference-userSpaceOnUse.html 12 css3/masking/clip-path-reference.html 13 fast/masking/parsing-clip-path-iri.html 14 15 * css/CSSComputedStyleDeclaration.cpp: 16 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Add handling for SVG clipPath references. 17 * css/CSSParser.cpp: 18 (WebCore::CSSParser::parseValue): Add handling for SVG clipPath references. 19 * css/StyleBuilder.cpp: 20 (WebCore::ApplyPropertyClipPath::applyValue): Add handling for SVG references. 21 * rendering/ClipPathOperation.h: 22 (ReferenceClipPathOperation): Added a new class corresponding to SVG referenced clipPath. 23 (WebCore::ReferenceClipPathOperation::create): 24 (WebCore::ReferenceClipPathOperation::url): 25 (WebCore::ReferenceClipPathOperation::fragment): 26 (WebCore::ReferenceClipPathOperation::operator==): 27 (WebCore::ReferenceClipPathOperation::ReferenceClipPathOperation): 28 (WebCore): 29 * rendering/RenderLayer.cpp: 30 (WebCore::RenderLayer::paintLayerContents): Add handling for ReferenceClipPathOperation. 31 * rendering/svg/RenderSVGResourceClipper.h: 32 (RenderSVGResourceClipper): Made applyClippingToContext public as it needs to be called directly for HTML elements. 33 1 34 2012-10-06 Pratik Solanki <psolanki@apple.com> 2 35 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r130277 r130592 2469 2469 if (operation->getOperationType() == ClipPathOperation::SHAPE) 2470 2470 return valueForBasicShape(static_cast<ShapeClipPathOperation*>(operation)->basicShape()); 2471 #if ENABLE(SVG) 2472 else if (operation->getOperationType() == ClipPathOperation::REFERENCE) { 2473 ReferenceClipPathOperation* referenceOperation = static_cast<ReferenceClipPathOperation*>(operation); 2474 return CSSPrimitiveValue::create(referenceOperation->url(), CSSPrimitiveValue::CSS_URI); 2475 } 2476 #endif 2471 2477 } 2472 2478 return cssValuePool().createIdentifierValue(CSSValueNone); -
trunk/Source/WebCore/css/CSSParser.cpp
r130511 r130592 2766 2766 else if (value->unit == CSSParserValue::Function) 2767 2767 return parseBasicShape(propId, important); 2768 #if ENABLE(SVG) 2769 else if (value->unit == CSSPrimitiveValue::CSS_URI) { 2770 parsedValue = CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_URI); 2771 addProperty(propId, parsedValue.release(), important); 2772 return true; 2773 } 2774 #endif 2768 2775 break; 2769 2776 #if ENABLE(CSS_EXCLUSIONS) -
trunk/Source/WebCore/css/StyleBuilder.cpp
r130142 r130592 1699 1699 setValue(styleResolver->style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver, primitiveValue->getShapeValue()))); 1700 1700 } 1701 #if ENABLE(SVG) 1702 else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_URI) { 1703 String cssURLValue = primitiveValue->getStringValue(); 1704 KURL url = styleResolver->document()->completeURL(cssURLValue); 1705 // FIXME: It doesn't work with forward or external SVG references (see https://bugs.webkit.org/show_bug.cgi?id=90405) 1706 setValue(styleResolver->style(), ReferenceClipPathOperation::create(cssURLValue, url.fragmentIdentifier())); 1707 } 1708 #endif 1701 1709 } 1702 1710 } -
trunk/Source/WebCore/rendering/ClipPathOperation.h
r128700 r130592 43 43 public: 44 44 enum OperationType { 45 // FIXME: Add referencing for IRI https://bugs.webkit.org/show_bug.cgi?id=9638145 REFERENCE, 46 46 SHAPE 47 47 }; … … 62 62 63 63 OperationType m_type; 64 }; 65 66 class ReferenceClipPathOperation : public ClipPathOperation { 67 public: 68 static PassRefPtr<ReferenceClipPathOperation> create(const String& url, const String& fragment) 69 { 70 return adoptRef(new ReferenceClipPathOperation(url, fragment)); 71 } 72 73 const String& url() const { return m_url; } 74 const String& fragment() const { return m_fragment; } 75 76 private: 77 virtual bool operator==(const ClipPathOperation& o) const 78 { 79 if (!isSameType(o)) 80 return false; 81 const ReferenceClipPathOperation* other = static_cast<const ReferenceClipPathOperation*>(&o); 82 return m_url == other->m_url; 83 } 84 85 ReferenceClipPathOperation(const String& url, const String& fragment) 86 : ClipPathOperation(REFERENCE) 87 , m_url(url) 88 , m_fragment(fragment) 89 { 90 } 91 92 String m_url; 93 String m_fragment; 64 94 }; 65 95 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r130355 r130592 81 81 #include "RenderMarquee.h" 82 82 #include "RenderReplica.h" 83 #include "RenderSVGResourceClipper.h" 83 84 #include "RenderScrollbar.h" 84 85 #include "RenderScrollbarPart.h" … … 3140 3141 context->clipPath(clipPath->path(calculateLayerBounds(this, rootLayer, 0)), clipPath->windRule()); 3141 3142 } 3143 #if ENABLE(SVG) 3144 else if (style->clipPath()->getOperationType() == ClipPathOperation::REFERENCE) { 3145 ReferenceClipPathOperation* referenceClipPathOperation = static_cast<ReferenceClipPathOperation*>(style->clipPath()); 3146 Document* document = renderer()->document(); 3147 // FIXME: It doesn't work with forward or external SVG references (https://bugs.webkit.org/show_bug.cgi?id=90405) 3148 Element* clipPath = document ? document->getElementById(referenceClipPathOperation->fragment()) : 0; 3149 if (clipPath && clipPath->renderer() && clipPath->renderer()->isSVGResourceContainer()) 3150 static_cast<RenderSVGResourceClipper*>(clipPath->renderer())->applyClippingToContext(renderer(), calculateLayerBounds(this, rootLayer, 0), paintDirtyRect, context); 3151 } 3152 #endif 3142 3153 } 3143 3154 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h
r105978 r130592 53 53 54 54 virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode); 55 // clipPath can be clipped too, but don't have a boundingBox or repaintRect. So we can't call 56 // applyResource directly and use the rects from the object, since they are empty for RenderSVGResources 57 // FIXME: We made applyClippingToContext public because we cannot call applyResource on HTML elements (it asserts on RenderObject::objectBoundingBox) 58 bool applyClippingToContext(RenderObject*, const FloatRect&, const FloatRect&, GraphicsContext*); 55 59 virtual FloatRect resourceBoundingBox(RenderObject*); 56 60 … … 63 67 static RenderSVGResourceType s_resourceType; 64 68 private: 65 // clipPath can be clipped too, but don't have a boundingBox or repaintRect. So we can't call66 // applyResource directly and use the rects from the object, since they are empty for RenderSVGResources67 bool applyClippingToContext(RenderObject*, const FloatRect&, const FloatRect&, GraphicsContext*);68 69 bool pathOnlyClipping(GraphicsContext*, const AffineTransform&, const FloatRect&); 69 70 bool drawContentIntoMaskImage(ClipperData*, const FloatRect& objectBoundingBox);
Note: See TracChangeset
for help on using the changeset viewer.