| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/core/rendering/RenderCustomLayout.h" | 6 #include "sky/engine/core/rendering/RenderCustomLayout.h" |
| 7 | 7 |
| 8 #include "sky/engine/core/rendering/RenderLayer.h" | 8 #include "sky/engine/core/rendering/RenderLayer.h" |
| 9 #include "sky/engine/core/layout/LayoutCallback.h" | 9 #include "sky/engine/core/layout/LayoutCallback.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 RenderCustomLayout::RenderCustomLayout(ContainerNode* node) | 13 RenderCustomLayout::RenderCustomLayout(ContainerNode* node) |
| 14 : RenderBlock(node) | 14 : RenderBlock(node) |
| 15 { | 15 { |
| 16 } | 16 } |
| 17 | 17 |
| 18 RenderCustomLayout::~RenderCustomLayout() | 18 RenderCustomLayout::~RenderCustomLayout() |
| 19 { | 19 { |
| 20 } | 20 } |
| 21 | 21 |
| 22 void RenderCustomLayout::layout() | 22 void RenderCustomLayout::layout() |
| 23 { | 23 { |
| 24 // TODO(ojan): This should really be done by the author code, but | |
| 25 // if the author code doesn't call layout, then we won't clear the | |
| 26 // needsLayout bit and we'll assert. | |
| 27 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBo
x()) { | |
| 28 child->layoutIfNeeded(); | |
| 29 } | |
| 30 | |
| 31 ASSERT(node()->isElementNode()); | 24 ASSERT(node()->isElementNode()); |
| 32 toElement(node())->layoutManager()->handleEvent(); | 25 toElement(node())->layoutManager()->handleEvent(); |
| 33 clearNeedsLayout(); | 26 clearNeedsLayout(); |
| 34 } | 27 } |
| 35 | 28 |
| 36 const char* RenderCustomLayout::renderName() const | 29 const char* RenderCustomLayout::renderName() const |
| 37 { | 30 { |
| 38 return "RenderCustomLayout"; | 31 return "RenderCustomLayout"; |
| 39 } | 32 } |
| 40 | 33 |
| 41 } // namespace blink | 34 } // namespace blink |
| 42 | 35 |
| OLD | NEW |