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

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

Issue 975933002: Return reference from styleEngine() accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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/resolver/StyleResolver.cpp ('k') | Source/core/dom/Document.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, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 bool forceCheckOfAnyElementSibling = false; 1289 bool forceCheckOfAnyElementSibling = false;
1290 Document& document = this->document(); 1290 Document& document = this->document();
1291 1291
1292 for (Element* child = ElementTraversal::firstChild(*this); child; child = El ementTraversal::nextSibling(*child)) { 1292 for (Element* child = ElementTraversal::firstChild(*this); child; child = El ementTraversal::nextSibling(*child)) {
1293 bool childRulesChanged = child->needsStyleRecalc() && child->styleChange Type() >= SubtreeStyleChange; 1293 bool childRulesChanged = child->needsStyleRecalc() && child->styleChange Type() >= SubtreeStyleChange;
1294 1294
1295 if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling) 1295 if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling)
1296 child->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForT racing::create(StyleChangeReason::SiblingSelector)); 1296 child->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForT racing::create(StyleChangeReason::SiblingSelector));
1297 1297
1298 if (childRulesChanged && hasDirectAdjacentRules) 1298 if (childRulesChanged && hasDirectAdjacentRules)
1299 forceCheckOfNextElementCount = document.styleEngine()->maxDirectAdja centSelectors(); 1299 forceCheckOfNextElementCount = document.styleEngine().maxDirectAdjac entSelectors();
1300 else if (forceCheckOfNextElementCount) 1300 else if (forceCheckOfNextElementCount)
1301 --forceCheckOfNextElementCount; 1301 --forceCheckOfNextElementCount;
1302 1302
1303 forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childR ulesChanged && hasIndirectAdjacentRules); 1303 forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childR ulesChanged && hasIndirectAdjacentRules);
1304 } 1304 }
1305 } 1305 }
1306 1306
1307 void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, Nod e* nodeBeforeChange, Node* nodeAfterChange) 1307 void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, Nod e* nodeBeforeChange, Node* nodeAfterChange)
1308 { 1308 {
1309 if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || style ChangeType() >= SubtreeStyleChange) 1309 if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || style ChangeType() >= SubtreeStyleChange)
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 return true; 1478 return true;
1479 1479
1480 if (node->isElementNode() && toElement(node)->shadow()) 1480 if (node->isElementNode() && toElement(node)->shadow())
1481 return true; 1481 return true;
1482 1482
1483 return false; 1483 return false;
1484 } 1484 }
1485 #endif 1485 #endif
1486 1486
1487 } // namespace blink 1487 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698