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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 2430663002: [css-grid] Use firstInFlowChildBox API for iterate over the grid items (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 PaintLayerType layerTypeRequired() const override; 201 PaintLayerType layerTypeRequired() const override;
202 202
203 bool backgroundIsKnownToBeOpaqueInRect( 203 bool backgroundIsKnownToBeOpaqueInRect(
204 const LayoutRect& localRect) const override; 204 const LayoutRect& localRect) const override;
205 205
206 virtual bool backgroundShouldAlwaysBeClipped() const { return false; } 206 virtual bool backgroundShouldAlwaysBeClipped() const { return false; }
207 207
208 // Use this with caution! No type checking is done! 208 // Use this with caution! No type checking is done!
209 LayoutBox* firstChildBox() const; 209 LayoutBox* firstChildBox() const;
210 LayoutBox* firstInFlowChildBox() const;
210 LayoutBox* lastChildBox() const; 211 LayoutBox* lastChildBox() const;
211 212
212 int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); } 213 int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
213 int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); } 214 int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
214 215
215 void setX(LayoutUnit x) { 216 void setX(LayoutUnit x) {
216 if (x == m_frameRect.x()) 217 if (x == m_frameRect.x())
217 return; 218 return;
218 m_frameRect.setX(x); 219 m_frameRect.setX(x);
219 frameRectChanged(); 220 frameRectChanged();
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 LayoutBox* next = nextSiblingBox(); 1569 LayoutBox* next = nextSiblingBox();
1569 while (next && next->isOutOfFlowPositioned()) 1570 while (next && next->isOutOfFlowPositioned())
1570 next = next->nextSiblingBox(); 1571 next = next->nextSiblingBox();
1571 return next; 1572 return next;
1572 } 1573 }
1573 1574
1574 inline LayoutBox* LayoutBox::parentBox() const { 1575 inline LayoutBox* LayoutBox::parentBox() const {
1575 return toLayoutBox(parent()); 1576 return toLayoutBox(parent());
1576 } 1577 }
1577 1578
1579 inline LayoutBox* LayoutBox::firstInFlowChildBox() const {
1580 LayoutBox* first = firstChildBox();
1581 while (first && first->isOutOfFlowPositioned())
1582 first = first->nextInFlowSiblingBox();
Manuel Rego 2016/10/18 20:59:28 I know I'm late but I think you don't need a loop
jfernandez 2016/10/18 22:25:05 You are right, indeed. I can do that ASAP in a dif
1583 return first;
1584 }
1585
1578 inline LayoutBox* LayoutBox::firstChildBox() const { 1586 inline LayoutBox* LayoutBox::firstChildBox() const {
1579 return toLayoutBox(slowFirstChild()); 1587 return toLayoutBox(slowFirstChild());
1580 } 1588 }
1581 1589
1582 inline LayoutBox* LayoutBox::lastChildBox() const { 1590 inline LayoutBox* LayoutBox::lastChildBox() const {
1583 return toLayoutBox(slowLastChild()); 1591 return toLayoutBox(slowLastChild());
1584 } 1592 }
1585 1593
1586 inline LayoutBox* LayoutBox::previousSiblingMultiColumnBox() const { 1594 inline LayoutBox* LayoutBox::previousSiblingMultiColumnBox() const {
1587 ASSERT(isLayoutMultiColumnSpannerPlaceholder() || isLayoutMultiColumnSet()); 1595 ASSERT(isLayoutMultiColumnSpannerPlaceholder() || isLayoutMultiColumnSet());
(...skipping 25 matching lines...) Expand all
1613 1621
1614 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) { 1622 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) {
1615 return breakValue == BreakColumn || breakValue == BreakLeft || 1623 return breakValue == BreakColumn || breakValue == BreakLeft ||
1616 breakValue == BreakPage || breakValue == BreakRecto || 1624 breakValue == BreakPage || breakValue == BreakRecto ||
1617 breakValue == BreakRight || breakValue == BreakVerso; 1625 breakValue == BreakRight || breakValue == BreakVerso;
1618 } 1626 }
1619 1627
1620 } // namespace blink 1628 } // namespace blink
1621 1629
1622 #endif // LayoutBox_h 1630 #endif // LayoutBox_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698