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

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

Issue 2473743003: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Make needsAttach() only check if getStyleChangeType flag is NeedsReattachStyleChange and add a Layo… Created 3 years, 9 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 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after
2091 StyleResolver& resolver = ensureStyleResolver(); 2091 StyleResolver& resolver = ensureStyleResolver();
2092 2092
2093 bool shouldRecordStats; 2093 bool shouldRecordStats;
2094 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); 2094 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats);
2095 styleEngine().setStatsEnabled(shouldRecordStats); 2095 styleEngine().setStatsEnabled(shouldRecordStats);
2096 2096
2097 if (Element* documentElement = this->documentElement()) { 2097 if (Element* documentElement = this->documentElement()) {
2098 inheritHtmlAndBodyElementStyles(change); 2098 inheritHtmlAndBodyElementStyles(change);
2099 if (documentElement->shouldCallRecalcStyle(change)) 2099 if (documentElement->shouldCallRecalcStyle(change))
2100 documentElement->recalcStyle(change); 2100 documentElement->recalcStyle(change);
2101 if (documentElement->needsReattachLayoutTree() ||
2102 documentElement->childNeedsReattachLayoutTree())
2103 documentElement->rebuildLayoutTree();
2101 } 2104 }
2102 2105
2103 view()->recalcOverflowAfterStyleChange(); 2106 view()->recalcOverflowAfterStyleChange();
2104 2107
2105 // Only retain the HashMap for the duration of StyleRecalc and 2108 // Only retain the HashMap for the duration of StyleRecalc and
2106 // LayoutTreeConstruction. 2109 // LayoutTreeConstruction.
2107 m_styleReattachDataMap.clear(); 2110 m_styleReattachDataMap.clear();
2108 clearChildNeedsStyleRecalc(); 2111 clearChildNeedsStyleRecalc();
2109 clearChildNeedsReattachLayoutTree(); 2112 clearChildNeedsReattachLayoutTree();
2110 2113
(...skipping 4547 matching lines...) Expand 10 before | Expand all | Expand 10 after
6658 } 6661 }
6659 6662
6660 void showLiveDocumentInstances() { 6663 void showLiveDocumentInstances() {
6661 WeakDocumentSet& set = liveDocumentSet(); 6664 WeakDocumentSet& set = liveDocumentSet();
6662 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6665 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6663 for (blink::Document* document : set) 6666 for (blink::Document* document : set)
6664 fprintf(stderr, "- Document %p URL: %s\n", document, 6667 fprintf(stderr, "- Document %p URL: %s\n", document,
6665 document->url().getString().utf8().data()); 6668 document->url().getString().utf8().data());
6666 } 6669 }
6667 #endif 6670 #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