OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace blink { | 26 namespace blink { |
27 | 27 |
28 class HitTestResult; | 28 class HitTestResult; |
29 | 29 |
30 class EllipsisBox final : public InlineBox { | 30 class EllipsisBox final : public InlineBox { |
31 public: | 31 public: |
32 EllipsisBox(LineLayoutItem item, | 32 EllipsisBox(LineLayoutItem item, |
33 const AtomicString& ellipsisStr, | 33 const AtomicString& ellipsisStr, |
34 InlineFlowBox* parent, | 34 InlineFlowBox* parent, |
35 LayoutUnit width, | 35 LayoutUnit width, |
36 int height, | 36 LayoutUnit height, |
37 int x, | 37 LayoutPoint location, |
38 int y, | |
39 bool firstLine, | 38 bool firstLine, |
40 bool isVertical) | 39 bool isVertical) |
41 : InlineBox(item, | 40 : InlineBox(item, |
42 LayoutPoint(x, y), | 41 location, |
43 width, | 42 width, |
44 firstLine, | 43 firstLine, |
45 true, | 44 true, |
46 false, | 45 false, |
47 false, | 46 false, |
48 isVertical, | 47 isVertical, |
49 0, | 48 0, |
50 0, | 49 0, |
51 parent), | 50 parent), |
52 m_height(height), | 51 m_height(height), |
53 m_str(ellipsisStr), | 52 m_str(ellipsisStr), |
54 m_selectionState(SelectionNone) { | 53 m_selectionState(SelectionNone) { |
55 setHasVirtualLogicalHeight(); | 54 setHasVirtualLogicalHeight(); |
56 } | 55 } |
57 | 56 |
58 void paint(const PaintInfo&, | 57 void paint(const PaintInfo&, |
59 const LayoutPoint&, | 58 const LayoutPoint&, |
60 LayoutUnit lineTop, | 59 LayoutUnit lineTop, |
61 LayoutUnit lineBottom) const override; | 60 LayoutUnit lineBottom) const override; |
62 bool nodeAtPoint(HitTestResult&, | 61 bool nodeAtPoint(HitTestResult&, |
63 const HitTestLocation& locationInContainer, | 62 const HitTestLocation& locationInContainer, |
64 const LayoutPoint& accumulatedOffset, | 63 const LayoutPoint& accumulatedOffset, |
65 LayoutUnit lineTop, | 64 LayoutUnit lineTop, |
66 LayoutUnit lineBottom) override; | 65 LayoutUnit lineBottom) override; |
67 void setSelectionState(SelectionState s) { m_selectionState = s; } | 66 void setSelectionState(SelectionState s) { m_selectionState = s; } |
68 IntRect selectionRect() const; | 67 IntRect selectionRect() const; |
69 | 68 |
70 LayoutUnit virtualLogicalHeight() const override { | 69 LayoutUnit virtualLogicalHeight() const override { return m_height; } |
71 return LayoutUnit(m_height); | |
72 } | |
73 SelectionState getSelectionState() const override { return m_selectionState; } | 70 SelectionState getSelectionState() const override { return m_selectionState; } |
74 const AtomicString& ellipsisStr() const { return m_str; } | 71 const AtomicString& ellipsisStr() const { return m_str; } |
75 | 72 |
76 const char* boxName() const override; | 73 const char* boxName() const override; |
77 | 74 |
78 private: | 75 private: |
79 int m_height; | 76 LayoutUnit m_height; |
80 AtomicString m_str; | 77 AtomicString m_str; |
81 SelectionState m_selectionState; | 78 SelectionState m_selectionState; |
82 }; | 79 }; |
83 | 80 |
84 } // namespace blink | 81 } // namespace blink |
85 | 82 |
86 #endif // EllipsisBox_h | 83 #endif // EllipsisBox_h |
OLD | NEW |