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

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

Issue 1625683003: [Line Layout API] Some harder SVGTextLayoutEngine changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@3_api_easy_svg
Patch Set: Created 4 years, 11 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/SVGTextLayoutEngine.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
index 7d44ebb130e1be97065a02cb9979dcc48c801c58..627aae9435e73412af1b30fb59df5c25c0d24ce8 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
@@ -171,8 +171,13 @@ void SVGTextLayoutEngine::beginTextPathLayout(SVGInlineFlowBox* flowBox)
lineLayout.layoutCharactersInTextBoxes(flowBox);
m_inPathLayout = true;
+ // Do we need to add a LineLayoutSVGTextPath class to handle this logic?
+ // I'd imagine it'd only have 2 methods, startOffset() and layoutPath().
LayoutSVGTextPath* textPath = &toLayoutSVGTextPath(flowBox->layoutObject());
+ // Actually, what would I do with Path here? Would we have to add a LineLayoutPath
+ // class too? And then what would we do about PositionCalculator?
+ // Does this pattern bring to mind any examples I can look at?
Path path = textPath->layoutPath();
if (path.isEmpty())
return;
@@ -192,7 +197,7 @@ void SVGTextLayoutEngine::beginTextPathLayout(SVGInlineFlowBox* flowBox)
SVGLengthAdjustType lengthAdjust = SVGLengthAdjustUnknown;
float desiredTextLength = 0;
- if (SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromLayoutObject(textPath)) {
+ if (SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromLayoutObject(flowBox->lineLayoutItem())) {
SVGLengthContext lengthContext(textContentElement);
lengthAdjust = textContentElement->lengthAdjust()->currentValue()->enumValue();
if (textContentElement->textLengthIsSpecifiedByUser())
@@ -246,7 +251,7 @@ void SVGTextLayoutEngine::layoutInlineTextBox(SVGInlineTextBox* textBox)
static bool definesTextLengthWithSpacing(const InlineFlowBox* start)
{
- SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromLayoutObject(&start->layoutObject());
+ SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromLayoutObject(start->lineLayoutItem());
return textContentElement
&& textContentElement->lengthAdjust()->currentValue()->enumValue() == SVGLengthAdjustSpacing
&& textContentElement->textLengthIsSpecifiedByUser();

Powered by Google App Engine
This is Rietveld 408576698