Changeset 155682 in webkit
- Timestamp:
- Sep 13, 2013 2:48:22 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r155631 r155682 2277 2277 rendering/svg/RenderSVGRoot.cpp 2278 2278 rendering/svg/RenderSVGShape.cpp 2279 rendering/svg/RenderSVGTSpan.cpp2280 2279 rendering/svg/RenderSVGText.cpp 2281 2280 rendering/svg/RenderSVGTextPath.cpp -
trunk/Source/WebCore/ChangeLog
r155681 r155682 1 2013-09-13 Andreas Kling <akling@apple.com> 2 3 [CTTE] Tighter element types for RenderSVGInline and subclasses. 4 <https://webkit.org/b/121283> 5 6 Reviewed by Antti Koivisto. 7 8 Codify the following: 9 10 - RenderSVGInline always has an SVGGraphicsElement. 11 - RenderSVGTextPath always has an SVGTextPathElement. 12 - RenderSVGTSpan always has an SVGTextPositioningElement. 13 14 None of these renderers are ever anonymous, so delete element() and provide 15 strongly typed reference getters instead. 16 1 17 2013-09-13 Andreas Kling <akling@apple.com> 2 18 -
trunk/Source/WebCore/GNUmakefile.list.am
r155631 r155682 4879 4879 Source/WebCore/rendering/svg/RenderSVGShape.cpp \ 4880 4880 Source/WebCore/rendering/svg/RenderSVGShape.h \ 4881 Source/WebCore/rendering/svg/RenderSVGTSpan.cpp \4882 4881 Source/WebCore/rendering/svg/RenderSVGTSpan.h \ 4883 4882 Source/WebCore/rendering/svg/RenderSVGText.cpp \ -
trunk/Source/WebCore/Target.pri
r155631 r155682 3701 3701 rendering/svg/RenderSVGResourceSolidColor.cpp \ 3702 3702 rendering/svg/RenderSVGRoot.cpp \ 3703 rendering/svg/RenderSVGTSpan.cpp \3704 3703 rendering/svg/RenderSVGText.cpp \ 3705 3704 rendering/svg/RenderSVGTextPath.cpp \ -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r155633 r155682 11621 11621 </ClCompile> 11622 11622 <ClCompile Include="..\rendering\svg\RenderSVGTextPath.cpp"> 11623 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>11624 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>11625 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>11626 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>11627 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>11628 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>11629 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>11630 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>11631 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>11632 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>11633 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>11634 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>11635 </ClCompile>11636 <ClCompile Include="..\rendering\svg\RenderSVGTSpan.cpp">11637 11623 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 11638 11624 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r155633 r155682 2983 2983 <Filter>rendering\svg</Filter> 2984 2984 </ClCompile> 2985 <ClCompile Include="..\rendering\svg\RenderSVGTSpan.cpp">2986 <Filter>rendering\svg</Filter>2987 </ClCompile>2988 2985 <ClCompile Include="..\rendering\svg\SVGInlineFlowBox.cpp"> 2989 2986 <Filter>rendering\svg</Filter> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r155631 r155682 6654 6654 0854B0081255E4E600B9CDD0 /* RenderSVGTextPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTextPath.cpp; sourceTree = "<group>"; }; 6655 6655 0854B0091255E4E600B9CDD0 /* RenderSVGTextPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGTextPath.h; sourceTree = "<group>"; }; 6656 0854B00A1255E4E600B9CDD0 /* RenderSVGTSpan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTSpan.cpp; sourceTree = "<group>"; };6657 6656 0854B00B1255E4E600B9CDD0 /* RenderSVGTSpan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGTSpan.h; sourceTree = "<group>"; }; 6658 6657 0854B00C1255E4E600B9CDD0 /* SVGInlineFlowBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGInlineFlowBox.cpp; sourceTree = "<group>"; }; … … 13570 13569 436708A912D9CA4B00044234 /* RenderSVGTransformableContainer.cpp */, 13571 13570 436708AA12D9CA4B00044234 /* RenderSVGTransformableContainer.h */, 13572 0854B00A1255E4E600B9CDD0 /* RenderSVGTSpan.cpp */,13573 13571 0854B00B1255E4E600B9CDD0 /* RenderSVGTSpan.h */, 13574 13572 436708AB12D9CA4B00044234 /* RenderSVGViewportContainer.cpp */, -
trunk/Source/WebCore/rendering/svg/RenderSVGAllInOne.cpp
r141775 r155682 52 52 #include "RenderSVGRoot.cpp" 53 53 #include "RenderSVGShape.cpp" 54 #include "RenderSVGTSpan.cpp"55 54 #include "RenderSVGText.cpp" 56 55 #include "RenderSVGTextPath.cpp" -
trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp
r154931 r155682 33 33 namespace WebCore { 34 34 35 RenderSVGInline::RenderSVGInline( Element*element)36 : RenderInline( element)35 RenderSVGInline::RenderSVGInline(SVGGraphicsElement& element) 36 : RenderInline(&element) 37 37 { 38 38 setAlwaysCreateLineBoxes(); -
trunk/Source/WebCore/rendering/svg/RenderSVGInline.h
r153380 r155682 24 24 #if ENABLE(SVG) 25 25 #include "RenderInline.h" 26 27 #include "SVGRenderSupport.h" 26 #include "SVGGraphicsElement.h" 28 27 29 28 namespace WebCore { … … 31 30 class RenderSVGInline : public RenderInline { 32 31 public: 33 explicit RenderSVGInline(Element*); 32 explicit RenderSVGInline(SVGGraphicsElement&); 33 34 SVGGraphicsElement& graphicsElement() const { return *toSVGGraphicsElement(RenderInline::element()); } 35 36 private: 37 void element() const WTF_DELETED_FUNCTION; 34 38 35 39 virtual const char* renderName() const OVERRIDE { return "RenderSVGInline"; } … … 52 56 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRIDE FINAL; 53 57 54 private:55 58 virtual InlineFlowBox* createInlineFlowBox() OVERRIDE FINAL; 56 59 -
trunk/Source/WebCore/rendering/svg/RenderSVGTSpan.h
r153380 r155682 25 25 #if ENABLE(SVG) 26 26 #include "RenderSVGInline.h" 27 #include "SVGTextPositioningElement.h" 27 28 28 29 namespace WebCore { 29 30 class RenderSVGTSpan FINAL : public RenderSVGInline { 30 31 public: 31 explicit RenderSVGTSpan(Element*); 32 explicit RenderSVGTSpan(SVGTextPositioningElement& element) 33 : RenderSVGInline(element) 34 { 35 } 36 37 SVGTextPositioningElement& textPositioningElement() const { return static_cast<SVGTextPositioningElement&>(RenderSVGInline::graphicsElement()); } 38 39 private: 40 void graphicsElement() const WTF_DELETED_FUNCTION; 32 41 virtual const char* renderName() const { return "RenderSVGTSpan"; } 33 42 }; -
trunk/Source/WebCore/rendering/svg/RenderSVGTextPath.cpp
r155374 r155682 35 35 namespace WebCore { 36 36 37 RenderSVGTextPath::RenderSVGTextPath( Element*element)37 RenderSVGTextPath::RenderSVGTextPath(SVGTextPathElement& element) 38 38 : RenderSVGInline(element) 39 39 { 40 40 } 41 41 42 SVGTextPathElement& RenderSVGTextPath::textPathElement() const 43 { 44 return toSVGTextPathElement(RenderSVGInline::graphicsElement()); 45 } 46 42 47 Path RenderSVGTextPath::layoutPath() const 43 48 { 44 SVGTextPathElement* textPathElement = toSVGTextPathElement(element()); 45 Element* targetElement = SVGURIReference::targetElementFromIRIString(textPathElement->href(), &textPathElement->document()); 49 Element* targetElement = SVGURIReference::targetElementFromIRIString(textPathElement().href(), &document()); 46 50 if (!targetElement || !targetElement->hasTagName(SVGNames::pathTag)) 47 51 return Path(); … … 63 67 float RenderSVGTextPath::startOffset() const 64 68 { 65 return t oSVGTextPathElement(element())->startOffset().valueAsPercentage();69 return textPathElement().startOffset().valueAsPercentage(); 66 70 } 67 71 68 72 bool RenderSVGTextPath::exactAlignment() const 69 73 { 70 return t oSVGTextPathElement(element())->spacing() == SVGTextPathSpacingExact;74 return textPathElement().spacing() == SVGTextPathSpacingExact; 71 75 } 72 76 73 77 bool RenderSVGTextPath::stretchMethod() const 74 78 { 75 return t oSVGTextPathElement(element())->method() == SVGTextPathMethodStretch;79 return textPathElement().method() == SVGTextPathMethodStretch; 76 80 } 77 81 -
trunk/Source/WebCore/rendering/svg/RenderSVGTextPath.h
r153380 r155682 29 29 class RenderSVGTextPath FINAL : public RenderSVGInline { 30 30 public: 31 RenderSVGTextPath(Element*); 31 explicit RenderSVGTextPath(SVGTextPathElement&); 32 33 SVGTextPathElement& textPathElement() const; 32 34 33 35 Path layoutPath() const; … … 36 38 bool stretchMethod() const; 37 39 38 virtual bool isSVGTextPath() const { return true; } 40 private: 41 void graphicsElement() const WTF_DELETED_FUNCTION; 39 42 40 private: 41 virtual const char* renderName() const { return "RenderSVGTextPath"; }43 virtual bool isSVGTextPath() const OVERRIDE { return true; } 44 virtual const char* renderName() const OVERRIDE { return "RenderSVGTextPath"; } 42 45 43 46 Path m_layoutPath; -
trunk/Source/WebCore/svg/SVGAElement.cpp
r154877 r155682 143 143 { 144 144 if (parentNode() && parentNode()->isSVGElement() && toSVGElement(parentNode())->isTextContent()) 145 return new (arena) RenderSVGInline( this);145 return new (arena) RenderSVGInline(*this); 146 146 147 147 return new (arena) RenderSVGTransformableContainer(this); -
trunk/Source/WebCore/svg/SVGAltGlyphElement.cpp
r155412 r155682 85 85 RenderObject* SVGAltGlyphElement::createRenderer(RenderArena* arena, RenderStyle*) 86 86 { 87 return new (arena) RenderSVGTSpan( this);87 return new (arena) RenderSVGTSpan(*this); 88 88 } 89 89 -
trunk/Source/WebCore/svg/SVGTRefElement.cpp
r154877 r155682 223 223 RenderObject* SVGTRefElement::createRenderer(RenderArena* arena, RenderStyle*) 224 224 { 225 return new (arena) RenderSVGInline( this);225 return new (arena) RenderSVGInline(*this); 226 226 } 227 227 -
trunk/Source/WebCore/svg/SVGTSpanElement.cpp
r154371 r155682 43 43 RenderObject* SVGTSpanElement::createRenderer(RenderArena* arena, RenderStyle*) 44 44 { 45 return new (arena) RenderSVGTSpan( this);45 return new (arena) RenderSVGTSpan(*this); 46 46 } 47 47 -
trunk/Source/WebCore/svg/SVGTextPathElement.cpp
r154877 r155682 130 130 RenderObject* SVGTextPathElement::createRenderer(RenderArena* arena, RenderStyle*) 131 131 { 132 return new (arena) RenderSVGTextPath( this);132 return new (arena) RenderSVGTextPath(*this); 133 133 } 134 134
Note: See TracChangeset
for help on using the changeset viewer.