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

Side by Side Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Issue 1642223002: Delete selection gap code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Integrate feedback. Created 4 years, 10 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
OLDNEW
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/InlineTextBoxPainter.h" 5 #include "core/paint/InlineTextBoxPainter.h"
6 6
7 #include "core/editing/CompositionUnderline.h" 7 #include "core/editing/CompositionUnderline.h"
8 #include "core/editing/Editor.h" 8 #include "core/editing/Editor.h"
9 #include "core/editing/markers/DocumentMarkerController.h" 9 #include "core/editing/markers/DocumentMarkerController.h"
10 #include "core/editing/markers/RenderedDocumentMarker.h" 10 #include "core/editing/markers/RenderedDocumentMarker.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 bool InlineTextBoxPainter::shouldPaintTextBox(const PaintInfo& paintInfo) 251 bool InlineTextBoxPainter::shouldPaintTextBox(const PaintInfo& paintInfo)
252 { 252 {
253 // When painting selection, we want to include a highlight when the 253 // When painting selection, we want to include a highlight when the
254 // selection spans line breaks. In other cases such as invisible elements 254 // selection spans line breaks. In other cases such as invisible elements
255 // or those with no text that are not line breaks, we can skip painting 255 // or those with no text that are not line breaks, we can skip painting
256 // wholesale. 256 // wholesale.
257 // TODO(wkorman): Constrain line break painting to appropriate paint phase. 257 // TODO(wkorman): Constrain line break painting to appropriate paint phase.
258 // This code path is only called in PaintPhaseForeground whereas we would 258 // This code path is only called in PaintPhaseForeground whereas we would
259 // expect PaintPhaseSelection. The existing haveSelection logic in paint() 259 // expect PaintPhaseSelection. The existing haveSelection logic in paint()
260 // tests for != PaintPhaseTextClip. 260 // tests for != PaintPhaseTextClip.
261 bool paintLineBreaks = RuntimeEnabledFeatures::selectionPaintingWithoutSelec tionGapsEnabled(); 261 if (m_inlineTextBox.lineLayoutItem().style()->visibility() != VISIBLE
262 if ((!paintLineBreaks && m_inlineTextBox.isLineBreak())
263 || m_inlineTextBox.lineLayoutItem().style()->visibility() != VISIBLE
264 || m_inlineTextBox.truncation() == cFullTruncation 262 || m_inlineTextBox.truncation() == cFullTruncation
265 || !m_inlineTextBox.len()) 263 || !m_inlineTextBox.len())
266 return false; 264 return false;
267 return true; 265 return true;
268 } 266 }
269 267
270 unsigned InlineTextBoxPainter::underlinePaintStart(const CompositionUnderline& u nderline) 268 unsigned InlineTextBoxPainter::underlinePaintStart(const CompositionUnderline& u nderline)
271 { 269 {
272 return std::max(static_cast<unsigned>(m_inlineTextBox.start()), underline.st artOffset); 270 return std::max(static_cast<unsigned>(m_inlineTextBox.start()), underline.st artOffset);
273 } 271 }
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 867
870 Color color = LayoutTheme::theme().platformTextSearchHighlightColor(marker-> activeMatch()); 868 Color color = LayoutTheme::theme().platformTextSearchHighlightColor(marker-> activeMatch());
871 GraphicsContext& context = paintInfo.context; 869 GraphicsContext& context = paintInfo.context;
872 GraphicsContextStateSaver stateSaver(context); 870 GraphicsContextStateSaver stateSaver(context);
873 context.clip(FloatRect(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toF loat(), m_inlineTextBox.logicalWidth().toFloat(), selHeight)); 871 context.clip(FloatRect(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toF loat(), m_inlineTextBox.logicalWidth().toFloat(), selHeight));
874 context.drawHighlightForText(font, run, FloatPoint(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat()), selHeight, color, sPos, ePos); 872 context.drawHighlightForText(font, run, FloatPoint(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat()), selHeight, color, sPos, ePos);
875 } 873 }
876 874
877 875
878 } // namespace blink 876 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BlockPainter.cpp ('k') | third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698