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

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

Issue 208933003: Remove SiblingRuleHelper (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 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 void ContainerNode::checkForChildrenAdjacentRuleChanges()
1001 {
1002 bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules();
1003 bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules();
1004
1005 if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules)
1006 return;
1007
1008 unsigned forceCheckOfNextElementCount = 0;
1009 bool forceCheckOfAnyElementSibling = false;
1010 Document& document = this->document();
1011
1012 for (Node* child = firstChild(); child; child = child->nextSibling()) {
1013 if (!child->isElementNode())
1014 continue;
1015 Element* element = toElement(child);
1016 bool childRulesChanged = element->needsStyleRecalc() && element->styleCh angeType() >= SubtreeStyleChange;
1017
1018 if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling)
1019 element->setNeedsStyleRecalc(SubtreeStyleChange);
1020
1021 if (forceCheckOfNextElementCount)
1022 forceCheckOfNextElementCount--;
1023
1024 if (childRulesChanged && hasDirectAdjacentRules)
1025 forceCheckOfNextElementCount = document.styleEngine()->maxDirectAdja centSelectors();
1026
1027 forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childR ulesChanged && hasIndirectAdjacentRules);
1028 }
1029 }
1030
1000 PassRefPtr<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicStrin g& localName) 1031 PassRefPtr<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicStrin g& localName)
1001 { 1032 {
1002 if (localName.isNull()) 1033 if (localName.isNull())
1003 return nullptr; 1034 return nullptr;
1004 1035
1005 if (document().isHTMLDocument()) 1036 if (document().isHTMLDocument())
1006 return ensureRareData().ensureNodeLists().addCache<HTMLTagCollection>(*t his, HTMLTagCollectionType, localName); 1037 return ensureRareData().ensureNodeLists().addCache<HTMLTagCollection>(*t his, HTMLTagCollectionType, localName);
1007 return ensureRareData().ensureNodeLists().addCache<TagCollection>(*this, Tag CollectionType, localName); 1038 return ensureRareData().ensureNodeLists().addCache<TagCollection>(*this, Tag CollectionType, localName);
1008 } 1039 }
1009 1040
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 return true; 1080 return true;
1050 1081
1051 if (node->isElementNode() && toElement(node)->shadow()) 1082 if (node->isElementNode() && toElement(node)->shadow())
1052 return true; 1083 return true;
1053 1084
1054 return false; 1085 return false;
1055 } 1086 }
1056 #endif 1087 #endif
1057 1088
1058 } // namespace WebCore 1089 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698