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

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

Issue 565493002: Use invalidation set for :empty pseudo changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@empty-flag-20140910
Patch Set: 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/css/RuleFeature.cpp ('k') | 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 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 } 1711 }
1712 return false; 1712 return false;
1713 } 1713 }
1714 1714
1715 void Element::checkForEmptyStyleChange() 1715 void Element::checkForEmptyStyleChange()
1716 { 1716 {
1717 RenderStyle* style = renderStyle(); 1717 RenderStyle* style = renderStyle();
1718 1718
1719 if (!style && !styleAffectedByEmpty()) 1719 if (!style && !styleAffectedByEmpty())
1720 return; 1720 return;
1721 if (styleChangeType() >= SubtreeStyleChange)
1722 return;
1723 if (!inActiveDocument())
1724 return;
1725 if (!document().styleResolver())
1726 return;
1721 1727
1722 if (!style || (styleAffectedByEmpty() && (!style->emptyState() || hasChildre n()))) 1728 if (!style || (styleAffectedByEmpty() && (!style->emptyState() || hasChildre n())))
1723 setNeedsStyleRecalc(SubtreeStyleChange); 1729 document().styleResolver()->ensureUpdatedRuleFeatureSet().scheduleStyleI nvalidationForPseudoChange(CSSSelector::PseudoEmpty, *this);
1724 } 1730 }
1725 1731
1726 void Element::childrenChanged(const ChildrenChange& change) 1732 void Element::childrenChanged(const ChildrenChange& change)
1727 { 1733 {
1728 ContainerNode::childrenChanged(change); 1734 ContainerNode::childrenChanged(change);
1729 1735
1730 checkForEmptyStyleChange(); 1736 checkForEmptyStyleChange();
1731 if (!change.byParser && change.isChildElementChange()) 1737 if (!change.byParser && change.isChildElementChange())
1732 checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingEleme ntRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAf terChange); 1738 checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingEleme ntRemoved : SiblingElementInserted, change.siblingBeforeChange, change.siblingAf terChange);
1733 1739
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
3261 return v8::Handle<v8::Object>(); 3267 return v8::Handle<v8::Object>();
3262 3268
3263 wrapper->SetPrototype(binding->prototype()); 3269 wrapper->SetPrototype(binding->prototype());
3264 3270
3265 wrapperType->refObject(toScriptWrappableBase()); 3271 wrapperType->refObject(toScriptWrappableBase());
3266 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp er, isolate); 3272 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp er, isolate);
3267 return wrapper; 3273 return wrapper;
3268 } 3274 }
3269 3275
3270 } // namespace blink 3276 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698