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

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

Issue 24066002: Remove ShouldSetAttached flag to lazyAttach (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use setNeedsStyleRecalc() in HTMLFrameElementBase Created 7 years, 3 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 | « no previous file | 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 400
401 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil dFlag); } 401 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil dFlag); }
402 void setHasScopedHTMLStyleChild(bool flag) { setFlag(flag, HasScopedHTMLStyl eChildFlag); } 402 void setHasScopedHTMLStyleChild(bool flag) { setFlag(flag, HasScopedHTMLStyl eChildFlag); }
403 403
404 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } 404 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); }
405 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag ); } 405 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag ); }
406 406
407 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuri ngMinorGCFlag); } 407 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuri ngMinorGCFlag); }
408 void setV8CollectableDuringMinorGC(bool flag) { setFlag(flag, V8CollectableD uringMinorGCFlag); } 408 void setV8CollectableDuringMinorGC(bool flag) { setFlag(flag, V8CollectableD uringMinorGCFlag); }
409 409
410 enum ShouldSetAttached { 410 void lazyAttach();
411 SetAttached, 411 void lazyReattach();
412 DoNotSetAttached
413 };
414 void lazyAttach(ShouldSetAttached = SetAttached);
415 void lazyReattach(ShouldSetAttached = SetAttached);
416 412
417 virtual void setFocus(bool flag); 413 virtual void setFocus(bool flag);
418 virtual void setActive(bool flag = true, bool pause = false); 414 virtual void setActive(bool flag = true, bool pause = false);
419 virtual void setHovered(bool flag = true); 415 virtual void setHovered(bool flag = true);
420 416
421 virtual short tabIndex() const; 417 virtual short tabIndex() const;
422 418
423 virtual Node* focusDelegate(); 419 virtual Node* focusDelegate();
424 // This is called only when the node is focused. 420 // This is called only when the node is focused.
425 virtual bool shouldHaveFocusAppearance() const; 421 virtual bool shouldHaveFocusAppearance() const;
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 ASSERT(!isShadowRoot()); 902 ASSERT(!isShadowRoot());
907 return parentOrShadowHostNode(); 903 return parentOrShadowHostNode();
908 } 904 }
909 905
910 inline void Node::lazyReattachIfAttached() 906 inline void Node::lazyReattachIfAttached()
911 { 907 {
912 if (attached()) 908 if (attached())
913 lazyReattach(); 909 lazyReattach();
914 } 910 }
915 911
916 inline void Node::lazyReattach(ShouldSetAttached shouldSetAttached) 912 inline void Node::lazyReattach()
917 { 913 {
918 if (styleChangeType() == LazyAttachStyleChange) 914 if (styleChangeType() == LazyAttachStyleChange)
919 return; 915 return;
920 916
921 AttachContext context; 917 AttachContext context;
922 context.performingReattach = true; 918 context.performingReattach = true;
923 919
924 if (attached()) 920 if (attached())
925 detach(context); 921 detach(context);
926 lazyAttach(shouldSetAttached); 922 lazyAttach();
927 } 923 }
928 924
929 inline bool shouldRecalcStyle(StyleRecalcChange change, const Node* node) 925 inline bool shouldRecalcStyle(StyleRecalcChange change, const Node* node)
930 { 926 {
931 return change >= Inherit || node->childNeedsStyleRecalc() || node->needsStyl eRecalc(); 927 return change >= Inherit || node->childNeedsStyleRecalc() || node->needsStyl eRecalc();
932 } 928 }
933 929
934 } //namespace 930 } //namespace
935 931
936 #ifndef NDEBUG 932 #ifndef NDEBUG
937 // Outside the WebCore namespace for ease of invocation from gdb. 933 // Outside the WebCore namespace for ease of invocation from gdb.
938 void showTree(const WebCore::Node*); 934 void showTree(const WebCore::Node*);
939 void showNodePath(const WebCore::Node*); 935 void showNodePath(const WebCore::Node*);
940 #endif 936 #endif
941 937
942 #endif 938 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698