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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 1060013005: Make changing your layout manager 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
« no previous file with comments | « no previous file | sky/tests/layout/custom.sky » ('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 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 964
965 void Element::setLayoutManager(PassOwnPtr<LayoutCallback> callback) 965 void Element::setLayoutManager(PassOwnPtr<LayoutCallback> callback)
966 { 966 {
967 bool isAlreadyCustomLayout = renderer() && renderer()->isRenderCustomLayout( ); 967 bool isAlreadyCustomLayout = renderer() && renderer()->isRenderCustomLayout( );
968 bool requiresCustomLayout = callback; 968 bool requiresCustomLayout = callback;
969 if (requiresCustomLayout != isAlreadyCustomLayout) { 969 if (requiresCustomLayout != isAlreadyCustomLayout) {
970 // We don't go through the normal reattach codepaths because 970 // We don't go through the normal reattach codepaths because
971 // those are all tied to changes to the RenderStyle. 971 // those are all tied to changes to the RenderStyle.
972 markAncestorsWithChildNeedsStyleRecalc(); 972 markAncestorsWithChildNeedsStyleRecalc();
973 detach(); 973 detach();
974 } else if (callback.get() != m_layoutManager) {
975 setNeedsLayout();
974 } 976 }
975 m_layoutManager = callback; 977 m_layoutManager = callback;
976 } 978 }
977 979
978 void Element::childrenChanged(const ChildrenChange& change) 980 void Element::childrenChanged(const ChildrenChange& change)
979 { 981 {
980 ContainerNode::childrenChanged(change); 982 ContainerNode::childrenChanged(change);
981 983
982 if (ElementShadow* shadow = this->shadow()) 984 if (ElementShadow* shadow = this->shadow())
983 shadow->setNeedsDistributionRecalc(); 985 shadow->setNeedsDistributionRecalc();
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 return false; 1646 return false;
1645 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) 1647 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue))
1646 return true; 1648 return true;
1647 // Host rules could also have effects. 1649 // Host rules could also have effects.
1648 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1650 if (ShadowRoot* shadowRoot = this->shadowRoot())
1649 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); 1651 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue);
1650 return false; 1652 return false;
1651 } 1653 }
1652 1654
1653 } // namespace blink 1655 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/tests/layout/custom.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698