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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGTextContentElement.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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGTextContentElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 13 matching lines...) Expand all
24 #include "bindings/core/v8/ExceptionState.h" 24 #include "bindings/core/v8/ExceptionState.h"
25 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 25 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
26 #include "core/CSSPropertyNames.h" 26 #include "core/CSSPropertyNames.h"
27 #include "core/CSSValueKeywords.h" 27 #include "core/CSSValueKeywords.h"
28 #include "core/SVGNames.h" 28 #include "core/SVGNames.h"
29 #include "core/XMLNames.h" 29 #include "core/XMLNames.h"
30 #include "core/editing/FrameSelection.h" 30 #include "core/editing/FrameSelection.h"
31 #include "core/frame/LocalFrame.h" 31 #include "core/frame/LocalFrame.h"
32 #include "core/frame/UseCounter.h" 32 #include "core/frame/UseCounter.h"
33 #include "core/layout/LayoutObject.h" 33 #include "core/layout/LayoutObject.h"
34 #include "core/layout/api/LineLayoutAPIShim.h"
34 #include "core/layout/svg/SVGTextQuery.h" 35 #include "core/layout/svg/SVGTextQuery.h"
35 36
36 namespace blink { 37 namespace blink {
37 38
38 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGLengthAd justType>() 39 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGLengthAd justType>()
39 { 40 {
40 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); 41 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ());
41 if (entries.isEmpty()) { 42 if (entries.isEmpty()) {
42 entries.append(std::make_pair(SVGLengthAdjustSpacing, "spacing")); 43 entries.append(std::make_pair(SVGLengthAdjustSpacing, "spacing"));
43 entries.append(std::make_pair(SVGLengthAdjustSpacingAndGlyphs, "spacingA ndGlyphs")); 44 entries.append(std::make_pair(SVGLengthAdjustSpacingAndGlyphs, "spacingA ndGlyphs"));
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 244 }
244 245
245 bool SVGTextContentElement::selfHasRelativeLengths() const 246 bool SVGTextContentElement::selfHasRelativeLengths() const
246 { 247 {
247 // Any element of the <text> subtree is advertized as using relative lengths . 248 // Any element of the <text> subtree is advertized as using relative lengths .
248 // On any window size change, we have to relayout the text subtree, as the 249 // On any window size change, we have to relayout the text subtree, as the
249 // effective 'on-screen' font size may change. 250 // effective 'on-screen' font size may change.
250 return true; 251 return true;
251 } 252 }
252 253
253 SVGTextContentElement* SVGTextContentElement::elementFromLayoutObject(LayoutObje ct* layoutObject) 254 SVGTextContentElement* SVGTextContentElement::elementFromLayoutObject(LineLayout Item lineLayoutItem)
254 { 255 {
256 const LayoutObject* layoutObject = LineLayoutAPIShim::constLayoutObjectFrom( lineLayoutItem);
dgrogan 2016/01/23 03:34:16 This feels like a cop-out but it appears that the
255 if (!layoutObject) 257 if (!layoutObject)
256 return nullptr; 258 return nullptr;
257 259
258 if (!layoutObject->isSVGText() && !layoutObject->isSVGInline()) 260 if (!layoutObject->isSVGText() && !layoutObject->isSVGInline())
259 return nullptr; 261 return nullptr;
260 262
261 SVGElement* element = toSVGElement(layoutObject->node()); 263 SVGElement* element = toSVGElement(layoutObject->node());
262 ASSERT(element); 264 ASSERT(element);
263 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element) : 0; 265 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element) : 0;
264 } 266 }
265 267
266 } 268 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGTextContentElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698