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

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

Issue 198783003: Recalc sibling styles for forward positional rules on mutations only. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issue. 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
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/dom/Element.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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl e Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl e Inc. All rights reserved.
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 ContainsFullScreenElement = 1 << 4, 83 ContainsFullScreenElement = 1 << 4,
84 IsInTopLayer = 1 << 5, 84 IsInTopLayer = 1 << 5,
85 HasPendingResources = 1 << 6, 85 HasPendingResources = 1 << 6,
86 ChildrenAffectedByFocus = 1 << 7, 86 ChildrenAffectedByFocus = 1 << 7,
87 ChildrenAffectedByHover = 1 << 8, 87 ChildrenAffectedByHover = 1 << 8,
88 ChildrenAffectedByActive = 1 << 9, 88 ChildrenAffectedByActive = 1 << 9,
89 ChildrenAffectedByDrag = 1 << 10, 89 ChildrenAffectedByDrag = 1 << 10,
90 ChildrenAffectedByFirstChildRules = 1 << 11, 90 ChildrenAffectedByFirstChildRules = 1 << 11,
91 ChildrenAffectedByLastChildRules = 1 << 12, 91 ChildrenAffectedByLastChildRules = 1 << 12,
92 ChildrenAffectedByDirectAdjacentRules = 1 << 13, 92 ChildrenAffectedByDirectAdjacentRules = 1 << 13,
93 ChildrenAffectedByForwardPositionalRules = 1 << 14, 93 ChildrenAffectedByIndirectAdjacentRules = 1 << 14,
94 ChildrenAffectedByBackwardPositionalRules = 1 << 15, 94 ChildrenAffectedByForwardPositionalRules = 1 << 15,
95 ChildrenAffectedByBackwardPositionalRules = 1 << 16,
95 96
96 // If any of these flags are set we cannot share style. 97 // If any of these flags are set we cannot share style.
97 ElementFlagsPreventingStyleSharing = 98 ElementFlagsPreventingStyleSharing =
98 ChildrenAffectedByFocus 99 ChildrenAffectedByFocus
99 | ChildrenAffectedByHover 100 | ChildrenAffectedByHover
100 | ChildrenAffectedByActive 101 | ChildrenAffectedByActive
101 | ChildrenAffectedByDrag 102 | ChildrenAffectedByDrag
102 | ChildrenAffectedByFirstChildRules 103 | ChildrenAffectedByFirstChildRules
103 | ChildrenAffectedByLastChildRules 104 | ChildrenAffectedByLastChildRules
104 | ChildrenAffectedByDirectAdjacentRules 105 | ChildrenAffectedByDirectAdjacentRules
106 | ChildrenAffectedByIndirectAdjacentRules
105 | ChildrenAffectedByForwardPositionalRules 107 | ChildrenAffectedByForwardPositionalRules
106 | ChildrenAffectedByBackwardPositionalRules, 108 | ChildrenAffectedByBackwardPositionalRules,
107 }; 109 };
108 110
109 class Element : public ContainerNode { 111 class Element : public ContainerNode {
110 public: 112 public:
111 static PassRefPtr<Element> create(const QualifiedName&, Document*); 113 static PassRefPtr<Element> create(const QualifiedName&, Document*);
112 virtual ~Element(); 114 virtual ~Element();
113 115
114 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); 116 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 379
378 bool childrenAffectedByFirstChildRules() const { return hasElementFlag(Child renAffectedByFirstChildRules); } 380 bool childrenAffectedByFirstChildRules() const { return hasElementFlag(Child renAffectedByFirstChildRules); }
379 void setChildrenAffectedByFirstChildRules() { setElementFlag(ChildrenAffecte dByFirstChildRules); } 381 void setChildrenAffectedByFirstChildRules() { setElementFlag(ChildrenAffecte dByFirstChildRules); }
380 382
381 bool childrenAffectedByLastChildRules() const { return hasElementFlag(Childr enAffectedByLastChildRules); } 383 bool childrenAffectedByLastChildRules() const { return hasElementFlag(Childr enAffectedByLastChildRules); }
382 void setChildrenAffectedByLastChildRules() { setElementFlag(ChildrenAffected ByLastChildRules); } 384 void setChildrenAffectedByLastChildRules() { setElementFlag(ChildrenAffected ByLastChildRules); }
383 385
384 bool childrenAffectedByDirectAdjacentRules() const { return hasElementFlag(C hildrenAffectedByDirectAdjacentRules); } 386 bool childrenAffectedByDirectAdjacentRules() const { return hasElementFlag(C hildrenAffectedByDirectAdjacentRules); }
385 void setChildrenAffectedByDirectAdjacentRules() { setElementFlag(ChildrenAff ectedByDirectAdjacentRules); } 387 void setChildrenAffectedByDirectAdjacentRules() { setElementFlag(ChildrenAff ectedByDirectAdjacentRules); }
386 388
389 bool childrenAffectedByIndirectAdjacentRules() const { return hasElementFlag (ChildrenAffectedByIndirectAdjacentRules); }
390 void setChildrenAffectedByIndirectAdjacentRules() { setElementFlag(ChildrenA ffectedByIndirectAdjacentRules); }
391
387 bool childrenAffectedByForwardPositionalRules() const { return hasElementFla g(ChildrenAffectedByForwardPositionalRules); } 392 bool childrenAffectedByForwardPositionalRules() const { return hasElementFla g(ChildrenAffectedByForwardPositionalRules); }
388 void setChildrenAffectedByForwardPositionalRules() { setElementFlag(Children AffectedByForwardPositionalRules); } 393 void setChildrenAffectedByForwardPositionalRules() { setElementFlag(Children AffectedByForwardPositionalRules); }
389 394
390 bool childrenAffectedByBackwardPositionalRules() const { return hasElementFl ag(ChildrenAffectedByBackwardPositionalRules); } 395 bool childrenAffectedByBackwardPositionalRules() const { return hasElementFl ag(ChildrenAffectedByBackwardPositionalRules); }
391 void setChildrenAffectedByBackwardPositionalRules() { setElementFlag(Childre nAffectedByBackwardPositionalRules); } 396 void setChildrenAffectedByBackwardPositionalRules() { setElementFlag(Childre nAffectedByBackwardPositionalRules); }
392 397
393 void setIsInCanvasSubtree(bool value) { setElementFlag(IsInCanvasSubtree, va lue); } 398 void setIsInCanvasSubtree(bool value) { setElementFlag(IsInCanvasSubtree, va lue); }
394 bool isInCanvasSubtree() const { return hasElementFlag(IsInCanvasSubtree); } 399 bool isInCanvasSubtree() const { return hasElementFlag(IsInCanvasSubtree); }
395 400
396 unsigned childIndex() const { return hasRareData() ? rareDataChildIndex() : 0; } 401 unsigned childIndex() const { return hasRareData() ? rareDataChildIndex() : 0; }
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 template <> inline bool isElementOfType<const thisType>(const Element& eleme nt) { return element.predicate; } \ 936 template <> inline bool isElementOfType<const thisType>(const Element& eleme nt) { return element.predicate; } \
932 DEFINE_NODE_TYPE_CASTS(thisType, predicate) 937 DEFINE_NODE_TYPE_CASTS(thisType, predicate)
933 938
934 #define DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ 939 #define DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \
935 template <> inline bool isElementOfType<const thisType>(const Element& eleme nt) { return is##thisType(element); } \ 940 template <> inline bool isElementOfType<const thisType>(const Element& eleme nt) { return is##thisType(element); } \
936 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) 941 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType)
937 942
938 } // namespace 943 } // namespace
939 944
940 #endif 945 #endif
OLDNEW
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698