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

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: Fixed failing test (/fast/forms/file/input-file-re-render.html) 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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 } 907 }
908 908
909 inline void Node::lazyReattachIfAttached() 909 inline void Node::lazyReattachIfAttached()
910 { 910 {
911 if (attached()) 911 if (attached())
912 lazyReattach(); 912 lazyReattach();
913 } 913 }
914 914
915 inline void Node::lazyReattach(ShouldSetAttached shouldSetAttached) 915 inline void Node::lazyReattach(ShouldSetAttached shouldSetAttached)
916 { 916 {
917 AttachContext context;
918 context.performingReattach = true;
919
917 if (attached()) 920 if (attached())
918 detach(); 921 detach(context);
919 lazyAttach(shouldSetAttached); 922 lazyAttach(shouldSetAttached);
920 } 923 }
921 924
922 // Need a template since ElementShadow is not a Node, but has the style recalc m ethods. 925 // Need a template since ElementShadow is not a Node, but has the style recalc m ethods.
923 template<class T> 926 template<class T>
924 inline bool shouldRecalcStyle(Node::StyleChange change, const T* node) 927 inline bool shouldRecalcStyle(Node::StyleChange change, const T* node)
925 { 928 {
926 return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->nee dsStyleRecalc(); 929 return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->nee dsStyleRecalc();
927 } 930 }
928 931
929 } //namespace 932 } //namespace
930 933
931 #ifndef NDEBUG 934 #ifndef NDEBUG
932 // Outside the WebCore namespace for ease of invocation from gdb. 935 // Outside the WebCore namespace for ease of invocation from gdb.
933 void showTree(const WebCore::Node*); 936 void showTree(const WebCore::Node*);
934 void showNodePath(const WebCore::Node*); 937 void showNodePath(const WebCore::Node*);
935 #endif 938 #endif
936 939
937 #endif 940 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698