Changeset 76236 in webkit
- Timestamp:
- Jan 20, 2011 6:11:33 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76235 r76236 1 2011-01-20 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Andreas Kling. 4 5 SVG Pattern doesn't take the viewBox of a referenced Pattern 6 https://bugs.webkit.org/show_bug.cgi?id=52804 7 8 Added a test case of the W3C SVG test suite to check, if we take 9 the viewBox of a referenced SVGPattern. 10 11 * svg/W3C-SVG-1.1-SE/pservers-pattern-04-f.svg: Added. 12 * platform/mac/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.checksum 13 * platform/mac/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.png 14 * platform/mac/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.txt 15 1 16 2011-01-19 Stephen White <senorblanco@chromium.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r76235 r76236 1 2011-01-20 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Andreas Kling. 4 5 SVG Pattern doesn't take the viewBox of a referenced Pattern 6 https://bugs.webkit.org/show_bug.cgi?id=52804 7 8 SVGPattern element didn't use the viewBox of another SVGPattern element, referenced 9 by xlink:href. Modified PatternAttributes, to take the value of the viewBox of the 10 SVGPattern element as well, if the attribute was set. 11 This gets checked by a W3C SVG test case. 12 13 Test: svg/W3C-SVG-1.1-SE/pservers-pattern-04-f.svg 14 15 * rendering/svg/RenderSVGResourcePattern.cpp: 16 (WebCore::RenderSVGResourcePattern::buildTileImageTransform): 17 * svg/PatternAttributes.h: 18 (WebCore::PatternAttributes::PatternAttributes): 19 (WebCore::PatternAttributes::viewBox): 20 (WebCore::PatternAttributes::setViewBox): 21 (WebCore::PatternAttributes::hasViewBox): 22 * svg/SVGPatternElement.cpp: 23 (WebCore::SVGPatternElement::collectPatternAttributes): 24 1 25 2011-01-19 Stephen White <senorblanco@chromium.org> 2 26 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
r76146 r76236 229 229 return false; 230 230 231 AffineTransform viewBoxCTM = patternElement->viewBoxToViewTransform( patternElement->viewBox(), patternElement->preserveAspectRatio(), patternBoundaries.width(), patternBoundaries.height());231 AffineTransform viewBoxCTM = patternElement->viewBoxToViewTransform(attributes.viewBox(), patternElement->preserveAspectRatio(), patternBoundaries.width(), patternBoundaries.height()); 232 232 233 233 // Apply viewBox/objectBoundingBox transformations. -
trunk/Source/WebCore/svg/PatternAttributes.h
r64579 r76236 28 28 class SVGPatternElement; 29 29 30 // FIXME: We need to add PreserveAspectRatio as well. 31 // see https://bugs.webkit.org/show_bug.cgi?id=52802 30 32 struct PatternAttributes { 31 33 PatternAttributes() … … 34 36 , m_width() 35 37 , m_height() 38 , m_viewBox() 36 39 , m_boundingBoxMode(true) 37 40 , m_boundingBoxModeContent(false) … … 45 48 , m_patternTransformSet(false) 46 49 , m_patternContentElementSet(false) 50 , m_viewBoxSet(false) 47 51 { 48 52 } … … 52 56 SVGLength width() const { return m_width; } 53 57 SVGLength height() const { return m_height; } 58 FloatRect viewBox() const { return m_viewBox; } 54 59 bool boundingBoxMode() const { return m_boundingBoxMode; } 55 60 bool boundingBoxModeContent() const { return m_boundingBoxModeContent; } … … 79 84 m_height = value; 80 85 m_heightSet = true; 86 } 87 88 void setViewBox(const FloatRect& value) 89 { 90 m_viewBox = value; 91 m_viewBoxSet = true; 81 92 } 82 93 … … 109 120 bool hasWidth() const { return m_widthSet; } 110 121 bool hasHeight() const { return m_heightSet; } 122 bool hasViewBox() const { return m_viewBoxSet; } 111 123 bool hasBoundingBoxMode() const { return m_boundingBoxModeSet; } 112 124 bool hasBoundingBoxModeContent() const { return m_boundingBoxModeContentSet; } … … 120 132 SVGLength m_width; 121 133 SVGLength m_height; 134 FloatRect m_viewBox; 122 135 bool m_boundingBoxMode; 123 136 bool m_boundingBoxModeContent; … … 134 147 bool m_patternTransformSet : 1; 135 148 bool m_patternContentElementSet : 1; 149 bool m_viewBoxSet : 1; 136 150 }; 137 151 -
trunk/Source/WebCore/svg/SVGPatternElement.cpp
r73254 r76236 229 229 attributes.setHeight(current->height()); 230 230 231 if (!attributes.hasViewBox() && current->hasAttribute(SVGNames::viewBoxAttr)) 232 attributes.setViewBox(current->viewBox()); 233 231 234 if (!attributes.hasBoundingBoxMode() && current->hasAttribute(SVGNames::patternUnitsAttr)) 232 235 attributes.setBoundingBoxMode(current->patternUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
Note: See TracChangeset
for help on using the changeset viewer.