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

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

Issue 1163163003: Call isStyledElement() only once in Element::attributeChanged() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | 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 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 parentElementShadow->setNeedsDistributionRecalc(); 1103 parentElementShadow->setNeedsDistributionRecalc();
1104 } 1104 }
1105 1105
1106 parseAttribute(name, newValue); 1106 parseAttribute(name, newValue);
1107 1107
1108 document().incDOMTreeVersion(); 1108 document().incDOMTreeVersion();
1109 1109
1110 StyleResolver* styleResolver = document().styleResolver(); 1110 StyleResolver* styleResolver = document().styleResolver();
1111 bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styl eChangeType() < SubtreeStyleChange; 1111 bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styl eChangeType() < SubtreeStyleChange;
1112 1112
1113 if (isStyledElement() && name == styleAttr) { 1113 if (isStyledElement()) {
1114 styleAttributeChanged(newValue, reason); 1114 if (name == styleAttr) {
1115 } else if (isStyledElement() && isPresentationAttribute(name)) { 1115 styleAttributeChanged(newValue, reason);
1116 elementData()->m_presentationAttributeStyleIsDirty = true; 1116 } else if (isPresentationAttribute(name)) {
1117 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::fromA ttribute(name)); 1117 elementData()->m_presentationAttributeStyleIsDirty = true;
1118 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::f romAttribute(name));
1119 }
1118 } 1120 }
1119 1121
1120 if (name == HTMLNames::idAttr) { 1122 if (name == HTMLNames::idAttr) {
1121 AtomicString oldId = elementData()->idForStyleResolution(); 1123 AtomicString oldId = elementData()->idForStyleResolution();
1122 AtomicString newId = makeIdForStyleResolution(newValue, document().inQui rksMode()); 1124 AtomicString newId = makeIdForStyleResolution(newValue, document().inQui rksMode());
1123 if (newId != oldId) { 1125 if (newId != oldId) {
1124 elementData()->setIdForStyleResolution(newId); 1126 elementData()->setIdForStyleResolution(newId);
1125 if (testShouldInvalidateStyle) 1127 if (testShouldInvalidateStyle)
1126 document().styleEngine().idChangedForElement(oldId, newId, *this ); 1128 document().styleEngine().idChangedForElement(oldId, newId, *this );
1127 } 1129 }
(...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after
3435 { 3437 {
3436 #if ENABLE(OILPAN) 3438 #if ENABLE(OILPAN)
3437 if (hasRareData()) 3439 if (hasRareData())
3438 visitor->trace(elementRareData()); 3440 visitor->trace(elementRareData());
3439 visitor->trace(m_elementData); 3441 visitor->trace(m_elementData);
3440 #endif 3442 #endif
3441 ContainerNode::trace(visitor); 3443 ContainerNode::trace(visitor);
3442 } 3444 }
3443 3445
3444 } // namespace blink 3446 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698