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

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: Final patch 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 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 } 898 }
899 899
900 inline void Node::lazyReattachIfAttached() 900 inline void Node::lazyReattachIfAttached()
901 { 901 {
902 if (attached()) 902 if (attached())
903 lazyReattach(); 903 lazyReattach();
904 } 904 }
905 905
906 inline void Node::lazyReattach(ShouldSetAttached shouldSetAttached) 906 inline void Node::lazyReattach(ShouldSetAttached shouldSetAttached)
907 { 907 {
908 AttachContext context;
909 context.performingReattach = true;
910
908 if (attached()) 911 if (attached())
909 detach(); 912 detach(context);
910 lazyAttach(shouldSetAttached); 913 lazyAttach(shouldSetAttached);
911 } 914 }
912 915
913 // Need a template since ElementShadow is not a Node, but has the style recalc m ethods. 916 // Need a template since ElementShadow is not a Node, but has the style recalc m ethods.
914 template<class T> 917 template<class T>
915 inline bool shouldRecalcStyle(Node::StyleChange change, const T* node) 918 inline bool shouldRecalcStyle(Node::StyleChange change, const T* node)
916 { 919 {
917 return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->nee dsStyleRecalc(); 920 return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->nee dsStyleRecalc();
918 } 921 }
919 922
920 } //namespace 923 } //namespace
921 924
922 #ifndef NDEBUG 925 #ifndef NDEBUG
923 // Outside the WebCore namespace for ease of invocation from gdb. 926 // Outside the WebCore namespace for ease of invocation from gdb.
924 void showTree(const WebCore::Node*); 927 void showTree(const WebCore::Node*);
925 void showNodePath(const WebCore::Node*); 928 void showNodePath(const WebCore::Node*);
926 #endif 929 #endif
927 930
928 #endif 931 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698