OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
6 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 6 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
9 * Copyright (C) 2012 Google Inc. | 9 * Copyright (C) 2012 Google Inc. |
10 * | 10 * |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 | 28 |
29 #include "core/rendering/svg/RenderSVGText.h" | 29 #include "core/rendering/svg/RenderSVGText.h" |
30 | 30 |
31 #include "core/rendering/HitTestRequest.h" | 31 #include "core/rendering/HitTestRequest.h" |
32 #include "core/rendering/HitTestResult.h" | 32 #include "core/rendering/HitTestResult.h" |
33 #include "core/rendering/LayoutRepainter.h" | 33 #include "core/rendering/LayoutRepainter.h" |
34 #include "core/rendering/PointerEventsHitRules.h" | 34 #include "core/rendering/PointerEventsHitRules.h" |
35 #include "core/rendering/style/ShadowList.h" | 35 #include "core/rendering/style/ShadowList.h" |
| 36 #include "core/rendering/svg/RenderSVGInline.h" |
36 #include "core/rendering/svg/RenderSVGInlineText.h" | 37 #include "core/rendering/svg/RenderSVGInlineText.h" |
37 #include "core/rendering/svg/RenderSVGResource.h" | 38 #include "core/rendering/svg/RenderSVGResource.h" |
38 #include "core/rendering/svg/RenderSVGRoot.h" | 39 #include "core/rendering/svg/RenderSVGRoot.h" |
39 #include "core/rendering/svg/SVGRenderSupport.h" | 40 #include "core/rendering/svg/SVGRenderSupport.h" |
40 #include "core/rendering/svg/SVGResourcesCache.h" | 41 #include "core/rendering/svg/SVGResourcesCache.h" |
41 #include "core/rendering/svg/SVGRootInlineBox.h" | 42 #include "core/rendering/svg/SVGRootInlineBox.h" |
42 #include "core/rendering/svg/SVGTextRunRenderingContext.h" | 43 #include "core/rendering/svg/SVGTextRunRenderingContext.h" |
43 #include "core/svg/SVGLengthList.h" | 44 #include "core/svg/SVGLengthList.h" |
44 #include "core/svg/SVGTextElement.h" | 45 #include "core/svg/SVGTextElement.h" |
45 #include "core/svg/SVGTransformList.h" | 46 #include "core/svg/SVGTransformList.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 101 } |
101 | 102 |
102 static inline void collectLayoutAttributes(RenderObject* text, Vector<SVGTextLay
outAttributes*>& attributes) | 103 static inline void collectLayoutAttributes(RenderObject* text, Vector<SVGTextLay
outAttributes*>& attributes) |
103 { | 104 { |
104 for (RenderObject* descendant = text; descendant; descendant = descendant->n
extInPreOrder(text)) { | 105 for (RenderObject* descendant = text; descendant; descendant = descendant->n
extInPreOrder(text)) { |
105 if (descendant->isSVGInlineText()) | 106 if (descendant->isSVGInlineText()) |
106 attributes.append(toRenderSVGInlineText(descendant)->layoutAttribute
s()); | 107 attributes.append(toRenderSVGInlineText(descendant)->layoutAttribute
s()); |
107 } | 108 } |
108 } | 109 } |
109 | 110 |
110 static inline bool findPreviousAndNextAttributes(RenderObject* root, RenderSVGIn
lineText* locateElement, SVGTextLayoutAttributes*& previous, SVGTextLayoutAttrib
utes*& next) | 111 static inline bool findPreviousAndNextAttributes(RenderSVGText* root, RenderSVGI
nlineText* locateElement, SVGTextLayoutAttributes*& previous, SVGTextLayoutAttri
butes*& next) |
111 { | 112 { |
112 ASSERT(root); | 113 ASSERT(root); |
113 ASSERT(locateElement); | 114 ASSERT(locateElement); |
114 bool stopAfterNext = false; | 115 bool stopAfterNext = false; |
115 RenderObject* current = root->firstChild(); | 116 RenderObject* current = root->firstChild(); |
116 while (current) { | 117 while (current) { |
117 if (current->isSVGInlineText()) { | 118 if (current->isSVGInlineText()) { |
118 RenderSVGInlineText* text = toRenderSVGInlineText(current); | 119 RenderSVGInlineText* text = toRenderSVGInlineText(current); |
119 if (locateElement != text) { | 120 if (locateElement != text) { |
120 if (stopAfterNext) { | 121 if (stopAfterNext) { |
121 next = text->layoutAttributes(); | 122 next = text->layoutAttributes(); |
122 return true; | 123 return true; |
123 } | 124 } |
124 | 125 |
125 previous = text->layoutAttributes(); | 126 previous = text->layoutAttributes(); |
126 } else { | 127 } else { |
127 stopAfterNext = true; | 128 stopAfterNext = true; |
128 } | 129 } |
129 } else if (current->isSVGInline()) { | 130 } else if (current->isSVGInline()) { |
130 // Descend into text content (if possible). | 131 // Descend into text content (if possible). |
131 if (RenderObject* child = current->firstChild()) { | 132 if (RenderObject* child = toRenderSVGInline(current)->firstChild())
{ |
132 current = child; | 133 current = child; |
133 continue; | 134 continue; |
134 } | 135 } |
135 } | 136 } |
136 | 137 |
137 current = current->nextInPreOrderAfterChildren(root); | 138 current = current->nextInPreOrderAfterChildren(root); |
138 } | 139 } |
139 return false; | 140 return false; |
140 } | 141 } |
141 | 142 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 return 0; | 543 return 0; |
543 } | 544 } |
544 | 545 |
545 // Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Styl
e | 546 // Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Styl
e |
546 // in a SVG text element context. | 547 // in a SVG text element context. |
547 void RenderSVGText::updateFirstLetter() | 548 void RenderSVGText::updateFirstLetter() |
548 { | 549 { |
549 } | 550 } |
550 | 551 |
551 } | 552 } |
OLD | NEW |