| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 { | 79 { |
| 80 const ComputedStyle& style = parentLayoutObject.styleRef(); | 80 const ComputedStyle& style = parentLayoutObject.styleRef(); |
| 81 const SVGComputedStyle& svgStyle = style.svgStyle(); | 81 const SVGComputedStyle& svgStyle = style.svgStyle(); |
| 82 | 82 |
| 83 bool hasFill = svgStyle.hasFill(); | 83 bool hasFill = svgStyle.hasFill(); |
| 84 bool hasVisibleStroke = svgStyle.hasVisibleStroke(); | 84 bool hasVisibleStroke = svgStyle.hasVisibleStroke(); |
| 85 | 85 |
| 86 const ComputedStyle* selectionStyle = &style; | 86 const ComputedStyle* selectionStyle = &style; |
| 87 bool shouldPaintSelection = this->shouldPaintSelection(paintInfo); | 87 bool shouldPaintSelection = this->shouldPaintSelection(paintInfo); |
| 88 if (shouldPaintSelection) { | 88 if (shouldPaintSelection) { |
| 89 selectionStyle = parentLayoutObject.getCachedPseudoStyle(SELECTION); | 89 selectionStyle = parentLayoutObject.getCachedPseudoStyle(PseudoIdSelecti
on); |
| 90 if (selectionStyle) { | 90 if (selectionStyle) { |
| 91 const SVGComputedStyle& svgSelectionStyle = selectionStyle->svgStyle
(); | 91 const SVGComputedStyle& svgSelectionStyle = selectionStyle->svgStyle
(); |
| 92 | 92 |
| 93 if (!hasFill) | 93 if (!hasFill) |
| 94 hasFill = svgSelectionStyle.hasFill(); | 94 hasFill = svgSelectionStyle.hasFill(); |
| 95 if (!hasVisibleStroke) | 95 if (!hasVisibleStroke) |
| 96 hasVisibleStroke = svgSelectionStyle.hasVisibleStroke(); | 96 hasVisibleStroke = svgSelectionStyle.hasVisibleStroke(); |
| 97 } else { | 97 } else { |
| 98 selectionStyle = &style; | 98 selectionStyle = &style; |
| 99 } | 99 } |
| (...skipping 396 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 |