Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 FloatQuad absoluteContentQuad() const; | 176 FloatQuad absoluteContentQuad() const; |
| 177 | 177 |
| 178 // This returns the content area of the box (excluding padding and border). The only difference with contentBoxRect is that computedCSSContentBoxRect | 178 // This returns the content area of the box (excluding padding and border). The only difference with contentBoxRect is that computedCSSContentBoxRect |
| 179 // does include the intrinsic padding in the content box as this is what som e callers expect (like getComputedStyle). | 179 // does include the intrinsic padding in the content box as this is what som e callers expect (like getComputedStyle). |
| 180 LayoutRect computedCSSContentBoxRect() const { return LayoutRect(borderLeft( ) + computedCSSPaddingLeft(), borderTop() + computedCSSPaddingTop(), clientWidth () - computedCSSPaddingLeft() - computedCSSPaddingRight(), clientHeight() - comp utedCSSPaddingTop() - computedCSSPaddingBottom()); } | 180 LayoutRect computedCSSContentBoxRect() const { return LayoutRect(borderLeft( ) + computedCSSPaddingLeft(), borderTop() + computedCSSPaddingTop(), clientWidth () - computedCSSPaddingLeft() - computedCSSPaddingRight(), clientHeight() - comp utedCSSPaddingTop() - computedCSSPaddingBottom()); } |
| 181 | 181 |
| 182 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset) const override; | 182 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset) const override; |
| 183 | 183 |
| 184 // Use this with caution! No type checking is done! | 184 // Use this with caution! No type checking is done! |
| 185 RenderBox* previousSiblingBox() const; | 185 RenderBox* previousSiblingBox() const; |
| 186 RenderBox* previousInFlowSiblingBox() const; | |
| 186 RenderBox* nextSiblingBox() const; | 187 RenderBox* nextSiblingBox() const; |
| 188 RenderBox* nextInFlowSiblingBox() const; | |
| 187 RenderBox* parentBox() const; | 189 RenderBox* parentBox() const; |
| 188 | 190 |
| 189 bool canResize() const; | 191 bool canResize() const; |
| 190 | 192 |
| 191 // Visual and layout overflow are in the coordinate space of the box. This means that they aren't purely physical directions. | 193 // Visual and layout overflow are in the coordinate space of the box. This means that they aren't purely physical directions. |
| 192 // For horizontal-tb and vertical-lr they will match physical directions, bu t for horizontal-bt and vertical-rl, the top/bottom and left/right | 194 // For horizontal-tb and vertical-lr they will match physical directions, bu t for horizontal-bt and vertical-rl, the top/bottom and left/right |
| 193 // respectively are flipped when compared to their physical counterparts. F or example minX is on the left in vertical-lr, | 195 // respectively are flipped when compared to their physical counterparts. F or example minX is on the left in vertical-lr, |
| 194 // but it is on the right in vertical-rl. | 196 // but it is on the right in vertical-rl. |
| 195 LayoutRect noOverflowRect() const; | 197 LayoutRect noOverflowRect() const; |
| 196 LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layo utOverflowRect() : noOverflowRect(); } | 198 LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layo utOverflowRect() : noOverflowRect(); } |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 767 OwnPtr<RenderBoxRareData> m_rareData; | 769 OwnPtr<RenderBoxRareData> m_rareData; |
| 768 }; | 770 }; |
| 769 | 771 |
| 770 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBox, isBox()); | 772 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBox, isBox()); |
| 771 | 773 |
| 772 inline RenderBox* RenderBox::previousSiblingBox() const | 774 inline RenderBox* RenderBox::previousSiblingBox() const |
| 773 { | 775 { |
| 774 return toRenderBox(previousSibling()); | 776 return toRenderBox(previousSibling()); |
| 775 } | 777 } |
| 776 | 778 |
| 779 inline RenderBox* RenderBox::previousInFlowSiblingBox() const | |
| 780 { | |
| 781 RenderBox* previous; | |
| 782 for (previous = previousSiblingBox(); previous && previous->isOutOfFlowPosit ioned(); previous = previous->previousSiblingBox()) { } | |
|
Julien - ping for review
2014/11/24 21:44:40
Nit: I prefer 2 lines to abide by Blink's 1 statem
Manuel Rego
2014/12/01 11:10:37
I've changed it for a while,
which probably makes
| |
| 783 return previous; | |
| 784 } | |
| 785 | |
| 777 inline RenderBox* RenderBox::nextSiblingBox() const | 786 inline RenderBox* RenderBox::nextSiblingBox() const |
| 778 { | 787 { |
| 779 return toRenderBox(nextSibling()); | 788 return toRenderBox(nextSibling()); |
| 780 } | 789 } |
| 781 | 790 |
| 791 inline RenderBox* RenderBox::nextInFlowSiblingBox() const | |
| 792 { | |
| 793 RenderBox* next; | |
| 794 for (next = nextSiblingBox(); next && next->isOutOfFlowPositioned(); next = next->nextSiblingBox()) { } | |
|
Julien - ping for review
2014/11/24 21:44:40
Ditto.
Manuel Rego
2014/12/01 11:10:37
Acknowledged.
| |
| 795 return next; | |
| 796 } | |
| 797 | |
| 782 inline RenderBox* RenderBox::parentBox() const | 798 inline RenderBox* RenderBox::parentBox() const |
| 783 { | 799 { |
| 784 return toRenderBox(parent()); | 800 return toRenderBox(parent()); |
| 785 } | 801 } |
| 786 | 802 |
| 787 inline RenderBox* RenderBox::firstChildBox() const | 803 inline RenderBox* RenderBox::firstChildBox() const |
| 788 { | 804 { |
| 789 return toRenderBox(slowFirstChild()); | 805 return toRenderBox(slowFirstChild()); |
| 790 } | 806 } |
| 791 | 807 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 805 if (UNLIKELY(inlineBoxWrapper() != 0)) | 821 if (UNLIKELY(inlineBoxWrapper() != 0)) |
| 806 deleteLineBoxWrapper(); | 822 deleteLineBoxWrapper(); |
| 807 } | 823 } |
| 808 | 824 |
| 809 ensureRareData().m_inlineBoxWrapper = boxWrapper; | 825 ensureRareData().m_inlineBoxWrapper = boxWrapper; |
| 810 } | 826 } |
| 811 | 827 |
| 812 } // namespace blink | 828 } // namespace blink |
| 813 | 829 |
| 814 #endif // RenderBox_h | 830 #endif // RenderBox_h |
| OLD | NEW |