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

Side by Side Diff: Source/core/rendering/RenderBox.h

Issue 637033003: [CSS Grid Layout] Fix positioned grid children position and size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove "if else" Created 6 years, 1 month 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
OLDNEW
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
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698