Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1158)

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp

Issue 1404853003: Add SVG Text to support the CSS 'text-orientation' property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drott review Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
index ebfd859af892863aa840d21f7b3b60ff96defe81..b55074a2e70a2cf3ba76a88cd086f4ab90c7d84e 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
@@ -22,6 +22,7 @@
#include "core/layout/svg/SVGTextMetrics.h"
#include "core/layout/svg/LayoutSVGInlineText.h"
+#include "platform/fonts/FontOrientation.h"
namespace blink {
@@ -103,4 +104,18 @@ SVGTextMetrics::SVGTextMetrics(LayoutSVGInlineText* text, unsigned length, float
m_length = length;
}
+float SVGTextMetrics::advance(FontOrientation orientation) const
+{
+ switch (orientation) {
+ case FontOrientation::Horizontal:
+ case FontOrientation::VerticalRotated:
+ return width();
+ case FontOrientation::VerticalUpright:
+ return height();
+ default:
+ ASSERT_NOT_REACHED();
+ return width();
+ }
+}
+
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.h ('k') | third_party/WebKit/Source/platform/fonts/FontOrientation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698