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

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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TemporaryChange -> AutoReset Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 12 matching lines...) Expand all
23 #include "core/layout/api/LineLayoutSVGTextPath.h" 23 #include "core/layout/api/LineLayoutSVGTextPath.h"
24 #include "core/layout/svg/LayoutSVGInlineText.h" 24 #include "core/layout/svg/LayoutSVGInlineText.h"
25 #include "core/layout/svg/SVGTextChunkBuilder.h" 25 #include "core/layout/svg/SVGTextChunkBuilder.h"
26 #include "core/layout/svg/SVGTextLayoutEngineBaseline.h" 26 #include "core/layout/svg/SVGTextLayoutEngineBaseline.h"
27 #include "core/layout/svg/SVGTextLayoutEngineSpacing.h" 27 #include "core/layout/svg/SVGTextLayoutEngineSpacing.h"
28 #include "core/layout/svg/line/SVGInlineFlowBox.h" 28 #include "core/layout/svg/line/SVGInlineFlowBox.h"
29 #include "core/layout/svg/line/SVGInlineTextBox.h" 29 #include "core/layout/svg/line/SVGInlineTextBox.h"
30 #include "core/svg/SVGElement.h" 30 #include "core/svg/SVGElement.h"
31 #include "core/svg/SVGLengthContext.h" 31 #include "core/svg/SVGLengthContext.h"
32 #include "core/svg/SVGTextContentElement.h" 32 #include "core/svg/SVGTextContentElement.h"
33 #include "wtf/AutoReset.h"
33 34
34 namespace blink { 35 namespace blink {
35 36
36 SVGTextLayoutEngine::SVGTextLayoutEngine(const Vector<LayoutSVGInlineText*>& des cendantTextNodes) 37 SVGTextLayoutEngine::SVGTextLayoutEngine(const Vector<LayoutSVGInlineText*>& des cendantTextNodes)
37 : m_descendantTextNodes(descendantTextNodes) 38 : m_descendantTextNodes(descendantTextNodes)
38 , m_currentLogicalTextNodeIndex(0) 39 , m_currentLogicalTextNodeIndex(0)
39 , m_logicalCharacterOffset(0) 40 , m_logicalCharacterOffset(0)
40 , m_logicalMetricsListOffset(0) 41 , m_logicalMetricsListOffset(0)
41 , m_isVerticalText(false) 42 , m_isVerticalText(false)
42 , m_inPathLayout(false) 43 , m_inPathLayout(false)
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 { 233 {
233 SVGTextContentElement* textContentElement = SVGTextContentElement::elementFr omLineLayoutItem(start->getLineLayoutItem()); 234 SVGTextContentElement* textContentElement = SVGTextContentElement::elementFr omLineLayoutItem(start->getLineLayoutItem());
234 return textContentElement 235 return textContentElement
235 && textContentElement->lengthAdjust()->currentValue()->enumValue() == SV GLengthAdjustSpacing 236 && textContentElement->lengthAdjust()->currentValue()->enumValue() == SV GLengthAdjustSpacing
236 && textContentElement->textLengthIsSpecifiedByUser(); 237 && textContentElement->textLengthIsSpecifiedByUser();
237 } 238 }
238 239
239 void SVGTextLayoutEngine::layoutCharactersInTextBoxes(InlineFlowBox* start) 240 void SVGTextLayoutEngine::layoutCharactersInTextBoxes(InlineFlowBox* start)
240 { 241 {
241 bool textLengthSpacingInEffect = m_textLengthSpacingInEffect || definesTextL engthWithSpacing(start); 242 bool textLengthSpacingInEffect = m_textLengthSpacingInEffect || definesTextL engthWithSpacing(start);
242 TemporaryChange<bool> textLengthSpacingScope(m_textLengthSpacingInEffect, te xtLengthSpacingInEffect); 243 AutoReset<bool> textLengthSpacingScope(&m_textLengthSpacingInEffect, textLen gthSpacingInEffect);
243 244
244 for (InlineBox* child = start->firstChild(); child; child = child->nextOnLin e()) { 245 for (InlineBox* child = start->firstChild(); child; child = child->nextOnLin e()) {
245 if (child->isSVGInlineTextBox()) { 246 if (child->isSVGInlineTextBox()) {
246 ASSERT(child->getLineLayoutItem().isSVGInlineText()); 247 ASSERT(child->getLineLayoutItem().isSVGInlineText());
247 layoutInlineTextBox(toSVGInlineTextBox(child)); 248 layoutInlineTextBox(toSVGInlineTextBox(child));
248 } else { 249 } else {
249 // Skip generated content. 250 // Skip generated content.
250 Node* node = child->getLineLayoutItem().node(); 251 Node* node = child->getLineLayoutItem().node();
251 if (!node) 252 if (!node)
252 continue; 253 continue;
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 } 496 }
496 497
497 if (!didStartTextFragment) 498 if (!didStartTextFragment)
498 return; 499 return;
499 500
500 // Close last open fragment, if needed. 501 // Close last open fragment, if needed.
501 recordTextFragment(textBox); 502 recordTextFragment(textBox);
502 } 503 }
503 504
504 } // namespace blink 505 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698