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

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

Issue 1082273004: Fix crash when removing layout managers. (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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 box->layoutIfNeeded(); 957 box->layoutIfNeeded();
958 } 958 }
959 959
960 LayoutCallback* Element::layoutManager() const 960 LayoutCallback* Element::layoutManager() const
961 { 961 {
962 return m_layoutManager.get(); 962 return m_layoutManager.get();
963 } 963 }
964 964
965 void Element::setLayoutManager(PassOwnPtr<LayoutCallback> callback) 965 void Element::setLayoutManager(PassOwnPtr<LayoutCallback> callback)
966 { 966 {
967 if (renderer() && !renderer()->isRenderCustomLayout()) { 967 bool isAlreadyCustomLayout = renderer() && renderer()->isRenderCustomLayout( );
Hixie 2015/04/14 20:53:38 Shouldn't this be checking callback != m_layoutMan
ojan 2015/04/14 20:55:05 Hmmm...this points to a different bug. If the layo
968 bool requiresCustomLayout = callback;
969 if (requiresCustomLayout != isAlreadyCustomLayout) {
968 // We don't go through the normal reattach codepaths because 970 // We don't go through the normal reattach codepaths because
969 // those are all tied to changes to the RenderStyle. 971 // those are all tied to changes to the RenderStyle.
970 markAncestorsWithChildNeedsStyleRecalc(); 972 markAncestorsWithChildNeedsStyleRecalc();
971 detach(); 973 detach();
972 } 974 }
973 m_layoutManager = callback; 975 m_layoutManager = callback;
974 } 976 }
975 977
976 void Element::childrenChanged(const ChildrenChange& change) 978 void Element::childrenChanged(const ChildrenChange& change)
977 { 979 {
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 return false; 1644 return false;
1643 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) 1645 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue))
1644 return true; 1646 return true;
1645 // Host rules could also have effects. 1647 // Host rules could also have effects.
1646 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1648 if (ShadowRoot* shadowRoot = this->shadowRoot())
1647 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); 1649 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue);
1648 return false; 1650 return false;
1649 } 1651 }
1650 1652
1651 } // namespace blink 1653 } // 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