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

Side by Side Diff: Source/core/layout/LayoutBR.cpp

Issue 1350973003: Invalidate line break selection rects when selected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't need redundant early-out for selection rect. Created 5 years, 3 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
« no previous file with comments | « Source/core/layout/LayoutBR.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 26 matching lines...) Expand all
37 37
38 LayoutBR::LayoutBR(Node* node) 38 LayoutBR::LayoutBR(Node* node)
39 : LayoutText(node, newlineString()) 39 : LayoutText(node, newlineString())
40 { 40 {
41 } 41 }
42 42
43 LayoutBR::~LayoutBR() 43 LayoutBR::~LayoutBR()
44 { 44 {
45 } 45 }
46 46
47 LayoutRect LayoutBR::selectionRectForPaintInvalidation(const LayoutBoxModelObjec t* paintInvalidationContainer) const
48 {
49 if (!RuntimeEnabledFeatures::selectionPaintingWithoutSelectionGapsEnabled())
50 return LayoutRect();
51
52 // Although line breaks contain no actual text, if we're selected we need
53 // to return a rect that includes space to illustrate a newline.
54 return LayoutText::selectionRectForPaintInvalidation(paintInvalidationContai ner);
55 }
56
47 int LayoutBR::lineHeight(bool firstLine) const 57 int LayoutBR::lineHeight(bool firstLine) const
48 { 58 {
49 const ComputedStyle& style = styleRef(firstLine && document().styleEngine(). usesFirstLineRules()); 59 const ComputedStyle& style = styleRef(firstLine && document().styleEngine(). usesFirstLineRules());
50 return style.computedLineHeight(); 60 return style.computedLineHeight();
51 } 61 }
52 62
53 void LayoutBR::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyl e) 63 void LayoutBR::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyl e)
54 { 64 {
55 LayoutText::styleDidChange(diff, oldStyle); 65 LayoutText::styleDidChange(diff, oldStyle);
56 } 66 }
57 67
58 int LayoutBR::caretMinOffset() const 68 int LayoutBR::caretMinOffset() const
59 { 69 {
60 return 0; 70 return 0;
61 } 71 }
62 72
63 int LayoutBR::caretMaxOffset() const 73 int LayoutBR::caretMaxOffset() const
64 { 74 {
65 return 1; 75 return 1;
66 } 76 }
67 77
68 PositionWithAffinity LayoutBR::positionForPoint(const LayoutPoint&) 78 PositionWithAffinity LayoutBR::positionForPoint(const LayoutPoint&)
69 { 79 {
70 return createPositionWithAffinity(0); 80 return createPositionWithAffinity(0);
71 } 81 }
72 82
73 } // namespace blink 83 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBR.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698