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

Side by Side Diff: Source/core/dom/ContainerNode.cpp

Issue 208933003: Remove SiblingRuleHelper (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tighten types to ContainerNode 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
« no previous file with comments | « Source/core/dom/ContainerNode.h ('k') | Source/core/dom/Element.h » ('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 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 990
991 ChildListMutationScope(*this).childAdded(child); 991 ChildListMutationScope(*this).childAdded(child);
992 992
993 childrenChanged(false, child.previousSibling(), child.nextSibling(), 1); 993 childrenChanged(false, child.previousSibling(), child.nextSibling(), 1);
994 994
995 ChildNodeInsertionNotifier(*this).notify(child); 995 ChildNodeInsertionNotifier(*this).notify(child);
996 996
997 dispatchChildInsertionEvents(child); 997 dispatchChildInsertionEvents(child);
998 } 998 }
999 999
1000 bool ContainerNode::hasRestyleFlagInternal(DynamicRestyleFlags mask) const
1001 {
1002 return rareData()->hasRestyleFlag(mask);
1003 }
1004
1005 bool ContainerNode::hasRestyleFlagsInternal() const
1006 {
1007 return rareData()->hasRestyleFlags();
1008 }
1009
1010 void ContainerNode::setRestyleFlag(DynamicRestyleFlags mask)
1011 {
1012 ASSERT(isElementNode() || isShadowRoot());
1013 ensureRareData().setRestyleFlag(mask);
1014 }
1015
1016 void ContainerNode::checkForChildrenAdjacentRuleChanges()
1017 {
1018 bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules();
1019 bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules();
1020
1021 if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules)
1022 return;
1023
1024 unsigned forceCheckOfNextElementCount = 0;
1025 bool forceCheckOfAnyElementSibling = false;
1026 Document& document = this->document();
1027
1028 for (Node* child = firstChild(); child; child = child->nextSibling()) {
1029 if (!child->isElementNode())
1030 continue;
1031 Element* element = toElement(child);
1032 bool childRulesChanged = element->needsStyleRecalc() && element->styleCh angeType() >= SubtreeStyleChange;
1033
1034 if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling)
1035 element->setNeedsStyleRecalc(SubtreeStyleChange);
1036
1037 if (forceCheckOfNextElementCount)
1038 forceCheckOfNextElementCount--;
1039
1040 if (childRulesChanged && hasDirectAdjacentRules)
1041 forceCheckOfNextElementCount = document.styleEngine()->maxDirectAdja centSelectors();
1042
1043 forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childR ulesChanged && hasIndirectAdjacentRules);
1044 }
1045 }
1046
1000 PassRefPtr<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicStrin g& localName) 1047 PassRefPtr<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicStrin g& localName)
1001 { 1048 {
1002 if (localName.isNull()) 1049 if (localName.isNull())
1003 return nullptr; 1050 return nullptr;
1004 1051
1005 if (document().isHTMLDocument()) 1052 if (document().isHTMLDocument())
1006 return ensureRareData().ensureNodeLists().addCache<HTMLTagCollection>(*t his, HTMLTagCollectionType, localName); 1053 return ensureRareData().ensureNodeLists().addCache<HTMLTagCollection>(*t his, HTMLTagCollectionType, localName);
1007 return ensureRareData().ensureNodeLists().addCache<TagCollection>(*this, Tag CollectionType, localName); 1054 return ensureRareData().ensureNodeLists().addCache<TagCollection>(*this, Tag CollectionType, localName);
1008 } 1055 }
1009 1056
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 return true; 1096 return true;
1050 1097
1051 if (node->isElementNode() && toElement(node)->shadow()) 1098 if (node->isElementNode() && toElement(node)->shadow())
1052 return true; 1099 return true;
1053 1100
1054 return false; 1101 return false;
1055 } 1102 }
1056 #endif 1103 #endif
1057 1104
1058 } // namespace WebCore 1105 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698