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

Side by Side Diff: Source/core/dom/Node.h

Issue 16951003: Fix broken AttachContext from r152289 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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 /* 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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 } 904 }
905 905
906 inline void Node::lazyReattachIfAttached() 906 inline void Node::lazyReattachIfAttached()
907 { 907 {
908 if (attached()) 908 if (attached())
909 lazyReattach(); 909 lazyReattach();
910 } 910 }
911 911
912 inline void Node::lazyReattach(ShouldSetAttached shouldSetAttached) 912 inline void Node::lazyReattach(ShouldSetAttached shouldSetAttached)
913 { 913 {
914 AttachContext context;
915 context.performingReattach = true;
916
914 if (attached()) 917 if (attached())
915 detach(); 918 detach(context);
916 lazyAttach(shouldSetAttached); 919 lazyAttach(shouldSetAttached);
917 } 920 }
918 921
919 // Need a template since ElementShadow is not a Node, but has the style recalc m ethods. 922 // Need a template since ElementShadow is not a Node, but has the style recalc m ethods.
920 template<class T> 923 template<class T>
921 inline bool shouldRecalcStyle(Node::StyleChange change, const T* node) 924 inline bool shouldRecalcStyle(Node::StyleChange change, const T* node)
922 { 925 {
923 return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->nee dsStyleRecalc(); 926 return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->nee dsStyleRecalc();
924 } 927 }
925 928
926 } //namespace 929 } //namespace
927 930
928 #ifndef NDEBUG 931 #ifndef NDEBUG
929 // Outside the WebCore namespace for ease of invocation from gdb. 932 // Outside the WebCore namespace for ease of invocation from gdb.
930 void showTree(const WebCore::Node*); 933 void showTree(const WebCore::Node*);
931 void showNodePath(const WebCore::Node*); 934 void showNodePath(const WebCore::Node*);
932 #endif 935 #endif
933 936
934 #endif 937 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698