OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/paint/SVGInlineTextBoxPainter.h" | 5 #include "core/paint/SVGInlineTextBoxPainter.h" |
6 | 6 |
7 #include "core/editing/Editor.h" | 7 #include "core/editing/Editor.h" |
8 #include "core/editing/markers/DocumentMarkerController.h" | 8 #include "core/editing/markers/DocumentMarkerController.h" |
9 #include "core/editing/markers/RenderedDocumentMarker.h" | 9 #include "core/editing/markers/RenderedDocumentMarker.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 static inline LayoutObject* findLayoutObjectDefininingTextDecoration(InlineFlowB
ox* parentBox) | 184 static inline LayoutObject* findLayoutObjectDefininingTextDecoration(InlineFlowB
ox* parentBox) |
185 { | 185 { |
186 // Lookup first layout object in parent hierarchy which has text-decoration
set. | 186 // Lookup first layout object in parent hierarchy which has text-decoration
set. |
187 LayoutObject* layoutObject = 0; | 187 LayoutObject* layoutObject = 0; |
188 while (parentBox) { | 188 while (parentBox) { |
189 layoutObject = LineLayoutAPIShim::layoutObjectFrom(parentBox->getLineLay
outItem()); | 189 layoutObject = LineLayoutAPIShim::layoutObjectFrom(parentBox->getLineLay
outItem()); |
190 | 190 |
191 if (layoutObject->style() && layoutObject->style()->textDecoration() !=
TextDecorationNone) | 191 if (layoutObject->style() && layoutObject->style()->getTextDecoration()
!= TextDecorationNone) |
192 break; | 192 break; |
193 | 193 |
194 parentBox = parentBox->parent(); | 194 parentBox = parentBox->parent(); |
195 } | 195 } |
196 | 196 |
197 ASSERT(layoutObject); | 197 ASSERT(layoutObject); |
198 return layoutObject; | 198 return layoutObject; |
199 } | 199 } |
200 | 200 |
201 // Offset from the baseline for |decoration|. Positive offsets are above the bas
eline. | 201 // Offset from the baseline for |decoration|. Positive offsets are above the bas
eline. |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 stateSaver.save(); | 496 stateSaver.save(); |
497 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); | 497 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); |
498 } | 498 } |
499 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment
(fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style); | 499 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment
(fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style); |
500 paintInfo.context.setFillColor(color); | 500 paintInfo.context.setFillColor(color); |
501 paintInfo.context.fillRect(fragmentRect); | 501 paintInfo.context.fillRect(fragmentRect); |
502 } | 502 } |
503 } | 503 } |
504 | 504 |
505 } // namespace blink | 505 } // namespace blink |
OLD | NEW |