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

Side by Side Diff: sky/engine/core/rendering/RenderCustomLayout.cpp

Issue 1055263002: Make custom layout actually work. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
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
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderCustomLayout.h ('k') | sky/engine/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698