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

Side by Side Diff: Source/core/layout/line/EllipsisBox.h

Issue 1043643002: Switch line layout to LayoutUnit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More TestExpectations tweaks Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #ifndef EllipsisBox_h 20 #ifndef EllipsisBox_h
21 #define EllipsisBox_h 21 #define EllipsisBox_h
22 22
23 #include "core/layout/line/FloatToLayoutUnit.h"
24 #include "core/layout/line/InlineBox.h" 23 #include "core/layout/line/InlineBox.h"
25 24
26 namespace blink { 25 namespace blink {
27 26
28 class HitTestRequest; 27 class HitTestRequest;
29 class HitTestResult; 28 class HitTestResult;
30 29
31 class EllipsisBox final : public InlineBox { 30 class EllipsisBox final : public InlineBox {
32 public: 31 public:
33 EllipsisBox(LayoutObject& obj, const AtomicString& ellipsisStr, InlineFlowBo x* parent, 32 EllipsisBox(LayoutObject& obj, const AtomicString& ellipsisStr, InlineFlowBo x* parent,
34 int width, int height, int x, int y, bool firstLine, bool isVertical) 33 int width, int height, int x, int y, bool firstLine, bool isVertical)
35 : InlineBox(obj, FloatPointWillBeLayoutPoint(x, y), width, firstLine, tr ue, false, false, isVertical, 0, 0, parent) 34 : InlineBox(obj, LayoutPoint(x, y), width, firstLine, true, false, false , isVertical, 0, 0, parent)
36 , m_height(height) 35 , m_height(height)
37 , m_str(ellipsisStr) 36 , m_str(ellipsisStr)
38 , m_selectionState(LayoutObject::SelectionNone) 37 , m_selectionState(LayoutObject::SelectionNone)
39 { 38 {
40 setHasVirtualLogicalHeight(); 39 setHasVirtualLogicalHeight();
41 } 40 }
42 41
43 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override; 42 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override;
44 virtual bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInCo ntainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit li neBottom) override; 43 virtual bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInCo ntainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit li neBottom) override;
45 void setSelectionState(LayoutObject::SelectionState s) { m_selectionState = s; } 44 void setSelectionState(LayoutObject::SelectionState s) { m_selectionState = s; }
46 IntRect selectionRect(); 45 IntRect selectionRect();
47 46
48 virtual FloatWillBeLayoutUnit virtualLogicalHeight() const override { return m_height; } 47 virtual LayoutUnit virtualLogicalHeight() const override { return m_height; }
49 virtual LayoutObject::SelectionState selectionState() const override { retur n m_selectionState; } 48 virtual LayoutObject::SelectionState selectionState() const override { retur n m_selectionState; }
50 const AtomicString& ellipsisStr() { return m_str; } 49 const AtomicString& ellipsisStr() { return m_str; }
51 50
52 virtual const char* boxName() const override; 51 virtual const char* boxName() const override;
53 52
54 private: 53 private:
55 54
56 int m_height; 55 int m_height;
57 AtomicString m_str; 56 AtomicString m_str;
58 LayoutObject::SelectionState m_selectionState; 57 LayoutObject::SelectionState m_selectionState;
59 }; 58 };
60 59
61 } // namespace blink 60 } // namespace blink
62 61
63 #endif // EllipsisBox_h 62 #endif // EllipsisBox_h
OLDNEW
« no previous file with comments | « Source/core/layout/line/AbstractInlineTextBox.cpp ('k') | Source/core/layout/line/EllipsisBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698