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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (m_svgInlineTextBox.getLineLayoutItem().style()->textDecorationsInEffect(
) == TextDecorationNone) | 226 if (m_svgInlineTextBox.getLineLayoutItem().style()->textDecorationsInEffect(
) == TextDecorationNone) |
227 return; | 227 return; |
228 | 228 |
229 if (fragment.width <= 0) | 229 if (fragment.width <= 0) |
230 return; | 230 return; |
231 | 231 |
232 // Find out which style defined the text-decoration, as its fill/stroke prop
erties have to be used for drawing instead of ours. | 232 // Find out which style defined the text-decoration, as its fill/stroke prop
erties have to be used for drawing instead of ours. |
233 LayoutObject* decorationLayoutObject = findLayoutObjectDefininingTextDecorat
ion(m_svgInlineTextBox.parent()); | 233 LayoutObject* decorationLayoutObject = findLayoutObjectDefininingTextDecorat
ion(m_svgInlineTextBox.parent()); |
234 const ComputedStyle& decorationStyle = decorationLayoutObject->styleRef(); | 234 const ComputedStyle& decorationStyle = decorationLayoutObject->styleRef(); |
235 | 235 |
236 if (decorationStyle.visibility() == HIDDEN) | 236 if (decorationStyle.visibility() != VISIBLE) |
237 return; | 237 return; |
238 | 238 |
239 float scalingFactor = 1; | 239 float scalingFactor = 1; |
240 Font scaledFont; | 240 Font scaledFont; |
241 LayoutSVGInlineText::computeNewScaledFontForStyle(decorationLayoutObject, sc
alingFactor, scaledFont); | 241 LayoutSVGInlineText::computeNewScaledFontForStyle(decorationLayoutObject, sc
alingFactor, scaledFont); |
242 ASSERT(scalingFactor); | 242 ASSERT(scalingFactor); |
243 | 243 |
244 float thickness = thicknessForDecoration(decoration, scaledFont); | 244 float thickness = thicknessForDecoration(decoration, scaledFont); |
245 if (thickness <= 0) | 245 if (thickness <= 0) |
246 return; | 246 return; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 stateSaver.save(); | 495 stateSaver.save(); |
496 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); | 496 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); |
497 } | 497 } |
498 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment
(fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style); | 498 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment
(fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style); |
499 paintInfo.context.setFillColor(color); | 499 paintInfo.context.setFillColor(color); |
500 paintInfo.context.fillRect(fragmentRect); | 500 paintInfo.context.fillRect(fragmentRect); |
501 } | 501 } |
502 } | 502 } |
503 | 503 |
504 } // namespace blink | 504 } // namespace blink |
OLD | NEW |