Chromium Code Reviews| 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()); |
| } |