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

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

Issue 143983007: Remove PostAttachCallbacks and replace with something more specialized (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update Created 6 years, 9 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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 const int nodeStyleChangeShift = 14; 87 const int nodeStyleChangeShift = 14;
88 88
89 enum StyleChangeType { 89 enum StyleChangeType {
90 NoStyleChange = 0, 90 NoStyleChange = 0,
91 LocalStyleChange = 1 << nodeStyleChangeShift, 91 LocalStyleChange = 1 << nodeStyleChangeShift,
92 SubtreeStyleChange = 2 << nodeStyleChangeShift, 92 SubtreeStyleChange = 2 << nodeStyleChangeShift,
93 NeedsReattachStyleChange = 3 << nodeStyleChangeShift, 93 NeedsReattachStyleChange = 3 << nodeStyleChangeShift,
94 }; 94 };
95 95
96 // If the style change is from the renderer then we'll call setStyle on the
97 // renderer even if the style computed from CSS is identical.
98 enum StyleChangeSource {
99 StyleChangeFromCSS,
100 StyleChangeFromRenderer
101 };
102
103 class NodeRareDataBase { 96 class NodeRareDataBase {
104 public: 97 public:
105 RenderObject* renderer() const { return m_renderer; } 98 RenderObject* renderer() const { return m_renderer; }
106 void setRenderer(RenderObject* renderer) { m_renderer = renderer; } 99 void setRenderer(RenderObject* renderer) { m_renderer = renderer; }
107 100
108 protected: 101 protected:
109 NodeRareDataBase(RenderObject* renderer) 102 NodeRareDataBase(RenderObject* renderer)
110 : m_renderer(renderer) 103 : m_renderer(renderer)
111 { } 104 { }
112 105
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 bool needsStyleRecalc() const { return styleChangeType() != NoStyleChange; } 343 bool needsStyleRecalc() const { return styleChangeType() != NoStyleChange; }
351 StyleChangeType styleChangeType() const { return static_cast<StyleChangeType >(m_nodeFlags & StyleChangeMask); } 344 StyleChangeType styleChangeType() const { return static_cast<StyleChangeType >(m_nodeFlags & StyleChangeMask); }
352 bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFla g); } 345 bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFla g); }
353 bool isLink() const { return getFlag(IsLinkFlag); } 346 bool isLink() const { return getFlag(IsLinkFlag); }
354 bool isEditingText() const { return isTextNode() && getFlag(HasNameOrIsEditi ngTextFlag); } 347 bool isEditingText() const { return isTextNode() && getFlag(HasNameOrIsEditi ngTextFlag); }
355 348
356 void setHasName(bool f) { ASSERT(!isTextNode()); setFlag(f, HasNameOrIsEditi ngTextFlag); } 349 void setHasName(bool f) { ASSERT(!isTextNode()); setFlag(f, HasNameOrIsEditi ngTextFlag); }
357 void setChildNeedsStyleRecalc() { setFlag(ChildNeedsStyleRecalcFlag); } 350 void setChildNeedsStyleRecalc() { setFlag(ChildNeedsStyleRecalcFlag); }
358 void clearChildNeedsStyleRecalc() { clearFlag(ChildNeedsStyleRecalcFlag); } 351 void clearChildNeedsStyleRecalc() { clearFlag(ChildNeedsStyleRecalcFlag); }
359 352
360 void setNeedsStyleRecalc(StyleChangeType, StyleChangeSource = StyleChangeFro mCSS); 353 void setNeedsStyleRecalc(StyleChangeType);
361 void clearNeedsStyleRecalc(); 354 void clearNeedsStyleRecalc();
362 355
363 bool childNeedsDistributionRecalc() const { return getFlag(ChildNeedsDistrib utionRecalc); } 356 bool childNeedsDistributionRecalc() const { return getFlag(ChildNeedsDistrib utionRecalc); }
364 void setChildNeedsDistributionRecalc() { setFlag(ChildNeedsDistributionReca lc); } 357 void setChildNeedsDistributionRecalc() { setFlag(ChildNeedsDistributionReca lc); }
365 void clearChildNeedsDistributionRecalc() { clearFlag(ChildNeedsDistribution Recalc); } 358 void clearChildNeedsDistributionRecalc() { clearFlag(ChildNeedsDistribution Recalc); }
366 void markAncestorsWithChildNeedsDistributionRecalc(); 359 void markAncestorsWithChildNeedsDistributionRecalc();
367 360
368 bool childNeedsStyleInvalidation() const { return getFlag(ChildNeedsStyleInv alidation); } 361 bool childNeedsStyleInvalidation() const { return getFlag(ChildNeedsStyleInv alidation); }
369 void setChildNeedsStyleInvalidation() { setFlag(ChildNeedsStyleInvalidation ); } 362 void setChildNeedsStyleInvalidation() { setFlag(ChildNeedsStyleInvalidation ); }
370 void clearChildNeedsStyleInvalidation() { clearFlag(ChildNeedsStyleInvalida tion); } 363 void clearChildNeedsStyleInvalidation() { clearFlag(ChildNeedsStyleInvalida tion); }
371 void markAncestorsWithChildNeedsStyleInvalidation(); 364 void markAncestorsWithChildNeedsStyleInvalidation();
372 bool needsStyleInvalidation() { return getFlag(NeedsStyleInvalidation); } 365 bool needsStyleInvalidation() { return getFlag(NeedsStyleInvalidation); }
373 void clearNeedsStyleInvalidation() { clearFlag(NeedsStyleInvalidation); } 366 void clearNeedsStyleInvalidation() { clearFlag(NeedsStyleInvalidation); }
374 void setNeedsStyleInvalidation(); 367 void setNeedsStyleInvalidation();
375 368
376 void recalcDistribution(); 369 void recalcDistribution();
377 370
378 bool shouldNotifyRendererWithIdenticalStyles() const { return getFlag(Notify RendererWithIdenticalStyles); } 371 bool needsLayerUpdate() const { return getFlag(NeedsLayerUpdateFlag); }
372 void setNeedsLayerUpdate() { setFlag(NeedsLayerUpdateFlag); }
373 void clearNeedsLayerUpdate() { clearFlag(NeedsLayerUpdateFlag); }
379 374
380 void setIsLink(bool f); 375 void setIsLink(bool f);
381 376
382 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil dFlag); } 377 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil dFlag); }
383 void setHasScopedHTMLStyleChild(bool flag) { setFlag(flag, HasScopedHTMLStyl eChildFlag); } 378 void setHasScopedHTMLStyleChild(bool flag) { setFlag(flag, HasScopedHTMLStyl eChildFlag); }
384 379
385 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); } 380 bool hasEventTargetData() const { return getFlag(HasEventTargetDataFlag); }
386 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag ); } 381 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag ); }
387 382
388 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuri ngMinorGCFlag); } 383 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuri ngMinorGCFlag); }
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 // Bit 18 is available 700 // Bit 18 is available
706 701
707 HasSyntheticAttrChildNodesFlag = 1 << 19, 702 HasSyntheticAttrChildNodesFlag = 1 << 19,
708 HasCustomStyleCallbacksFlag = 1 << 20, 703 HasCustomStyleCallbacksFlag = 1 << 20,
709 HasScopedHTMLStyleChildFlag = 1 << 21, 704 HasScopedHTMLStyleChildFlag = 1 << 21,
710 HasEventTargetDataFlag = 1 << 22, 705 HasEventTargetDataFlag = 1 << 22,
711 V8CollectableDuringMinorGCFlag = 1 << 23, 706 V8CollectableDuringMinorGCFlag = 1 << 23,
712 IsInsertionPointFlag = 1 << 24, 707 IsInsertionPointFlag = 1 << 24,
713 IsInShadowTreeFlag = 1 << 25, 708 IsInShadowTreeFlag = 1 << 25,
714 709
715 NotifyRendererWithIdenticalStyles = 1 << 26, 710 NeedsLayerUpdateFlag = 1 << 26,
716 711
717 CustomElement = 1 << 27, 712 CustomElement = 1 << 27,
718 CustomElementUpgraded = 1 << 28, 713 CustomElementUpgraded = 1 << 28,
719 714
720 ChildNeedsStyleInvalidation = 1 << 29, 715 ChildNeedsStyleInvalidation = 1 << 29,
721 NeedsStyleInvalidation = 1 << 30, 716 NeedsStyleInvalidation = 1 << 30,
722 717
723 DefaultNodeFlags = IsFinishedParsingChildrenFlag | ChildNeedsStyleRecalc Flag | NeedsReattachStyleChange 718 DefaultNodeFlags = IsFinishedParsingChildrenFlag | ChildNeedsStyleRecalc Flag | NeedsReattachStyleChange
724 }; 719 };
725 720
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 } // namespace WebCore 903 } // namespace WebCore
909 904
910 #ifndef NDEBUG 905 #ifndef NDEBUG
911 // Outside the WebCore namespace for ease of invocation from gdb. 906 // Outside the WebCore namespace for ease of invocation from gdb.
912 void showNode(const WebCore::Node*); 907 void showNode(const WebCore::Node*);
913 void showTree(const WebCore::Node*); 908 void showTree(const WebCore::Node*);
914 void showNodePath(const WebCore::Node*); 909 void showNodePath(const WebCore::Node*);
915 #endif 910 #endif
916 911
917 #endif 912 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698