| OLD | NEW |
| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 LayoutBR::LayoutBR(Node* node) | 37 LayoutBR::LayoutBR(Node* node) |
| 38 : LayoutText(node, newlineString()) | 38 : LayoutText(node, newlineString()) |
| 39 { | 39 { |
| 40 } | 40 } |
| 41 | 41 |
| 42 LayoutBR::~LayoutBR() | 42 LayoutBR::~LayoutBR() |
| 43 { | 43 { |
| 44 } | 44 } |
| 45 | 45 |
| 46 LayoutRect LayoutBR::selectionRectForPaintInvalidation(const LayoutBoxModelObjec
t* paintInvalidationContainer) const | |
| 47 { | |
| 48 // Although line breaks contain no actual text, if we're selected we need | |
| 49 // to return a rect that includes space to illustrate a newline. | |
| 50 return LayoutText::selectionRectForPaintInvalidation(paintInvalidationContai
ner); | |
| 51 } | |
| 52 | |
| 53 int LayoutBR::lineHeight(bool firstLine) const | 46 int LayoutBR::lineHeight(bool firstLine) const |
| 54 { | 47 { |
| 55 const ComputedStyle& style = styleRef(firstLine && document().styleEngine().
usesFirstLineRules()); | 48 const ComputedStyle& style = styleRef(firstLine && document().styleEngine().
usesFirstLineRules()); |
| 56 return style.computedLineHeight(); | 49 return style.computedLineHeight(); |
| 57 } | 50 } |
| 58 | 51 |
| 59 void LayoutBR::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyl
e) | 52 void LayoutBR::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyl
e) |
| 60 { | 53 { |
| 61 LayoutText::styleDidChange(diff, oldStyle); | 54 LayoutText::styleDidChange(diff, oldStyle); |
| 62 } | 55 } |
| 63 | 56 |
| 64 int LayoutBR::caretMinOffset() const | 57 int LayoutBR::caretMinOffset() const |
| 65 { | 58 { |
| 66 return 0; | 59 return 0; |
| 67 } | 60 } |
| 68 | 61 |
| 69 int LayoutBR::caretMaxOffset() const | 62 int LayoutBR::caretMaxOffset() const |
| 70 { | 63 { |
| 71 return 1; | 64 return 1; |
| 72 } | 65 } |
| 73 | 66 |
| 74 PositionWithAffinity LayoutBR::positionForPoint(const LayoutPoint&) | 67 PositionWithAffinity LayoutBR::positionForPoint(const LayoutPoint&) |
| 75 { | 68 { |
| 76 return createPositionWithAffinity(0); | 69 return createPositionWithAffinity(0); |
| 77 } | 70 } |
| 78 | 71 |
| 79 } // namespace blink | 72 } // namespace blink |
| OLD | NEW |