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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBox.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h
index 42c0477568ea40f5da5ff9eb8cc8cab91ddcc866..5b7bb3282d272d09eb8d18ffd85c3e88e2017090 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -207,6 +207,7 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
// Use this with caution! No type checking is done!
LayoutBox* firstChildBox() const;
+ LayoutBox* firstInFlowChildBox() const;
LayoutBox* lastChildBox() const;
int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
@@ -1575,6 +1576,13 @@ inline LayoutBox* LayoutBox::parentBox() const {
return toLayoutBox(parent());
}
+inline LayoutBox* LayoutBox::firstInFlowChildBox() const {
+ LayoutBox* first = firstChildBox();
+ while (first && first->isOutOfFlowPositioned())
+ 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
+ return first;
+}
+
inline LayoutBox* LayoutBox::firstChildBox() const {
return toLayoutBox(slowFirstChild());
}
« 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