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

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

Issue 2229503002: Style invalidation support for :first/last/only-child. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review issue Created 4 years, 4 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
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 2111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 if (!style || (styleAffectedByEmpty() && (!style->emptyState() || hasChildre n()))) 2122 if (!style || (styleAffectedByEmpty() && (!style->emptyState() || hasChildre n())))
2123 pseudoStateChanged(CSSSelector::PseudoEmpty); 2123 pseudoStateChanged(CSSSelector::PseudoEmpty);
2124 } 2124 }
2125 2125
2126 void Element::childrenChanged(const ChildrenChange& change) 2126 void Element::childrenChanged(const ChildrenChange& change)
2127 { 2127 {
2128 ContainerNode::childrenChanged(change); 2128 ContainerNode::childrenChanged(change);
2129 2129
2130 checkForEmptyStyleChange(); 2130 checkForEmptyStyleChange();
2131 if (!change.byParser && change.isChildElementChange()) 2131 if (!change.byParser && change.isChildElementChange())
2132 checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingEleme ntRemoved : SiblingElementInserted, change.siblingChanged, change.siblingBeforeC hange, change.siblingAfterChange); 2132 checkForSiblingStyleChanges(change.type == ElementRemoved ? SiblingEleme ntRemoved : SiblingElementInserted, toElement(change.siblingChanged), change.sib lingBeforeChange, change.siblingAfterChange);
2133 2133
2134 // TODO(hayato): Confirm that we can skip this if a shadow tree is v1. 2134 // TODO(hayato): Confirm that we can skip this if a shadow tree is v1.
2135 if (ElementShadow* shadow = this->shadow()) 2135 if (ElementShadow* shadow = this->shadow())
2136 shadow->setNeedsDistributionRecalc(); 2136 shadow->setNeedsDistributionRecalc();
2137 } 2137 }
2138 2138
2139 void Element::finishParsingChildren() 2139 void Element::finishParsingChildren()
2140 { 2140 {
2141 setIsFinishedParsingChildren(true); 2141 setIsFinishedParsingChildren(true);
2142 checkForEmptyStyleChange(); 2142 checkForEmptyStyleChange();
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
3784 3784
3785 DEFINE_TRACE_WRAPPERS(Element) 3785 DEFINE_TRACE_WRAPPERS(Element)
3786 { 3786 {
3787 if (hasRareData()) { 3787 if (hasRareData()) {
3788 visitor->traceWrappers(elementRareData()); 3788 visitor->traceWrappers(elementRareData());
3789 } 3789 }
3790 ContainerNode::traceWrappers(visitor); 3790 ContainerNode::traceWrappers(visitor);
3791 } 3791 }
3792 3792
3793 } // namespace blink 3793 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.cpp ('k') | third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698