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

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

Issue 2375293002: Set NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node (Closed)
Patch Set: Add ability to clear dirty bits and relevant call sites Created 4 years, 2 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. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * (C) 2007 Eric Seidel (eric@webkit.org) 9 * (C) 2007 Eric Seidel (eric@webkit.org)
10 * 10 *
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 data->clearComputedStyle(); 1854 data->clearComputedStyle();
1855 1855
1856 if (change >= IndependentInherit) { 1856 if (change >= IndependentInherit) {
1857 if (ElementAnimations* elementAnimations = data->elementAnimations()) 1857 if (ElementAnimations* elementAnimations = data->elementAnimations())
1858 elementAnimations->setAnimationStyleChange(false); 1858 elementAnimations->setAnimationStyleChange(false);
1859 } 1859 }
1860 } 1860 }
1861 if (parentComputedStyle()) 1861 if (parentComputedStyle())
1862 change = recalcOwnStyle(change); 1862 change = recalcOwnStyle(change);
1863 clearNeedsStyleRecalc(); 1863 clearNeedsStyleRecalc();
1864 clearNeedsReattachLayoutTree();
1864 } 1865 }
1865 1866
1866 // If we reattached we don't need to recalc the style of our descendants 1867 // If we reattached we don't need to recalc the style of our descendants
1867 // anymore. 1868 // anymore.
1868 if ((change >= UpdatePseudoElements && change < Reattach) || 1869 if ((change >= UpdatePseudoElements && change < Reattach) ||
1869 childNeedsStyleRecalc()) { 1870 childNeedsStyleRecalc()) {
1870 SelectorFilterParentScope filterScope(*this); 1871 SelectorFilterParentScope filterScope(*this);
1871 StyleSharingDepthScope sharingScope(*this); 1872 StyleSharingDepthScope sharingScope(*this);
1872 1873
1873 updatePseudoElement(PseudoIdBefore, change); 1874 updatePseudoElement(PseudoIdBefore, change);
(...skipping 11 matching lines...) Expand all
1885 updatePseudoElement(PseudoIdBackdrop, change); 1886 updatePseudoElement(PseudoIdBackdrop, change);
1886 1887
1887 // If our children have changed then we need to force the first-letter 1888 // If our children have changed then we need to force the first-letter
1888 // checks as we don't know if they effected the first letter or not. 1889 // checks as we don't know if they effected the first letter or not.
1889 // This can be seen when a child transitions from floating to 1890 // This can be seen when a child transitions from floating to
1890 // non-floating we have to take it into account for the first letter. 1891 // non-floating we have to take it into account for the first letter.
1891 updatePseudoElement(PseudoIdFirstLetter, 1892 updatePseudoElement(PseudoIdFirstLetter,
1892 childNeedsStyleRecalc() ? Force : change); 1893 childNeedsStyleRecalc() ? Force : change);
1893 1894
1894 clearChildNeedsStyleRecalc(); 1895 clearChildNeedsStyleRecalc();
1896 clearChildNeedsReattachLayoutTree();
1895 } 1897 }
1896 1898
1897 if (hasCustomStyleCallbacks()) 1899 if (hasCustomStyleCallbacks())
1898 didRecalcStyle(change); 1900 didRecalcStyle(change);
1899 1901
1900 if (change == Reattach) 1902 if (change == Reattach)
1901 reattachWhitespaceSiblingsIfNeeded(nextTextSibling); 1903 reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
1902 } 1904 }
1903 1905
1904 PassRefPtr<ComputedStyle> Element::propagateInheritedProperties( 1906 PassRefPtr<ComputedStyle> Element::propagateInheritedProperties(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 StyleRecalcChange localChange = 1942 StyleRecalcChange localChange =
1941 ComputedStyle::stylePropagationDiff(oldStyle.get(), newStyle.get()); 1943 ComputedStyle::stylePropagationDiff(oldStyle.get(), newStyle.get());
1942 if (localChange == NoChange) { 1944 if (localChange == NoChange) {
1943 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), stylesUnchanged, 1); 1945 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), stylesUnchanged, 1);
1944 } else { 1946 } else {
1945 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), stylesChanged, 1); 1947 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), stylesChanged, 1);
1946 } 1948 }
1947 1949
1948 if (localChange == Reattach) { 1950 if (localChange == Reattach) {
1949 document().addNonAttachedStyle(*this, std::move(newStyle)); 1951 document().addNonAttachedStyle(*this, std::move(newStyle));
1952 setNeedsReattachLayoutTree();
1950 return rebuildLayoutTree(); 1953 return rebuildLayoutTree();
1951 } 1954 }
1952 1955
1953 DCHECK(oldStyle); 1956 DCHECK(oldStyle);
1954 1957
1955 if (localChange != NoChange) 1958 if (localChange != NoChange)
1956 updateCallbackSelectors(oldStyle.get(), newStyle.get()); 1959 updateCallbackSelectors(oldStyle.get(), newStyle.get());
1957 1960
1958 if (LayoutObject* layoutObject = this->layoutObject()) { 1961 if (LayoutObject* layoutObject = this->layoutObject()) {
1959 if (localChange != NoChange || 1962 if (localChange != NoChange ||
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after
4079 } 4082 }
4080 4083
4081 DEFINE_TRACE_WRAPPERS(Element) { 4084 DEFINE_TRACE_WRAPPERS(Element) {
4082 if (hasRareData()) { 4085 if (hasRareData()) {
4083 visitor->traceWrappers(elementRareData()); 4086 visitor->traceWrappers(elementRareData());
4084 } 4087 }
4085 ContainerNode::traceWrappers(visitor); 4088 ContainerNode::traceWrappers(visitor);
4086 } 4089 }
4087 4090
4088 } // namespace blink 4091 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698