Changeset 52960 in webkit
- Timestamp:
- Jan 7, 2010 4:36:10 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r52956 r52960 1 2010-01-07 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 SVGTextElement & friends need to implement svgAttributeChanged 6 https://bugs.webkit.org/show_bug.cgi?id=33284 7 8 * svg/dynamic-updates/SVGTRefElement-dom-href-attr-expected.txt: Added. 9 * svg/dynamic-updates/SVGTRefElement-dom-href-attr.html: Added. 10 * svg/dynamic-updates/SVGTextElement-dom-transform-attr-expected.txt: Added. 11 * svg/dynamic-updates/SVGTextElement-dom-transform-attr.html: Added. 12 * svg/dynamic-updates/SVGTextElement-svgdom-transform-prop-expected.txt: Added. 13 * svg/dynamic-updates/SVGTextElement-svgdom-transform-prop.html: Added. 14 * svg/dynamic-updates/script-tests/SVGTRefElement-dom-href-attr.js: Added. 15 (executeTest): 16 * svg/dynamic-updates/script-tests/SVGTextElement-dom-transform-attr.js: Added. 17 (executeTest): 18 * svg/dynamic-updates/script-tests/SVGTextElement-svgdom-transform-prop.js: Added. 19 (executeTest): 20 1 21 2010-01-07 Alexey Proskuryakov <ap@apple.com> 2 22 -
trunk/WebCore/ChangeLog
r52958 r52960 1 2010-01-07 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 SVGTextElement & friends need to implement svgAttributeChanged 6 https://bugs.webkit.org/show_bug.cgi?id=33284 7 8 Implement svgAttributeChanged() for SVGTextElement & SVGTRefElement. As <text> element contain children, 9 childrenChanged() has to be implemented as well for SVGTextElement. 10 11 Simplify SVGTransformable::parseTransformAttribute() code, clearing lists in the beginning 12 and on error case, after parsing - previously the calling site had to take care of that. 13 14 Tests: svg/dynamic-updates/SVGTRefElement-dom-href-attr.html 15 svg/dynamic-updates/SVGTextElement-dom-transform-attr.html 16 svg/dynamic-updates/SVGTextElement-svgdom-transform-prop.html 17 18 * svg/SVGGradientElement.cpp: 19 (WebCore::SVGGradientElement::parseMappedAttribute): 20 * svg/SVGPatternElement.cpp: 21 (WebCore::SVGPatternElement::parseMappedAttribute): 22 * svg/SVGStyledTransformableElement.cpp: 23 (WebCore::SVGStyledTransformableElement::parseMappedAttribute): 24 * svg/SVGTRefElement.cpp: 25 (WebCore::SVGTRefElement::svgAttributeChanged): 26 * svg/SVGTRefElement.h: 27 * svg/SVGTextElement.cpp: 28 (WebCore::SVGTextElement::parseMappedAttribute): 29 (WebCore::SVGTextElement::svgAttributeChanged): 30 (WebCore::SVGTextElement::childrenChanged): 31 * svg/SVGTextElement.h: 32 * svg/SVGTextPositioningElement.cpp: 33 (WebCore::SVGTextPositioningElement::svgAttributeChanged): 34 * svg/SVGTextPositioningElement.h: 35 * svg/SVGTransformable.cpp: 36 (WebCore::SVGTransformable::parseTransformAttribute): 37 * svg/SVGTransformable.h: 38 1 39 2010-01-07 Brian Weinstein <bweinstein@apple.com> 2 40 -
trunk/WebCore/svg/SVGStyledTransformableElement.cpp
r50583 r52960 71 71 void SVGStyledTransformableElement::parseMappedAttribute(MappedAttribute* attr) 72 72 { 73 if ( attr->name() == SVGNames::transformAttr) {73 if (SVGTransformable::isKnownAttribute(attr->name())) { 74 74 SVGTransformList* localTransforms = transformBaseValue(); 75 76 ExceptionCode ec = 0; 77 localTransforms->clear(ec); 78 79 if (!SVGTransformable::parseTransformAttribute(localTransforms, attr->value())) 75 if (!SVGTransformable::parseTransformAttribute(localTransforms, attr->value())) { 76 ExceptionCode ec = 0; 80 77 localTransforms->clear(ec); 81 else 82 setTransformBaseValue(localTransforms); 83 } else 78 } 79 } else 84 80 SVGStyledLocatableElement::parseMappedAttribute(attr); 85 81 } -
trunk/WebCore/svg/SVGTRefElement.cpp
r50583 r52960 62 62 } 63 63 64 void SVGTRefElement::svgAttributeChanged(const QualifiedName& attrName) 65 { 66 SVGTextPositioningElement::svgAttributeChanged(attrName); 67 68 if (!renderer()) 69 return; 70 71 if (SVGURIReference::isKnownAttribute(attrName)) 72 renderer()->setNeedsLayout(true); 73 } 74 64 75 bool SVGTRefElement::childShouldCreateRenderer(Node* child) const 65 76 { -
trunk/WebCore/svg/SVGTRefElement.h
r49602 r52960 35 35 36 36 virtual void parseMappedAttribute(MappedAttribute*); 37 virtual void svgAttributeChanged(const QualifiedName&); 37 38 38 39 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/WebCore/svg/SVGTextElement.cpp
r50583 r52960 48 48 void SVGTextElement::parseMappedAttribute(MappedAttribute* attr) 49 49 { 50 if ( attr->name() == SVGNames::transformAttr) {50 if (SVGTransformable::isKnownAttribute(attr->name())) { 51 51 SVGTransformList* localTransforms = transformBaseValue(); 52 53 ExceptionCode ec = 0; 54 localTransforms->clear(ec); 55 56 if (!SVGTransformable::parseTransformAttribute(localTransforms, attr->value())) 52 if (!SVGTransformable::parseTransformAttribute(localTransforms, attr->value())) { 53 ExceptionCode ec = 0; 57 54 localTransforms->clear(ec); 58 else {59 setTransformBaseValue(localTransforms);60 if (renderer())61 renderer()->setNeedsLayout(true); // should be in setTransformBaseValue62 55 } 63 56 } else … … 125 118 return; 126 119 127 if (SVGT extPositioningElement::isKnownAttribute(attrName))120 if (SVGTransformable::isKnownAttribute(attrName)) 128 121 renderer()->setNeedsLayout(true); 122 } 123 124 void SVGTextElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) 125 { 126 SVGTextPositioningElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); 127 128 if (!renderer()) 129 return; 130 131 renderer()->setNeedsLayout(true); 129 132 } 130 133 -
trunk/WebCore/svg/SVGTextElement.h
r50583 r52960 49 49 50 50 virtual void svgAttributeChanged(const QualifiedName&); 51 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); 51 52 52 53 private: -
trunk/WebCore/svg/SVGTextPositioningElement.cpp
r50583 r52960 25 25 26 26 #include "MappedAttribute.h" 27 #include "RenderObject.h" 27 28 #include "SVGLengthList.h" 28 29 #include "SVGNames.h" … … 63 64 } 64 65 66 void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrName) 67 { 68 SVGTextContentElement::svgAttributeChanged(attrName); 69 70 if (!renderer()) 71 return; 72 73 if (isKnownAttribute(attrName)) 74 renderer()->setNeedsLayout(true); 75 } 76 65 77 bool SVGTextPositioningElement::isKnownAttribute(const QualifiedName& attrName) 66 78 { -
trunk/WebCore/svg/SVGTextPositioningElement.h
r50583 r52960 37 37 38 38 virtual void parseMappedAttribute(MappedAttribute*); 39 virtual void svgAttributeChanged(const QualifiedName&); 39 40 40 41 bool isKnownAttribute(const QualifiedName&); -
trunk/WebCore/svg/SVGTransformable.cpp
r45747 r52960 191 191 { 192 192 const UChar* start = transform.characters(); 193 const UChar* end = start + transform.length(); 194 return parseTransformAttribute(list, start, end); 195 } 196 197 bool SVGTransformable::parseTransformAttribute(SVGTransformList* list, const UChar*& currTransform, const UChar* end) 198 { 193 return parseTransformAttribute(list, start, start + transform.length()); 194 } 195 196 bool SVGTransformable::parseTransformAttribute(SVGTransformList* list, const UChar*& currTransform, const UChar* end, TransformParsingMode mode) 197 { 198 ExceptionCode ec = 0; 199 if (mode == ClearList) { 200 list->clear(ec); 201 ASSERT(!ec); 202 } 203 199 204 bool delimParsed = false; 200 205 while (currTransform < end) { … … 202 207 unsigned short type = SVGTransform::SVG_TRANSFORM_UNKNOWN; 203 208 skipOptionalSpaces(currTransform, end); 204 209 205 210 if (!parseAndSkipType(currTransform, end, type)) 206 211 return false; … … 210 215 return false; 211 216 212 ExceptionCode ec = 0;213 217 list->appendItem(t, ec); 214 218 skipOptionalSpaces(currTransform, end); 215 219 if (currTransform < end && *currTransform == ',') { 216 220 delimParsed = true; 217 currTransform++;221 ++currTransform; 218 222 } 219 223 skipOptionalSpaces(currTransform, end); -
trunk/WebCore/svg/SVGTransformable.h
r50583 r52960 39 39 virtual ~SVGTransformable(); 40 40 41 enum TransformParsingMode { 42 ClearList, 43 DoNotClearList 44 }; 45 41 46 static bool parseTransformAttribute(SVGTransformList*, const AtomicString& transform); 42 static bool parseTransformAttribute(SVGTransformList*, const UChar*& ptr, const UChar* end );47 static bool parseTransformAttribute(SVGTransformList*, const UChar*& ptr, const UChar* end, TransformParsingMode mode = ClearList); 43 48 static bool parseTransformValue(unsigned type, const UChar*& ptr, const UChar* end, SVGTransform&); 44 49 -
trunk/WebCore/svg/SVGViewSpec.cpp
r52373 r52960 153 153 return false; 154 154 currViewSpec++; 155 SVGTransformable::parseTransformAttribute(m_transform.get(), currViewSpec, end );155 SVGTransformable::parseTransformAttribute(m_transform.get(), currViewSpec, end, SVGTransformable::DoNotClearList); 156 156 if (currViewSpec >= end || *currViewSpec != ')') 157 157 return false;
Note: See TracChangeset
for help on using the changeset viewer.