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

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

Issue 143873016: Implement style invalidation tree walk for targeted style recalc upon class change. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge. Created 6 years, 10 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 void clearChildNeedsStyleRecalc() { clearFlag(ChildNeedsStyleRecalcFlag); } 364 void clearChildNeedsStyleRecalc() { clearFlag(ChildNeedsStyleRecalcFlag); }
365 365
366 void setNeedsStyleRecalc(StyleChangeType = SubtreeStyleChange, StyleChangeSo urce = StyleChangeFromCSS); 366 void setNeedsStyleRecalc(StyleChangeType = SubtreeStyleChange, StyleChangeSo urce = StyleChangeFromCSS);
367 void clearNeedsStyleRecalc(); 367 void clearNeedsStyleRecalc();
368 368
369 bool childNeedsDistributionRecalc() const { return getFlag(ChildNeedsDistrib utionRecalc); } 369 bool childNeedsDistributionRecalc() const { return getFlag(ChildNeedsDistrib utionRecalc); }
370 void setChildNeedsDistributionRecalc() { setFlag(ChildNeedsDistributionReca lc); } 370 void setChildNeedsDistributionRecalc() { setFlag(ChildNeedsDistributionReca lc); }
371 void clearChildNeedsDistributionRecalc() { clearFlag(ChildNeedsDistribution Recalc); } 371 void clearChildNeedsDistributionRecalc() { clearFlag(ChildNeedsDistribution Recalc); }
372 void markAncestorsWithChildNeedsDistributionRecalc(); 372 void markAncestorsWithChildNeedsDistributionRecalc();
373 373
374 bool childNeedsStyleInvalidation() const { return getFlag(ChildNeedsStyleInv alidation); }
375 void setChildNeedsStyleInvalidation() { setFlag(ChildNeedsStyleInvalidation ); }
376 void clearChildNeedsStyleInvalidation() { clearFlag(ChildNeedsStyleInvalida tion); }
377 void markAncestorsWithChildNeedsStyleInvalidation();
378 bool needsStyleInvalidation() { return getFlag(NeedsStyleInvalidation); }
379 void setNeedsStyleInvalidation();
380
374 void recalcDistribution(); 381 void recalcDistribution();
375 382
376 bool shouldNotifyRendererWithIdenticalStyles() const { return getFlag(Notify RendererWithIdenticalStyles); } 383 bool shouldNotifyRendererWithIdenticalStyles() const { return getFlag(Notify RendererWithIdenticalStyles); }
377 384
378 void setIsLink(bool f); 385 void setIsLink(bool f);
379 386
380 void setInNamedFlow() { setFlag(InNamedFlowFlag); } 387 void setInNamedFlow() { setFlag(InNamedFlowFlag); }
381 void clearInNamedFlow() { clearFlag(InNamedFlowFlag); } 388 void clearInNamedFlow() { clearFlag(InNamedFlowFlag); }
382 389
383 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil dFlag); } 390 bool hasScopedHTMLStyleChild() const { return getFlag(HasScopedHTMLStyleChil dFlag); }
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 HasEventTargetDataFlag = 1 << 22, 714 HasEventTargetDataFlag = 1 << 22,
708 V8CollectableDuringMinorGCFlag = 1 << 23, 715 V8CollectableDuringMinorGCFlag = 1 << 23,
709 IsInsertionPointFlag = 1 << 24, 716 IsInsertionPointFlag = 1 << 24,
710 IsInShadowTreeFlag = 1 << 25, 717 IsInShadowTreeFlag = 1 << 25,
711 718
712 NotifyRendererWithIdenticalStyles = 1 << 26, 719 NotifyRendererWithIdenticalStyles = 1 << 26,
713 720
714 CustomElement = 1 << 27, 721 CustomElement = 1 << 27,
715 CustomElementUpgraded = 1 << 28, 722 CustomElementUpgraded = 1 << 28,
716 723
724 ChildNeedsStyleInvalidation = 1 << 29,
725 NeedsStyleInvalidation = 1 << 30,
726
717 DefaultNodeFlags = IsParsingChildrenFinishedFlag | ChildNeedsStyleRecalc Flag | NeedsReattachStyleChange 727 DefaultNodeFlags = IsParsingChildrenFinishedFlag | ChildNeedsStyleRecalc Flag | NeedsReattachStyleChange
718 }; 728 };
719 729
720 // 4 bits remaining. 730 // 1 bit remaining.
721 731
722 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } 732 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
723 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m ask) | (-(int32_t)f & mask); } 733 void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~m ask) | (-(int32_t)f & mask); }
724 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; } 734 void setFlag(NodeFlags mask) const { m_nodeFlags |= mask; }
725 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; } 735 void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; }
726 736
727 protected: 737 protected:
728 enum ConstructionType { 738 enum ConstructionType {
729 CreateOther = DefaultNodeFlags, 739 CreateOther = DefaultNodeFlags,
730 CreateText = DefaultNodeFlags | IsTextFlag, 740 CreateText = DefaultNodeFlags | IsTextFlag,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 912
903 } // namespace WebCore 913 } // namespace WebCore
904 914
905 #ifndef NDEBUG 915 #ifndef NDEBUG
906 // Outside the WebCore namespace for ease of invocation from gdb. 916 // Outside the WebCore namespace for ease of invocation from gdb.
907 void showTree(const WebCore::Node*); 917 void showTree(const WebCore::Node*);
908 void showNodePath(const WebCore::Node*); 918 void showNodePath(const WebCore::Node*);
909 #endif 919 #endif
910 920
911 #endif 921 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698