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

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

Issue 1183003003: Move overflow in InlineTextBox::adjustPosition() if it has glyph overflows (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add comments 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, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights reserved.
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 virtual ~InlineBox(); 69 virtual ~InlineBox();
70 70
71 virtual void destroy(); 71 virtual void destroy();
72 72
73 virtual void deleteLine(); 73 virtual void deleteLine();
74 virtual void extractLine(); 74 virtual void extractLine();
75 virtual void attachLine(); 75 virtual void attachLine();
76 76
77 virtual bool isLineBreak() const { return false; } 77 virtual bool isLineBreak() const { return false; }
78 78
79 virtual void adjustPosition(LayoutUnit dx, LayoutUnit dy); 79 // These methods are called when the caller move the position of InlineBox w ithout full layout of it.
80 void adjustLogicalPosition(LayoutUnit deltaLogicalLeft, LayoutUnit deltaLogi calTop) 80 // The implementation should keep all states (e.g. position of children, ove rflow, etc.) consistent after the move.
81 { 81 virtual void move(const LayoutSize& delta);
82 if (isHorizontal()) 82 void moveInLogicalDirection(const LayoutSize& deltaInLogicalDirection) { mov e(isHorizontal() ? deltaInLogicalDirection : deltaInLogicalDirection.transposedS ize()); }
83 adjustPosition(deltaLogicalLeft, deltaLogicalTop); 83 void moveInLineDirection(LayoutUnit delta) { moveInLogicalDirection(LayoutSi ze(delta, 0)); }
Xianzhu 2015/06/16 20:43:23 Changed 0 to LayoutUnit().
84 else 84 void moveInBlockDirection(LayoutUnit delta) { moveInLogicalDirection(LayoutS ize(0, delta)); }
85 adjustPosition(deltaLogicalTop, deltaLogicalLeft);
86 }
87 void adjustLineDirectionPosition(LayoutUnit delta)
88 {
89 if (isHorizontal())
90 adjustPosition(delta, 0);
91 else
92 adjustPosition(0, delta);
93 }
94 void adjustBlockDirectionPosition(LayoutUnit delta)
95 {
96 if (isHorizontal())
97 adjustPosition(0, delta);
98 else
99 adjustPosition(delta, 0);
100 }
101 85
102 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom); 86 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom);
103 virtual bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInCo ntainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit li neBottom); 87 virtual bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInCo ntainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit li neBottom);
104 88
105 // InlineBoxes are allocated out of the rendering partition. 89 // InlineBoxes are allocated out of the rendering partition.
106 void* operator new(size_t); 90 void* operator new(size_t);
107 void operator delete(void*); 91 void operator delete(void*);
108 92
109 #ifndef NDEBUG 93 #ifndef NDEBUG
110 void showTreeForThis() const; 94 void showTreeForThis() const;
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 434
451 } // namespace blink 435 } // namespace blink
452 436
453 #ifndef NDEBUG 437 #ifndef NDEBUG
454 // Outside the WebCore namespace for ease of invocation from gdb. 438 // Outside the WebCore namespace for ease of invocation from gdb.
455 void showTree(const blink::InlineBox*); 439 void showTree(const blink::InlineBox*);
456 void showLineTree(const blink::InlineBox*); 440 void showLineTree(const blink::InlineBox*);
457 #endif 441 #endif
458 442
459 #endif // InlineBox_h 443 #endif // InlineBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698