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

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

Issue 2473743003: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Address esprehn's comments Created 4 years 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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 StyleResolver& resolver = ensureStyleResolver(); 2040 StyleResolver& resolver = ensureStyleResolver();
2041 2041
2042 bool shouldRecordStats; 2042 bool shouldRecordStats;
2043 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); 2043 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats);
2044 styleEngine().setStatsEnabled(shouldRecordStats); 2044 styleEngine().setStatsEnabled(shouldRecordStats);
2045 2045
2046 if (Element* documentElement = this->documentElement()) { 2046 if (Element* documentElement = this->documentElement()) {
2047 inheritHtmlAndBodyElementStyles(change); 2047 inheritHtmlAndBodyElementStyles(change);
2048 if (documentElement->shouldCallRecalcStyle(change)) 2048 if (documentElement->shouldCallRecalcStyle(change))
2049 documentElement->recalcStyle(change); 2049 documentElement->recalcStyle(change);
2050 DCHECK(!documentElement->needsStyleRecalc());
2051 DCHECK(!documentElement->childNeedsStyleRecalc());
2052 if (documentElement->needsReattachLayoutTree() ||
2053 documentElement->childNeedsReattachLayoutTree())
2054 documentElement->rebuildLayoutTree();
2050 } 2055 }
2051 2056
2052 view()->recalcOverflowAfterStyleChange(); 2057 view()->recalcOverflowAfterStyleChange();
2053 2058
2054 // Only retain the HashMap for the duration of StyleRecalc and 2059 // Only retain the HashMap for the duration of StyleRecalc and
2055 // LayoutTreeConstruction. 2060 // LayoutTreeConstruction.
2056 m_styleReattachDataMap.clear(); 2061 m_styleReattachDataMap.clear();
2057 clearChildNeedsStyleRecalc(); 2062 clearChildNeedsStyleRecalc();
2058 clearChildNeedsReattachLayoutTree(); 2063 clearChildNeedsReattachLayoutTree();
2059 2064
(...skipping 4530 matching lines...) Expand 10 before | Expand all | Expand 10 after
6590 } 6595 }
6591 6596
6592 void showLiveDocumentInstances() { 6597 void showLiveDocumentInstances() {
6593 WeakDocumentSet& set = liveDocumentSet(); 6598 WeakDocumentSet& set = liveDocumentSet();
6594 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6599 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6595 for (Document* document : set) 6600 for (Document* document : set)
6596 fprintf(stderr, "- Document %p URL: %s\n", document, 6601 fprintf(stderr, "- Document %p URL: %s\n", document,
6597 document->url().getString().utf8().data()); 6602 document->url().getString().utf8().data());
6598 } 6603 }
6599 #endif 6604 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698