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

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

Issue 16336010: Revert 150924 "Node::lazyAttach shouldn't lie about being attached" (Closed) Base URL: svn://svn.chromium.org/blink/
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 | Annotate | Revision Log
« no previous file with comments | « trunk/Source/core/dom/Element.cpp ('k') | trunk/Source/core/dom/Node.cpp » ('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 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil dFlag); } 386 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil dFlag); }
387 void setHasScopedHTMLStyleChild(bool flag) { setFlag(flag, HasScopedHTMLStyl eChildFlag); } 387 void setHasScopedHTMLStyleChild(bool flag) { setFlag(flag, HasScopedHTMLStyl eChildFlag); }
388 388
389 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } 389 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); }
390 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag ); } 390 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag ); }
391 391
392 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuri ngMinorGCFlag); } 392 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuri ngMinorGCFlag); }
393 void setV8CollectableDuringMinorGC(bool flag) { setFlag(flag, V8CollectableD uringMinorGCFlag); } 393 void setV8CollectableDuringMinorGC(bool flag) { setFlag(flag, V8CollectableD uringMinorGCFlag); }
394 394
395 void lazyAttach(); 395 enum ShouldSetAttached {
396 void lazyReattach(); 396 SetAttached,
397 DoNotSetAttached
398 };
399 void lazyAttach(ShouldSetAttached = SetAttached);
400 void lazyReattach(ShouldSetAttached = SetAttached);
397 401
398 virtual void setFocus(bool flag); 402 virtual void setFocus(bool flag);
399 virtual void setActive(bool flag = true, bool pause = false); 403 virtual void setActive(bool flag = true, bool pause = false);
400 virtual void setHovered(bool flag = true); 404 virtual void setHovered(bool flag = true);
401 405
402 virtual short tabIndex() const; 406 virtual short tabIndex() const;
403 407
404 // Whether this kind of node can receive focus by default. Most nodes are 408 // Whether this kind of node can receive focus by default. Most nodes are
405 // not focusable but some elements, such as form controls and links, are. 409 // not focusable but some elements, such as form controls and links, are.
406 virtual bool supportsFocus() const; 410 virtual bool supportsFocus() const;
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 detach(); 868 detach();
865 attach(); 869 attach();
866 } 870 }
867 871
868 inline void Node::lazyReattachIfAttached() 872 inline void Node::lazyReattachIfAttached()
869 { 873 {
870 if (attached()) 874 if (attached())
871 lazyReattach(); 875 lazyReattach();
872 } 876 }
873 877
874 inline void Node::lazyReattach() 878 inline void Node::lazyReattach(ShouldSetAttached shouldSetAttached)
875 { 879 {
876 if (attached()) 880 if (attached())
877 detach(); 881 detach();
878 lazyAttach(); 882 lazyAttach(shouldSetAttached);
879 } 883 }
880 884
881 // Need a template since ElementShadow is not a Node, but has the style recalc m ethods. 885 // Need a template since ElementShadow is not a Node, but has the style recalc m ethods.
882 template<class T> 886 template<class T>
883 inline bool shouldRecalcStyle(Node::StyleChange change, const T* node) 887 inline bool shouldRecalcStyle(Node::StyleChange change, const T* node)
884 { 888 {
885 return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->nee dsStyleRecalc(); 889 return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->nee dsStyleRecalc();
886 } 890 }
887 891
888 } //namespace 892 } //namespace
889 893
890 #ifndef NDEBUG 894 #ifndef NDEBUG
891 // Outside the WebCore namespace for ease of invocation from gdb. 895 // Outside the WebCore namespace for ease of invocation from gdb.
892 void showTree(const WebCore::Node*); 896 void showTree(const WebCore::Node*);
893 void showNodePath(const WebCore::Node*); 897 void showNodePath(const WebCore::Node*);
894 #endif 898 #endif
895 899
896 #endif 900 #endif
OLDNEW
« no previous file with comments | « trunk/Source/core/dom/Element.cpp ('k') | trunk/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698