Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 wants to move the position of In lineBox without 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); |
|
leviw_travelin_and_unemployed
2015/06/17 18:35:11
It'd be nice if this gave some context about the n
Xianzhu
2015/06/17 18:51:10
Done.
| |
| 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, LayoutUnit())); } |
|
leviw_travelin_and_unemployed
2015/06/17 18:35:11
For consistency, this should be moveInInlineDirect
Xianzhu
2015/06/17 18:51:10
Done.
| |
| 84 else | 84 void moveInBlockDirection(LayoutUnit delta) { moveInLogicalDirection(LayoutS ize(LayoutUnit(), 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 Loading... | |
| 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 |
| OLD | NEW |