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

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

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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/dom/Element.h ('k') | Source/core/dom/shadow/ElementShadow.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 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 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 ElementShadow* Element::shadow() const 1591 ElementShadow* Element::shadow() const
1592 { 1592 {
1593 return hasRareData() ? elementRareData()->shadow() : 0; 1593 return hasRareData() ? elementRareData()->shadow() : 0;
1594 } 1594 }
1595 1595
1596 ElementShadow& Element::ensureShadow() 1596 ElementShadow& Element::ensureShadow()
1597 { 1597 {
1598 return ensureElementRareData().ensureShadow(); 1598 return ensureElementRareData().ensureShadow();
1599 } 1599 }
1600 1600
1601 void Element::didAffectSelector(AffectedSelectorMask mask) 1601 void Element::pseudoStateChanged(CSSSelector::PseudoType pseudo)
1602 { 1602 {
1603 setNeedsStyleRecalc(SubtreeStyleChange); 1603 StyleResolver* styleResolver = document().styleResolver();
1604
1605 if (inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleC hange)
1606 styleResolver->ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationFo rPseudoChange(pseudo, *this);
1607
1604 if (ElementShadow* elementShadow = shadowWhereNodeCanBeDistributed(*this)) 1608 if (ElementShadow* elementShadow = shadowWhereNodeCanBeDistributed(*this))
1605 elementShadow->didAffectSelector(mask); 1609 elementShadow->distributedNodePseudoStateChanged(pseudo);
1606 } 1610 }
1607 1611
1608 void Element::setAnimationStyleChange(bool animationStyleChange) 1612 void Element::setAnimationStyleChange(bool animationStyleChange)
1609 { 1613 {
1610 if (animationStyleChange && document().inStyleRecalc()) 1614 if (animationStyleChange && document().inStyleRecalc())
1611 return; 1615 return;
1612 if (ActiveAnimations* activeAnimations = elementRareData()->activeAnimations ()) 1616 if (ActiveAnimations* activeAnimations = elementRareData()->activeAnimations ())
1613 activeAnimations->setAnimationStyleChange(animationStyleChange); 1617 activeAnimations->setAnimationStyleChange(animationStyleChange);
1614 } 1618 }
1615 1619
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
3257 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , wrapperType, toScriptWrappableBase(), isolate); 3261 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , wrapperType, toScriptWrappableBase(), isolate);
3258 if (wrapper.IsEmpty()) 3262 if (wrapper.IsEmpty())
3259 return v8::Handle<v8::Object>(); 3263 return v8::Handle<v8::Object>();
3260 3264
3261 wrapper->SetPrototype(binding->prototype()); 3265 wrapper->SetPrototype(binding->prototype());
3262 3266
3263 return V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType , wrapper, isolate); 3267 return V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType , wrapper, isolate);
3264 } 3268 }
3265 3269
3266 } // namespace blink 3270 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/shadow/ElementShadow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698