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

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

Issue 2611613004: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Created 3 years, 11 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 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 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 StyleResolver& resolver = ensureStyleResolver(); 2043 StyleResolver& resolver = ensureStyleResolver();
2044 2044
2045 bool shouldRecordStats; 2045 bool shouldRecordStats;
2046 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); 2046 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats);
2047 styleEngine().setStatsEnabled(shouldRecordStats); 2047 styleEngine().setStatsEnabled(shouldRecordStats);
2048 2048
2049 if (Element* documentElement = this->documentElement()) { 2049 if (Element* documentElement = this->documentElement()) {
2050 inheritHtmlAndBodyElementStyles(change); 2050 inheritHtmlAndBodyElementStyles(change);
2051 if (documentElement->shouldCallRecalcStyle(change)) 2051 if (documentElement->shouldCallRecalcStyle(change))
2052 documentElement->recalcStyle(change); 2052 documentElement->recalcStyle(change);
2053 DCHECK(!documentElement->needsStyleRecalc());
2054 if (documentElement->needsReattachLayoutTree() ||
2055 documentElement->childNeedsReattachLayoutTree())
2056 documentElement->rebuildLayoutTree();
2053 } 2057 }
2054 2058
2055 view()->recalcOverflowAfterStyleChange(); 2059 view()->recalcOverflowAfterStyleChange();
2056 2060
2057 // Only retain the HashMap for the duration of StyleRecalc and 2061 // Only retain the HashMap for the duration of StyleRecalc and
2058 // LayoutTreeConstruction. 2062 // LayoutTreeConstruction.
2059 m_styleReattachDataMap.clear(); 2063 m_styleReattachDataMap.clear();
2060 clearChildNeedsStyleRecalc(); 2064 clearChildNeedsStyleRecalc();
2061 clearChildNeedsReattachLayoutTree(); 2065 clearChildNeedsReattachLayoutTree();
2062 2066
(...skipping 4518 matching lines...) Expand 10 before | Expand all | Expand 10 after
6581 } 6585 }
6582 6586
6583 void showLiveDocumentInstances() { 6587 void showLiveDocumentInstances() {
6584 WeakDocumentSet& set = liveDocumentSet(); 6588 WeakDocumentSet& set = liveDocumentSet();
6585 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6589 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6586 for (Document* document : set) 6590 for (Document* document : set)
6587 fprintf(stderr, "- Document %p URL: %s\n", document, 6591 fprintf(stderr, "- Document %p URL: %s\n", document,
6588 document->url().getString().utf8().data()); 6592 document->url().getString().utf8().data());
6589 } 6593 }
6590 #endif 6594 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.cpp ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698