Changeset 73820 in webkit
- Timestamp:
- Dec 10, 2010 5:23:26 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r73817 r73820 1 2010-12-10 Cosmin Truta <ctruta@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Crash while processing ill-formed <textPath> ouside of <text> 6 https://bugs.webkit.org/show_bug.cgi?id=47759 7 8 Ensure that ill-formed text content child elements do not crash. 9 10 * svg/custom/invalid-text-content.svg: Added. 11 * svg/custom/invalid-text-content-expected.checksum: Added. 12 * svg/custom/invalid-text-content-expected.png: Added. 13 * svg/custom/invalid-text-content-expected.txt: Added. 14 1 15 2010-12-10 Adam Barth <abarth@webkit.org> 2 16 -
trunk/WebCore/ChangeLog
r73819 r73820 1 2010-12-10 Cosmin Truta <ctruta@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Crash while processing ill-formed <textPath> ouside of <text> 6 https://bugs.webkit.org/show_bug.cgi?id=47759 7 8 Renderers within a <text> subtree are created only when their corresponding elements 9 satisfy the content model. 10 11 Test: svg/custom/invalid-text-content.svg 12 13 * svg/SVGTRefElement.cpp: 14 (WebCore::SVGTRefElement::childShouldCreateRenderer): Fixed to comply with the content model. 15 (WebCore::SVGTRefElement::rendererIsNeeded): Added. 16 * svg/SVGTRefElement.h: 17 * svg/SVGTSpanElement.cpp: 18 (WebCore::SVGTSpanElement::childShouldCreateRenderer): Fixed to comply with the content model. 19 (WebCore::SVGTSpanElement::rendererIsNeeded): Added. 20 * svg/SVGTSpanElement.h: Changed indentation. 21 * svg/SVGTextElement.cpp: 22 (WebCore::SVGTextElement::childShouldCreateRenderer): Reformatted. 23 * svg/SVGTextPathElement.cpp: 24 (WebCore::SVGTextPathElement::childShouldCreateRenderer): Fixed to comply with the content model. 25 (WebCore::SVGTextPathElement::rendererIsNeeded): Added. 26 * svg/SVGTextPathElement.h: 27 1 28 2010-12-10 Zhenyao Mo <zmo@google.com> 2 29 -
trunk/WebCore/svg/SVGTRefElement.cpp
r73130 r73820 85 85 } 86 86 87 bool SVGTRefElement::childShouldCreateRenderer(Node* child) const88 {89 if (child->isTextNode() || child->hasTagName(SVGNames::tspanTag) ||90 child->hasTagName(SVGNames::trefTag))91 return true;92 return false;93 }94 95 87 RenderObject* SVGTRefElement::createRenderer(RenderArena* arena, RenderStyle*) 96 88 { … … 98 90 } 99 91 92 bool SVGTRefElement::childShouldCreateRenderer(Node* child) const 93 { 94 if (child->isTextNode()) 95 return true; 96 97 return false; 98 } 99 100 bool SVGTRefElement::rendererIsNeeded(RenderStyle* style) 101 { 102 if (parentNode() 103 && (parentNode()->hasTagName(SVGNames::aTag) 104 #if ENABLE(SVG_FONTS) 105 || parentNode()->hasTagName(SVGNames::altGlyphTag) 106 #endif 107 || parentNode()->hasTagName(SVGNames::textTag) 108 || parentNode()->hasTagName(SVGNames::textPathTag) 109 || parentNode()->hasTagName(SVGNames::tspanTag))) 110 return StyledElement::rendererIsNeeded(style); 111 112 return false; 113 } 114 100 115 } 101 116 -
trunk/WebCore/svg/SVGTRefElement.h
r73130 r73820 42 42 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 43 43 virtual bool childShouldCreateRenderer(Node*) const; 44 virtual bool rendererIsNeeded(RenderStyle*); 44 45 45 46 void updateReferencedText(); -
trunk/WebCore/svg/SVGTSpanElement.cpp
r69922 r73820 40 40 } 41 41 42 RenderObject* SVGTSpanElement::createRenderer(RenderArena* arena, RenderStyle*) 43 { 44 return new (arena) RenderSVGTSpan(this); 45 } 46 42 47 bool SVGTSpanElement::childShouldCreateRenderer(Node* child) const 43 48 { 44 49 if (child->isTextNode() 50 || child->hasTagName(SVGNames::aTag) 45 51 #if ENABLE(SVG_FONTS) 46 52 || child->hasTagName(SVGNames::altGlyphTag) 47 53 #endif 48 || child->hasTagName(SVGNames::tspanTag)49 54 || child->hasTagName(SVGNames::trefTag) 50 || child->hasTagName(SVGNames::aTag) 51 || child->hasTagName(SVGNames::textPathTag)) 55 || child->hasTagName(SVGNames::tspanTag)) 52 56 return true; 53 57 … … 55 59 } 56 60 57 RenderObject* SVGTSpanElement::createRenderer(RenderArena* arena, RenderStyle*)61 bool SVGTSpanElement::rendererIsNeeded(RenderStyle* style) 58 62 { 59 return new (arena) RenderSVGTSpan(this); 63 if (parentNode() 64 && (parentNode()->hasTagName(SVGNames::aTag) 65 #if ENABLE(SVG_FONTS) 66 || parentNode()->hasTagName(SVGNames::altGlyphTag) 67 #endif 68 || parentNode()->hasTagName(SVGNames::textTag) 69 || parentNode()->hasTagName(SVGNames::textPathTag) 70 || parentNode()->hasTagName(SVGNames::tspanTag))) 71 return StyledElement::rendererIsNeeded(style); 72 73 return false; 60 74 } 61 75 -
trunk/WebCore/svg/SVGTSpanElement.h
r66362 r73820 27 27 namespace WebCore { 28 28 29 30 31 29 class SVGTSpanElement : public SVGTextPositioningElement { 30 public: 31 static PassRefPtr<SVGTSpanElement> create(const QualifiedName&, Document*); 32 32 33 private: 34 SVGTSpanElement(const QualifiedName&, Document*); 35 36 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 37 virtual bool childShouldCreateRenderer(Node*) const; 38 }; 33 private: 34 SVGTSpanElement(const QualifiedName&, Document*); 35 36 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 37 virtual bool childShouldCreateRenderer(Node*) const; 38 virtual bool rendererIsNeeded(RenderStyle*); 39 }; 39 40 40 41 } // namespace WebCore -
trunk/WebCore/svg/SVGTextElement.cpp
r73258 r73820 108 108 { 109 109 if (child->isTextNode() 110 || child->hasTagName(SVGNames::aTag) 110 111 #if ENABLE(SVG_FONTS) 111 112 || child->hasTagName(SVGNames::altGlyphTag) 112 113 #endif 113 || child->hasTagName(SVGNames::tspanTag) || child->hasTagName(SVGNames::trefTag) || child->hasTagName(SVGNames::aTag) || child->hasTagName(SVGNames::textPathTag)) 114 || child->hasTagName(SVGNames::textPathTag) 115 || child->hasTagName(SVGNames::trefTag) 116 || child->hasTagName(SVGNames::tspanTag)) 114 117 return true; 118 115 119 return false; 116 120 } -
trunk/WebCore/svg/SVGTextPathElement.cpp
r73258 r73820 119 119 { 120 120 if (child->isTextNode() 121 #if ENABLE(SVG_FONTS) 122 || child->hasTagName(SVGNames::altGlyphTag) 123 #endif 121 || child->hasTagName(SVGNames::aTag) 124 122 || child->hasTagName(SVGNames::trefTag) 125 || child->hasTagName(SVGNames::tspanTag) 126 || child->hasTagName(SVGNames::aTag) 127 || child->hasTagName(SVGNames::textPathTag)) 123 || child->hasTagName(SVGNames::tspanTag)) 128 124 return true; 125 126 return false; 127 } 128 129 bool SVGTextPathElement::rendererIsNeeded(RenderStyle* style) 130 { 131 if (parentNode() 132 && (parentNode()->hasTagName(SVGNames::aTag) 133 || parentNode()->hasTagName(SVGNames::textTag))) 134 return StyledElement::rendererIsNeeded(style); 129 135 130 136 return false; -
trunk/WebCore/svg/SVGTextPathElement.h
r73130 r73820 63 63 virtual void svgAttributeChanged(const QualifiedName&); 64 64 virtual void synchronizeProperty(const QualifiedName&); 65 65 66 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 66 67 67 virtual bool childShouldCreateRenderer(Node*) const; 68 virtual bool rendererIsNeeded(RenderStyle*); 68 69 69 70 virtual bool selfHasRelativeLengths() const;
Note: See TracChangeset
for help on using the changeset viewer.