[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

zimmermann at webkit.org zimmermann at webkit.org
Wed Dec 22 14:00:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c3bb3bc69d7e58ac822b014371d71a9a862040ce
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 1 10:45:15 2010 +0000

    2010-10-01  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Andreas Kling.
    
            Rename SVGTextLayoutBuilder to SVGTextLayoutAttributesBuilder
            https://bugs.webkit.org/show_bug.cgi?id=46971
    
            Doesn't affect any functionality, just moves files around.
    
            * Android.mk:
            * CMakeLists.txt:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * rendering/svg/RenderSVGText.cpp:
            (WebCore::RenderSVGText::layout): Adopt to renaming.
            * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: Copied from rendering/svg/SVGTextLayoutBuilder.cpp.
            * rendering/svg/SVGTextLayoutAttributesBuilder.h: Copied from rendering/svg/SVGTextLayoutBuilder.h.
            * rendering/svg/SVGTextLayoutBuilder.cpp: Removed.
            * rendering/svg/SVGTextLayoutBuilder.h: Removed.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68876 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index d8c72a1..dd25a47 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -717,7 +717,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
 	rendering/svg/SVGRootInlineBox.cpp \
 	rendering/svg/SVGTextChunk.cpp \
 	rendering/svg/SVGTextLayoutAttributes.cpp \
-	rendering/svg/SVGTextLayoutBuilder.cpp \
+	rendering/svg/SVGTextLayoutAttributesBuilder.cpp \
 	rendering/svg/SVGTextMetrics.cpp \
 	rendering/svg/SVGTextQuery.cpp
 endif
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index e8048bb..b54bd0b 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1707,7 +1707,7 @@ IF (ENABLE_SVG)
         rendering/svg/SVGRootInlineBox.cpp
         rendering/svg/SVGTextChunk.cpp
         rendering/svg/SVGTextLayoutAttributes.cpp
-        rendering/svg/SVGTextLayoutBuilder.cpp
+        rendering/svg/SVGTextLayoutAttributesBuilder.cpp
         rendering/svg/SVGTextMetrics.cpp
         rendering/svg/SVGTextQuery.cpp
         svg/ColorDistance.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 43eb724..e7578c2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-10-01  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Andreas Kling.
+
+        Rename SVGTextLayoutBuilder to SVGTextLayoutAttributesBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=46971
+
+        Doesn't affect any functionality, just moves files around.
+
+        * Android.mk:
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::layout): Adopt to renaming.
+        * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: Copied from rendering/svg/SVGTextLayoutBuilder.cpp.
+        * rendering/svg/SVGTextLayoutAttributesBuilder.h: Copied from rendering/svg/SVGTextLayoutBuilder.h.
+        * rendering/svg/SVGTextLayoutBuilder.cpp: Removed.
+        * rendering/svg/SVGTextLayoutBuilder.h: Removed.
+
 2010-10-01  MORITA Hajime  <morrita at google.com>
 
         Unreviewed build fix.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 96eea26..e46d7a9 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -2814,8 +2814,8 @@ webcore_sources += \
 	WebCore/rendering/svg/SVGTextFragment.h \
 	WebCore/rendering/svg/SVGTextLayoutAttributes.cpp \
 	WebCore/rendering/svg/SVGTextLayoutAttributes.h \
-	WebCore/rendering/svg/SVGTextLayoutBuilder.cpp \
-	WebCore/rendering/svg/SVGTextLayoutBuilder.h \
+	WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp \
+	WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h \
 	WebCore/rendering/svg/SVGTextMetrics.cpp \
 	WebCore/rendering/svg/SVGTextMetrics.h \
 	WebCore/rendering/svg/SVGTextQuery.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 7b52557..f346dab 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3456,8 +3456,8 @@
             'rendering/svg/SVGTextFragment.h',
             'rendering/svg/SVGTextLayoutAttributes.cpp',
             'rendering/svg/SVGTextLayoutAttributes.h',
-            'rendering/svg/SVGTextLayoutBuilder.cpp',
-            'rendering/svg/SVGTextLayoutBuilder.h',
+            'rendering/svg/SVGTextLayoutAttributesBuilder.cpp',
+            'rendering/svg/SVGTextLayoutAttributesBuilder.h',
             'rendering/svg/SVGTextMetrics.cpp',
             'rendering/svg/SVGTextMetrics.h',
             'rendering/svg/SVGTextQuery.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 3aea684..1847d09 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2300,7 +2300,7 @@ HEADERS += \
     rendering/svg/SVGTextChunk.h \
     rendering/svg/SVGTextFragment.h \
     rendering/svg/SVGTextLayoutAttributes.h \
-    rendering/svg/SVGTextLayoutBuilder.h \
+    rendering/svg/SVGTextLayoutAttributesBuilder.h \
     rendering/svg/SVGTextMetrics.h \
     rendering/svg/SVGTextQuery.h \
     rendering/SVGCharacterData.h \
@@ -3288,7 +3288,7 @@ contains(DEFINES, ENABLE_SVG=1) {
         rendering/svg/SVGRootInlineBox.cpp \
         rendering/svg/SVGTextChunk.cpp \
         rendering/svg/SVGTextLayoutAttributes.cpp \
-        rendering/svg/SVGTextLayoutBuilder.cpp \
+        rendering/svg/SVGTextLayoutAttributesBuilder.cpp \
         rendering/svg/SVGTextMetrics.cpp \
         rendering/svg/SVGTextQuery.cpp \
         rendering/PointerEventsHitRules.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 35f5e6c..7a75d37 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -33478,11 +33478,11 @@
 					>
 				</File>
 				<File
-					RelativePath="..\rendering\svg\SVGTextLayoutBuilder.cpp"
+					RelativePath="..\rendering\svg\SVGTextLayoutAttributesBuilder.cpp"
 					>
 				</File>
 				<File
-					RelativePath="..\rendering\svg\SVGTextLayoutBuilder.h"
+					RelativePath="..\rendering\svg\SVGTextLayoutAttributesBuilder.h"
 					>
 				</File>
 				<File
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 145dff9..9c38c01 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -66,6 +66,8 @@
 		080AEC840ED8708B00DF4CCE /* WMLIntrinsicEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 080AEC800ED8708B00DF4CCE /* WMLIntrinsicEventHandler.h */; };
 		080FAE1A0EEEBDA800AACDE9 /* WMLTemplateElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 080FAE180EEEBDA800AACDE9 /* WMLTemplateElement.cpp */; };
 		080FAE1B0EEEBDA800AACDE9 /* WMLTemplateElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 080FAE190EEEBDA800AACDE9 /* WMLTemplateElement.h */; };
+		081093DB1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 081093D91255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.cpp */; };
+		081093DC1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 081093DA1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h */; };
 		0818AEE20EDB86BC00647B66 /* WMLEventHandlingElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0818AEE00EDB86BC00647B66 /* WMLEventHandlingElement.cpp */; };
 		0818AEE30EDB86BC00647B66 /* WMLEventHandlingElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0818AEE10EDB86BC00647B66 /* WMLEventHandlingElement.h */; };
 		081AA8DA1111237E002AB06E /* SVGElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 081AA8D91111237E002AB06E /* SVGElementRareData.h */; };
@@ -170,8 +172,6 @@
 		0885068011DA045B00182B98 /* PaintPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067E11DA045B00182B98 /* PaintPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		088C2F7912390081003D65CE /* SVGTextLayoutAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */; };
 		088C2F7A12390081003D65CE /* SVGTextLayoutAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */; };
-		088C2F7B12390081003D65CE /* SVGTextLayoutBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 088C2F7712390081003D65CE /* SVGTextLayoutBuilder.cpp */; };
-		088C2F7C12390081003D65CE /* SVGTextLayoutBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 088C2F7812390081003D65CE /* SVGTextLayoutBuilder.h */; };
 		088C97120ECB6D92000534BA /* WMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA3AB490E556F2400E9C0C0 /* WMLNames.cpp */; };
 		088C97130ECB6D9D000534BA /* WMLNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CA3AB480E556F2400E9C0C0 /* WMLNames.h */; };
 		088C97510ECB6E28000534BA /* WMLAElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B99180E52E37300487BB7 /* WMLAElement.cpp */; };
@@ -6009,6 +6009,8 @@
 		080AEC800ED8708B00DF4CCE /* WMLIntrinsicEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLIntrinsicEventHandler.h; sourceTree = "<group>"; };
 		080FAE180EEEBDA800AACDE9 /* WMLTemplateElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLTemplateElement.cpp; sourceTree = "<group>"; };
 		080FAE190EEEBDA800AACDE9 /* WMLTemplateElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLTemplateElement.h; sourceTree = "<group>"; };
+		081093D91255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutAttributesBuilder.cpp; sourceTree = "<group>"; };
+		081093DA1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutAttributesBuilder.h; sourceTree = "<group>"; };
 		0818AEE00EDB86BC00647B66 /* WMLEventHandlingElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLEventHandlingElement.cpp; sourceTree = "<group>"; };
 		0818AEE10EDB86BC00647B66 /* WMLEventHandlingElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLEventHandlingElement.h; sourceTree = "<group>"; };
 		081AA8D91111237E002AB06E /* SVGElementRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGElementRareData.h; sourceTree = "<group>"; };
@@ -6111,8 +6113,6 @@
 		0885067E11DA045B00182B98 /* PaintPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPhase.h; sourceTree = "<group>"; };
 		088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutAttributes.cpp; sourceTree = "<group>"; };
 		088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutAttributes.h; sourceTree = "<group>"; };
-		088C2F7712390081003D65CE /* SVGTextLayoutBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutBuilder.cpp; sourceTree = "<group>"; };
-		088C2F7812390081003D65CE /* SVGTextLayoutBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutBuilder.h; sourceTree = "<group>"; };
 		0893E4650ECB68F400A28563 /* WMLPageState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLPageState.cpp; sourceTree = "<group>"; };
 		0893E4660ECB68F400A28563 /* WMLPageState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLPageState.h; sourceTree = "<group>"; };
 		089582530E857A7E00F82C83 /* ImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageLoader.cpp; sourceTree = "<group>"; };
@@ -11659,8 +11659,8 @@
 				08F0BFBF1255C53C00075185 /* SVGTextFragment.h */,
 				088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */,
 				088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */,
-				088C2F7712390081003D65CE /* SVGTextLayoutBuilder.cpp */,
-				088C2F7812390081003D65CE /* SVGTextLayoutBuilder.h */,
+				081093D91255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.cpp */,
+				081093DA1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h */,
 				08F0BFC01255C53C00075185 /* SVGTextMetrics.cpp */,
 				08F0BFC11255C53C00075185 /* SVGTextMetrics.h */,
 				0854B0121255E4E600B9CDD0 /* SVGTextQuery.cpp */,
@@ -20661,7 +20661,6 @@
 				B2227AC80D00BF220071B782 /* SVGTextContentElement.h in Headers */,
 				B2227ACB0D00BF220071B782 /* SVGTextElement.h in Headers */,
 				088C2F7A12390081003D65CE /* SVGTextLayoutAttributes.h in Headers */,
-				088C2F7C12390081003D65CE /* SVGTextLayoutBuilder.h in Headers */,
 				083F529A11957FBE00653EBE /* SVGTextLayoutUtilities.h in Headers */,
 				B2227ACE0D00BF220071B782 /* SVGTextPathElement.h in Headers */,
 				B2227AD10D00BF220071B782 /* SVGTextPositioningElement.h in Headers */,
@@ -20937,6 +20936,7 @@
 				0854B0211255E4E600B9CDD0 /* SVGInlineTextBox.h in Headers */,
 				0854B0231255E4E600B9CDD0 /* SVGRootInlineBox.h in Headers */,
 				0854B0251255E4E600B9CDD0 /* SVGTextQuery.h in Headers */,
+				081093DC1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -23231,7 +23231,6 @@
 				B2227AC70D00BF220071B782 /* SVGTextContentElement.cpp in Sources */,
 				B2227ACA0D00BF220071B782 /* SVGTextElement.cpp in Sources */,
 				088C2F7912390081003D65CE /* SVGTextLayoutAttributes.cpp in Sources */,
-				088C2F7B12390081003D65CE /* SVGTextLayoutBuilder.cpp in Sources */,
 				083F529911957FBE00653EBE /* SVGTextLayoutUtilities.cpp in Sources */,
 				B2227ACD0D00BF220071B782 /* SVGTextPathElement.cpp in Sources */,
 				B2227AD00D00BF220071B782 /* SVGTextPositioningElement.cpp in Sources */,
@@ -23463,6 +23462,7 @@
 				0854B0201255E4E600B9CDD0 /* SVGInlineTextBox.cpp in Sources */,
 				0854B0221255E4E600B9CDD0 /* SVGRootInlineBox.cpp in Sources */,
 				0854B0241255E4E600B9CDD0 /* SVGTextQuery.cpp in Sources */,
+				081093DB1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/rendering/svg/RenderSVGText.cpp b/WebCore/rendering/svg/RenderSVGText.cpp
index 92091af..19b0a2c 100644
--- a/WebCore/rendering/svg/RenderSVGText.cpp
+++ b/WebCore/rendering/svg/RenderSVGText.cpp
@@ -42,7 +42,7 @@
 #include "SVGRenderSupport.h"
 #include "SVGRootInlineBox.h"
 #include "SVGTextElement.h"
-#include "SVGTextLayoutBuilder.h"
+#include "SVGTextLayoutAttributesBuilder.h"
 #include "SVGTransformList.h"
 #include "SVGURIReference.h"
 #include "SimpleFontData.h"
@@ -84,8 +84,8 @@ void RenderSVGText::layout()
         updateCachedBoundariesInParents = true;
     }
 
-    SVGTextLayoutBuilder layoutBuilder;
-    layoutBuilder.buildLayoutAttributesForTextSubtree(this);
+    SVGTextLayoutAttributesBuilder layoutAttributesBuilder;
+    layoutAttributesBuilder.buildLayoutAttributesForTextSubtree(this);
 
     // Reduced version of RenderBlock::layoutBlock(), which only takes care of SVG text.
     // All if branches that could cause early exit in RenderBlocks layoutBlock() method are turned into assertions.
diff --git a/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp b/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
new file mode 100644
index 0000000..9d6d2e9
--- /dev/null
+++ b/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -0,0 +1,304 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "SVGTextLayoutAttributesBuilder.h"
+
+#include "RenderSVGInlineText.h"
+#include "RenderSVGText.h"
+#include "SVGTextLayoutUtilities.h"
+#include "SVGTextPositioningElement.h"
+
+// Set to a value > 0 to dump the layout vectors
+#define DUMP_LAYOUT_VECTORS 0
+
+namespace WebCore {
+
+SVGTextLayoutAttributesBuilder::SVGTextLayoutAttributesBuilder()
+{
+}
+
+void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextSubtree(RenderSVGText* textRoot)
+{
+    ASSERT(textRoot);
+    m_scopes.clear();
+
+    // Build layout scopes.
+    unsigned atCharacter = 0;
+    buildLayoutScopes(textRoot, atCharacter);
+
+    if (!atCharacter)
+        return;
+
+    // Add outermost scope, after text length is known.
+    LayoutScope scope;
+    buildLayoutScope(scope, textRoot, 0, atCharacter);
+    m_scopes.prepend(scope);
+
+    // Build layout information respecting scope of attribute values.
+    buildLayoutAttributesFromScopes();
+
+    atCharacter = 0;
+    propagateLayoutAttributes(textRoot, atCharacter);
+}
+
+static inline void copyToDestinationVector(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned sourceStartOffset, unsigned length)
+{
+    ASSERT(destinationStartOffset + length <= destination.size());
+
+    Vector<float>::iterator sourceBegin = source.begin() + sourceStartOffset;
+    std::copy(sourceBegin, sourceBegin + length, destination.begin() + destinationStartOffset);
+}
+
+static inline void copyToDestinationVectorIfSourceRangeIsNotEmpty(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned sourceStartOffset, unsigned length)
+{
+    bool rangeEmpty = true;
+
+    unsigned size = sourceStartOffset + length;
+    for (unsigned i = sourceStartOffset; i < size; ++i) {
+        if (source.at(i) == SVGTextLayoutAttributes::emptyValue())
+            continue;
+        rangeEmpty = false;
+        break;
+    }
+
+    if (rangeEmpty)
+        return;
+
+    destination.resize(length);
+    copyToDestinationVector(destination, destinationStartOffset, source, sourceStartOffset, length);
+}
+
+void SVGTextLayoutAttributesBuilder::propagateLayoutAttributes(RenderObject* start, unsigned& atCharacter)
+{
+    for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) { 
+        if (!child->isSVGInlineText()) {
+            if (child->isSVGInline())
+                propagateLayoutAttributes(child, atCharacter);
+            continue;
+        }
+
+        RenderSVGInlineText* text = static_cast<RenderSVGInlineText*>(child);
+        unsigned textLength = text->textLength();
+
+        // Build layout attributes for a single RenderSVGInlineText renderer.
+        SVGTextLayoutAttributes attributes;
+
+        // The x value list should always be as large as the text length.
+        // Any values that are empty will be filled in by the actual text layout process later,
+        // as we need to be able to query the x/y position for every character through SVG DOM.
+        attributes.xValues().resize(textLength);
+        copyToDestinationVector(attributes.xValues(), 0, m_attributes.xValues(), atCharacter, textLength);
+
+        // Same for the y value list.
+        attributes.yValues().resize(textLength);
+        copyToDestinationVector(attributes.yValues(), 0, m_attributes.yValues(), atCharacter, textLength);
+
+        // The dx/dy/rotate value lists may be empty.
+        copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.dxValues(), 0, m_attributes.dxValues(), atCharacter, textLength);
+        copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.dyValues(), 0, m_attributes.dyValues(), atCharacter, textLength);
+        copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.rotateValues(), 0, m_attributes.rotateValues(), atCharacter, textLength);
+
+        // Build CharacterData, which will be used to detect ligatures, holds kerning pairs (glyph name, unicode string) and character metrics.
+        measureCharacters(text, attributes);
+
+#if DUMP_LAYOUT_VECTORS > 0
+        fprintf(stderr, "Dumping layout vector for RenderSVGInlineText, renderer=%p, node=%p\n", text, text->node());
+        attributes.dump();
+#endif
+
+        text->storeLayoutAttributes(attributes);
+        atCharacter += text->textLength();
+    }
+}
+
+void SVGTextLayoutAttributesBuilder::buildLayoutScopes(RenderObject* start, unsigned& atCharacter)
+{
+    for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) { 
+        if (child->isSVGInlineText()) {
+            atCharacter += toRenderText(child)->textLength();
+            continue;
+        }
+
+        if (!child->isSVGInline())
+            continue;
+
+        unsigned textContentStart = atCharacter;
+        buildLayoutScopes(child, atCharacter);
+
+        LayoutScope scope;
+        buildLayoutScope(scope, child, textContentStart, atCharacter - textContentStart);
+        m_scopes.append(scope);
+    }
+}
+
+static inline void fillDestinationVectorWithLastSourceValue(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned length)
+{
+    if (source.isEmpty())
+        return;
+
+    float lastValue = source.last();
+
+    unsigned rotateValuesSize = source.size();
+    for (unsigned i = rotateValuesSize; i < length; ++i) {
+        ASSERT(i + destinationStartOffset < destination.size());
+        destination.at(i + destinationStartOffset) = lastValue;
+    }
+}
+
+void SVGTextLayoutAttributesBuilder::buildLayoutAttributesFromScopes()
+{
+    ASSERT(!m_scopes.isEmpty());
+
+    unsigned totalLength = m_scopes.first().textContentLength;
+    if (!totalLength)
+        return;
+
+    m_attributes.fillWithEmptyValues(totalLength);
+
+    // Build final list of x/y/dx/dy/rotate values for each character stores in the <text> subtree.
+    for (unsigned atScope = 0; atScope < m_scopes.size(); ++atScope) {
+        LayoutScope& scope = m_scopes.at(atScope);
+        SVGTextLayoutAttributes& attributes = scope.attributes;
+
+        copyToDestinationVector(m_attributes.xValues(), scope.textContentStart, attributes.xValues(), 0, attributes.xValues().size());
+        copyToDestinationVector(m_attributes.yValues(), scope.textContentStart, attributes.yValues(), 0, attributes.yValues().size());
+        copyToDestinationVector(m_attributes.dxValues(), scope.textContentStart, attributes.dxValues(), 0, attributes.dxValues().size());
+        copyToDestinationVector(m_attributes.dyValues(), scope.textContentStart, attributes.dyValues(), 0, attributes.dyValues().size());
+        copyToDestinationVector(m_attributes.rotateValues(), scope.textContentStart, attributes.rotateValues(), 0, attributes.rotateValues().size());
+
+        // In horizontal (vertical) writing modes, the last y (x) value in the scope is the default y (x) value for all following characters, unless explicitely overriden.
+        if (scope.isVerticalWritingMode)
+            fillDestinationVectorWithLastSourceValue(m_attributes.xValues(), scope.textContentStart, attributes.xValues(), scope.textContentLength);
+        else
+            fillDestinationVectorWithLastSourceValue(m_attributes.yValues(), scope.textContentStart, attributes.yValues(), scope.textContentLength);
+
+        // The last rotation value in the scope is the default rotation for all following character, unless explicitely overriden.
+        fillDestinationVectorWithLastSourceValue(m_attributes.rotateValues(), scope.textContentStart, attributes.rotateValues(), scope.textContentLength);
+    }
+}
+
+void SVGTextLayoutAttributesBuilder::measureCharacters(RenderSVGInlineText* text, SVGTextLayoutAttributes& attributes)
+{
+    ASSERT(text);
+    ASSERT(text->style());
+    const Font& font = text->style()->font();
+    const UChar* characters = text->characters();
+    int length = text->textLength();
+
+    TextRun run(0, 0);
+    run.disableSpacing();
+    run.disableRoundingHacks();
+
+    int charsConsumed = 0;
+    for (int position = 0; position < length; position += charsConsumed) {
+        run.setText(characters + position, 1);
+        int extraCharsAvailable = length - position - 1;
+
+        SVGTextLayoutAttributes::CharacterData characterData;
+        characterData.width = font.floatWidth(run, extraCharsAvailable, characterData.spansCharacters, characterData.glyphName);
+        characterData.height = font.height();
+        characterData.unicodeString = String(characters + position, characterData.spansCharacters);
+        attributes.characterDataValues().append(characterData);
+
+        charsConsumed = characterData.spansCharacters;
+    }
+}
+
+static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, SVGLengthList* list, Vector<float>& floatValues, int textContentLength)
+{
+    ASSERT(lengthContext);
+    ASSERT(list);
+    ASSERT(textContentLength >= 0);
+
+    ExceptionCode ec = 0;
+    int length = list->numberOfItems();
+    if (length > textContentLength)
+        length = textContentLength;
+
+    for (int i = 0; i < length; ++i) {
+        SVGLength length(list->getItem(i, ec));
+        ASSERT(!ec);
+        floatValues.append(length.value(lengthContext));
+    }
+}
+
+static inline void extractFloatValuesFromSVGNumberList(SVGNumberList* list, Vector<float>& floatValues, int textContentLength)
+{
+    ASSERT(list);
+    ASSERT(textContentLength >= 0);
+
+    ExceptionCode ec = 0;
+    int length = list->numberOfItems();
+    if (length > textContentLength)
+        length = textContentLength;
+
+    for (int i = 0; i < length; ++i) {
+        float length(list->getItem(i, ec));
+        ASSERT(!ec);
+        floatValues.append(length);
+    }
+}
+
+static inline SVGTextPositioningElement* svgTextPositioningElementForInlineRenderer(RenderObject* renderer)
+{
+    ASSERT(renderer);
+    ASSERT(renderer->isSVGText() || renderer->isSVGInline());
+
+    Node* node = renderer->node();
+    ASSERT(node);
+    ASSERT(node->isSVGElement());
+
+    if (!node->hasTagName(SVGNames::textTag)
+     && !node->hasTagName(SVGNames::tspanTag)
+#if ENABLE(SVG_FONTS)
+     && !node->hasTagName(SVGNames::altGlyphTag)
+#endif
+     && !node->hasTagName(SVGNames::trefTag))
+        return 0;
+
+    return static_cast<SVGTextPositioningElement*>(node);
+}
+
+void SVGTextLayoutAttributesBuilder::buildLayoutScope(LayoutScope& scope, RenderObject* renderer, unsigned textContentStart, unsigned textContentLength)
+{
+    ASSERT(renderer);
+    ASSERT(renderer->style());
+
+    scope.isVerticalWritingMode = isVerticalWritingMode(renderer->style()->svgStyle());
+    scope.textContentStart = textContentStart;
+    scope.textContentLength = textContentLength;
+
+    SVGTextPositioningElement* element = svgTextPositioningElementForInlineRenderer(renderer);
+    if (!element)
+        return;
+
+    SVGTextLayoutAttributes& attributes = scope.attributes;
+    extractFloatValuesFromSVGLengthList(element, element->x(), attributes.xValues(), textContentLength);
+    extractFloatValuesFromSVGLengthList(element, element->y(), attributes.yValues(), textContentLength);
+    extractFloatValuesFromSVGLengthList(element, element->dx(), attributes.dxValues(), textContentLength);
+    extractFloatValuesFromSVGLengthList(element, element->dy(), attributes.dyValues(), textContentLength);
+    extractFloatValuesFromSVGNumberList(element->rotate(), attributes.rotateValues(), textContentLength);
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h b/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h
new file mode 100644
index 0000000..1b903a5
--- /dev/null
+++ b/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGTextLayoutAttributesBuilder_h
+#define SVGTextLayoutAttributesBuilder_h
+
+#if ENABLE(SVG)
+#include "SVGTextLayoutAttributes.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class RenderObject;
+class RenderSVGInlineText;
+class RenderSVGText;
+
+class SVGTextLayoutAttributesBuilder : public Noncopyable {
+public:
+    SVGTextLayoutAttributesBuilder();
+    void buildLayoutAttributesForTextSubtree(RenderSVGText*);
+
+private:
+    struct LayoutScope {
+        LayoutScope()
+            : isVerticalWritingMode(false)
+            , textContentStart(0)
+            , textContentLength(0)
+        {
+        }
+
+        bool isVerticalWritingMode;
+        unsigned textContentStart;
+        unsigned textContentLength;
+        SVGTextLayoutAttributes attributes;
+    };
+
+    void buildLayoutScopes(RenderObject*, unsigned& atCharacter);
+    void buildLayoutScope(LayoutScope&, RenderObject*, unsigned textContentStart, unsigned textContentLength);
+    void buildLayoutAttributesFromScopes();
+    void propagateLayoutAttributes(RenderObject*, unsigned& atCharacter);
+    void measureCharacters(RenderSVGInlineText*, SVGTextLayoutAttributes&);
+
+private:
+    Vector<LayoutScope> m_scopes;
+    SVGTextLayoutAttributes m_attributes;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/rendering/svg/SVGTextLayoutBuilder.cpp b/WebCore/rendering/svg/SVGTextLayoutBuilder.cpp
deleted file mode 100644
index 0b3a752..0000000
--- a/WebCore/rendering/svg/SVGTextLayoutBuilder.cpp
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#if ENABLE(SVG)
-#include "SVGTextLayoutBuilder.h"
-
-#include "RenderSVGInlineText.h"
-#include "RenderSVGText.h"
-#include "SVGTextLayoutUtilities.h"
-#include "SVGTextPositioningElement.h"
-
-// Set to a value > 0 to dump the layout vectors
-#define DUMP_LAYOUT_VECTORS 0
-
-namespace WebCore {
-
-SVGTextLayoutBuilder::SVGTextLayoutBuilder()
-{
-}
-
-void SVGTextLayoutBuilder::buildLayoutAttributesForTextSubtree(RenderSVGText* textRoot)
-{
-    ASSERT(textRoot);
-    m_scopes.clear();
-
-    // Build layout scopes.
-    unsigned atCharacter = 0;
-    buildLayoutScopes(textRoot, atCharacter);
-
-    if (!atCharacter)
-        return;
-
-    // Add outermost scope, after text length is known.
-    LayoutScope scope;
-    buildLayoutScope(scope, textRoot, 0, atCharacter);
-    m_scopes.prepend(scope);
-
-    // Build layout information respecting scope of attribute values.
-    buildLayoutAttributesFromScopes();
-
-    atCharacter = 0;
-    propagateLayoutAttributes(textRoot, atCharacter);
-}
-
-static inline void copyToDestinationVector(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned sourceStartOffset, unsigned length)
-{
-    ASSERT(destinationStartOffset + length <= destination.size());
-
-    Vector<float>::iterator sourceBegin = source.begin() + sourceStartOffset;
-    std::copy(sourceBegin, sourceBegin + length, destination.begin() + destinationStartOffset);
-}
-
-static inline void copyToDestinationVectorIfSourceRangeIsNotEmpty(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned sourceStartOffset, unsigned length)
-{
-    bool rangeEmpty = true;
-
-    unsigned size = sourceStartOffset + length;
-    for (unsigned i = sourceStartOffset; i < size; ++i) {
-        if (source.at(i) == SVGTextLayoutAttributes::emptyValue())
-            continue;
-        rangeEmpty = false;
-        break;
-    }
-
-    if (rangeEmpty)
-        return;
-
-    destination.resize(length);
-    copyToDestinationVector(destination, destinationStartOffset, source, sourceStartOffset, length);
-}
-
-void SVGTextLayoutBuilder::propagateLayoutAttributes(RenderObject* start, unsigned& atCharacter)
-{
-    for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) { 
-        if (!child->isSVGInlineText()) {
-            if (child->isSVGInline())
-                propagateLayoutAttributes(child, atCharacter);
-            continue;
-        }
-
-        RenderSVGInlineText* text = static_cast<RenderSVGInlineText*>(child);
-        unsigned textLength = text->textLength();
-
-        // Build layout attributes for a single RenderSVGInlineText renderer.
-        SVGTextLayoutAttributes attributes;
-
-        // The x value list should always be as large as the text length.
-        // Any values that are empty will be filled in by the actual text layout process later,
-        // as we need to be able to query the x/y position for every character through SVG DOM.
-        attributes.xValues().resize(textLength);
-        copyToDestinationVector(attributes.xValues(), 0, m_attributes.xValues(), atCharacter, textLength);
-
-        // Same for the y value list.
-        attributes.yValues().resize(textLength);
-        copyToDestinationVector(attributes.yValues(), 0, m_attributes.yValues(), atCharacter, textLength);
-
-        // The dx/dy/rotate value lists may be empty.
-        copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.dxValues(), 0, m_attributes.dxValues(), atCharacter, textLength);
-        copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.dyValues(), 0, m_attributes.dyValues(), atCharacter, textLength);
-        copyToDestinationVectorIfSourceRangeIsNotEmpty(attributes.rotateValues(), 0, m_attributes.rotateValues(), atCharacter, textLength);
-
-        // Build CharacterData, which will be used to detect ligatures, holds kerning pairs (glyph name, unicode string) and character metrics.
-        measureCharacters(text, attributes);
-
-#if DUMP_LAYOUT_VECTORS > 0
-        fprintf(stderr, "Dumping layout vector for RenderSVGInlineText, renderer=%p, node=%p\n", text, text->node());
-        attributes.dump();
-#endif
-
-        text->storeLayoutAttributes(attributes);
-        atCharacter += text->textLength();
-    }
-}
-
-void SVGTextLayoutBuilder::buildLayoutScopes(RenderObject* start, unsigned& atCharacter)
-{
-    for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) { 
-        if (child->isSVGInlineText()) {
-            atCharacter += toRenderText(child)->textLength();
-            continue;
-        }
-
-        if (!child->isSVGInline())
-            continue;
-
-        unsigned textContentStart = atCharacter;
-        buildLayoutScopes(child, atCharacter);
-
-        LayoutScope scope;
-        buildLayoutScope(scope, child, textContentStart, atCharacter - textContentStart);
-        m_scopes.append(scope);
-    }
-}
-
-static inline void fillDestinationVectorWithLastSourceValue(Vector<float>& destination, unsigned destinationStartOffset, Vector<float>& source, unsigned length)
-{
-    if (source.isEmpty())
-        return;
-
-    float lastValue = source.last();
-
-    unsigned rotateValuesSize = source.size();
-    for (unsigned i = rotateValuesSize; i < length; ++i) {
-        ASSERT(i + destinationStartOffset < destination.size());
-        destination.at(i + destinationStartOffset) = lastValue;
-    }
-}
-
-void SVGTextLayoutBuilder::buildLayoutAttributesFromScopes()
-{
-    ASSERT(!m_scopes.isEmpty());
-
-    unsigned totalLength = m_scopes.first().textContentLength;
-    if (!totalLength)
-        return;
-
-    m_attributes.fillWithEmptyValues(totalLength);
-
-    // Build final list of x/y/dx/dy/rotate values for each character stores in the <text> subtree.
-    for (unsigned atScope = 0; atScope < m_scopes.size(); ++atScope) {
-        LayoutScope& scope = m_scopes.at(atScope);
-        SVGTextLayoutAttributes& attributes = scope.attributes;
-
-        copyToDestinationVector(m_attributes.xValues(), scope.textContentStart, attributes.xValues(), 0, attributes.xValues().size());
-        copyToDestinationVector(m_attributes.yValues(), scope.textContentStart, attributes.yValues(), 0, attributes.yValues().size());
-        copyToDestinationVector(m_attributes.dxValues(), scope.textContentStart, attributes.dxValues(), 0, attributes.dxValues().size());
-        copyToDestinationVector(m_attributes.dyValues(), scope.textContentStart, attributes.dyValues(), 0, attributes.dyValues().size());
-        copyToDestinationVector(m_attributes.rotateValues(), scope.textContentStart, attributes.rotateValues(), 0, attributes.rotateValues().size());
-
-        // In horizontal (vertical) writing modes, the last y (x) value in the scope is the default y (x) value for all following characters, unless explicitely overriden.
-        if (scope.isVerticalWritingMode)
-            fillDestinationVectorWithLastSourceValue(m_attributes.xValues(), scope.textContentStart, attributes.xValues(), scope.textContentLength);
-        else
-            fillDestinationVectorWithLastSourceValue(m_attributes.yValues(), scope.textContentStart, attributes.yValues(), scope.textContentLength);
-
-        // The last rotation value in the scope is the default rotation for all following character, unless explicitely overriden.
-        fillDestinationVectorWithLastSourceValue(m_attributes.rotateValues(), scope.textContentStart, attributes.rotateValues(), scope.textContentLength);
-    }
-}
-
-void SVGTextLayoutBuilder::measureCharacters(RenderSVGInlineText* text, SVGTextLayoutAttributes& attributes)
-{
-    ASSERT(text);
-    ASSERT(text->style());
-    const Font& font = text->style()->font();
-    const UChar* characters = text->characters();
-    int length = text->textLength();
-
-    TextRun run(0, 0);
-    run.disableSpacing();
-    run.disableRoundingHacks();
-
-    int charsConsumed = 0;
-    for (int position = 0; position < length; position += charsConsumed) {
-        run.setText(characters + position, 1);
-        int extraCharsAvailable = length - position - 1;
-
-        SVGTextLayoutAttributes::CharacterData characterData;
-        characterData.width = font.floatWidth(run, extraCharsAvailable, characterData.spansCharacters, characterData.glyphName);
-        characterData.height = font.height();
-        characterData.unicodeString = String(characters + position, characterData.spansCharacters);
-        attributes.characterDataValues().append(characterData);
-
-        charsConsumed = characterData.spansCharacters;
-    }
-}
-
-static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, SVGLengthList* list, Vector<float>& floatValues, int textContentLength)
-{
-    ASSERT(lengthContext);
-    ASSERT(list);
-    ASSERT(textContentLength >= 0);
-
-    ExceptionCode ec = 0;
-    int length = list->numberOfItems();
-    if (length > textContentLength)
-        length = textContentLength;
-
-    for (int i = 0; i < length; ++i) {
-        SVGLength length(list->getItem(i, ec));
-        ASSERT(!ec);
-        floatValues.append(length.value(lengthContext));
-    }
-}
-
-static inline void extractFloatValuesFromSVGNumberList(SVGNumberList* list, Vector<float>& floatValues, int textContentLength)
-{
-    ASSERT(list);
-    ASSERT(textContentLength >= 0);
-
-    ExceptionCode ec = 0;
-    int length = list->numberOfItems();
-    if (length > textContentLength)
-        length = textContentLength;
-
-    for (int i = 0; i < length; ++i) {
-        float length(list->getItem(i, ec));
-        ASSERT(!ec);
-        floatValues.append(length);
-    }
-}
-
-static inline SVGTextPositioningElement* svgTextPositioningElementForInlineRenderer(RenderObject* renderer)
-{
-    ASSERT(renderer);
-    ASSERT(renderer->isSVGText() || renderer->isSVGInline());
-
-    Node* node = renderer->node();
-    ASSERT(node);
-    ASSERT(node->isSVGElement());
-
-    if (!node->hasTagName(SVGNames::textTag)
-     && !node->hasTagName(SVGNames::tspanTag)
-#if ENABLE(SVG_FONTS)
-     && !node->hasTagName(SVGNames::altGlyphTag)
-#endif
-     && !node->hasTagName(SVGNames::trefTag))
-        return 0;
-
-    return static_cast<SVGTextPositioningElement*>(node);
-}
-
-void SVGTextLayoutBuilder::buildLayoutScope(LayoutScope& scope, RenderObject* renderer, unsigned textContentStart, unsigned textContentLength)
-{
-    ASSERT(renderer);
-    ASSERT(renderer->style());
-
-    scope.isVerticalWritingMode = isVerticalWritingMode(renderer->style()->svgStyle());
-    scope.textContentStart = textContentStart;
-    scope.textContentLength = textContentLength;
-
-    SVGTextPositioningElement* element = svgTextPositioningElementForInlineRenderer(renderer);
-    if (!element)
-        return;
-
-    SVGTextLayoutAttributes& attributes = scope.attributes;
-    extractFloatValuesFromSVGLengthList(element, element->x(), attributes.xValues(), textContentLength);
-    extractFloatValuesFromSVGLengthList(element, element->y(), attributes.yValues(), textContentLength);
-    extractFloatValuesFromSVGLengthList(element, element->dx(), attributes.dxValues(), textContentLength);
-    extractFloatValuesFromSVGLengthList(element, element->dy(), attributes.dyValues(), textContentLength);
-    extractFloatValuesFromSVGNumberList(element->rotate(), attributes.rotateValues(), textContentLength);
-}
-
-}
-
-#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/svg/SVGTextLayoutBuilder.h b/WebCore/rendering/svg/SVGTextLayoutBuilder.h
deleted file mode 100644
index 6df7fa1..0000000
--- a/WebCore/rendering/svg/SVGTextLayoutBuilder.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef SVGTextLayoutBuilder_h
-#define SVGTextLayoutBuilder_h
-
-#if ENABLE(SVG)
-#include "SVGTextLayoutAttributes.h"
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class RenderObject;
-class RenderSVGInlineText;
-class RenderSVGText;
-
-class SVGTextLayoutBuilder : public Noncopyable {
-public:
-    SVGTextLayoutBuilder();
-    void buildLayoutAttributesForTextSubtree(RenderSVGText*);
-
-private:
-    struct LayoutScope {
-        LayoutScope()
-            : isVerticalWritingMode(false)
-            , textContentStart(0)
-            , textContentLength(0)
-        {
-        }
-
-        bool isVerticalWritingMode;
-        unsigned textContentStart;
-        unsigned textContentLength;
-        SVGTextLayoutAttributes attributes;
-    };
-
-    void buildLayoutScopes(RenderObject*, unsigned& atCharacter);
-    void buildLayoutScope(LayoutScope&, RenderObject*, unsigned textContentStart, unsigned textContentLength);
-    void buildLayoutAttributesFromScopes();
-    void propagateLayoutAttributes(RenderObject*, unsigned& atCharacter);
-    void measureCharacters(RenderSVGInlineText*, SVGTextLayoutAttributes&);
-
-private:
-    Vector<LayoutScope> m_scopes;
-    SVGTextLayoutAttributes m_attributes;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG)
-#endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list