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

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: Preserve prior LayoutBR selection rect behavior when REF is off. 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
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 // When selected we need to return a rect that includes the space
53 // highlighted to illustrate a newline.
54 return (selectionState() == SelectionNone) ? LayoutRect()
chrishtr 2015/09/18 21:08:03 Return LayoutText::selectionRectForPaintInvalidati
wkorman 2015/09/18 21:26:57 Done.
55 : LayoutText::selectionRectForPaintInvalidation(paintInvalidationContain er);
56 }
57
47 int LayoutBR::lineHeight(bool firstLine) const 58 int LayoutBR::lineHeight(bool firstLine) const
48 { 59 {
49 const ComputedStyle& style = styleRef(firstLine && document().styleEngine(). usesFirstLineRules()); 60 const ComputedStyle& style = styleRef(firstLine && document().styleEngine(). usesFirstLineRules());
50 return style.computedLineHeight(); 61 return style.computedLineHeight();
51 } 62 }
52 63
53 void LayoutBR::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyl e) 64 void LayoutBR::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyl e)
54 { 65 {
55 LayoutText::styleDidChange(diff, oldStyle); 66 LayoutText::styleDidChange(diff, oldStyle);
56 } 67 }
57 68
58 int LayoutBR::caretMinOffset() const 69 int LayoutBR::caretMinOffset() const
59 { 70 {
60 return 0; 71 return 0;
61 } 72 }
62 73
63 int LayoutBR::caretMaxOffset() const 74 int LayoutBR::caretMaxOffset() const
64 { 75 {
65 return 1; 76 return 1;
66 } 77 }
67 78
68 PositionWithAffinity LayoutBR::positionForPoint(const LayoutPoint&) 79 PositionWithAffinity LayoutBR::positionForPoint(const LayoutPoint&)
69 { 80 {
70 return createPositionWithAffinity(0); 81 return createPositionWithAffinity(0);
71 } 82 }
72 83
73 } // namespace blink 84 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698