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

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

Issue 2572473006: Revert of Collect active stylesheets and and apply asynchronously. (Closed)
Patch Set: 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 return *m_selectorQueryCache; 563 return *m_selectorQueryCache;
564 } 564 }
565 565
566 MediaQueryMatcher& Document::mediaQueryMatcher() { 566 MediaQueryMatcher& Document::mediaQueryMatcher() {
567 if (!m_mediaQueryMatcher) 567 if (!m_mediaQueryMatcher)
568 m_mediaQueryMatcher = MediaQueryMatcher::create(*this); 568 m_mediaQueryMatcher = MediaQueryMatcher::create(*this);
569 return *m_mediaQueryMatcher; 569 return *m_mediaQueryMatcher;
570 } 570 }
571 571
572 void Document::mediaQueryAffectingValueChanged() { 572 void Document::mediaQueryAffectingValueChanged() {
573 m_evaluateMediaQueriesOnStyleRecalc = true;
573 styleEngine().mediaQueryAffectingValueChanged(); 574 styleEngine().mediaQueryAffectingValueChanged();
574 if (needsLayoutTreeUpdate())
575 m_evaluateMediaQueriesOnStyleRecalc = true;
576 else
577 evaluateMediaQueryList();
578 InspectorInstrumentation::mediaQueryResultChanged(this); 575 InspectorInstrumentation::mediaQueryResultChanged(this);
579 } 576 }
580 577
581 void Document::setCompatibilityMode(CompatibilityMode mode) { 578 void Document::setCompatibilityMode(CompatibilityMode mode) {
582 if (m_compatibilityModeLocked || mode == m_compatibilityMode) 579 if (m_compatibilityModeLocked || mode == m_compatibilityMode)
583 return; 580 return;
584 m_compatibilityMode = mode; 581 m_compatibilityMode = mode;
585 selectorQueryCache().invalidate(); 582 selectorQueryCache().invalidate();
586 } 583 }
587 584
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 // stop it a second time, after page content has already been loaded and 2220 // stop it a second time, after page content has already been loaded and
2224 // displayed with accurate style information. (Our suppression involves 2221 // displayed with accurate style information. (Our suppression involves
2225 // blanking the whole page at the moment. If it were more refined, we might 2222 // blanking the whole page at the moment. If it were more refined, we might
2226 // be able to do something better.) It's worth noting though that this 2223 // be able to do something better.) It's worth noting though that this
2227 // entire method is a hack, since what we really want to do is suspend JS 2224 // entire method is a hack, since what we really want to do is suspend JS
2228 // instead of doing a layout with inaccurate information. 2225 // instead of doing a layout with inaccurate information.
2229 HTMLElement* bodyElement = body(); 2226 HTMLElement* bodyElement = body();
2230 if (bodyElement && !bodyElement->layoutObject() && 2227 if (bodyElement && !bodyElement->layoutObject() &&
2231 m_pendingSheetLayout == NoLayoutWithPendingSheets) { 2228 m_pendingSheetLayout == NoLayoutWithPendingSheets) {
2232 m_pendingSheetLayout = DidLayoutWithPendingSheets; 2229 m_pendingSheetLayout = DidLayoutWithPendingSheets;
2233 styleEngine().markAllTreeScopesDirty(); 2230 styleEngine().resolverChanged(FullStyleUpdate);
2234 } 2231 } else if (m_hasNodesWithPlaceholderStyle) {
2235 if (m_hasNodesWithPlaceholderStyle) {
2236 // If new nodes have been added or style recalc has been done with style 2232 // If new nodes have been added or style recalc has been done with style
2237 // sheets still pending, some nodes may not have had their real style 2233 // sheets still pending, some nodes may not have had their real style
2238 // calculated yet. Normally this gets cleaned when style sheets arrive 2234 // calculated yet. Normally this gets cleaned when style sheets arrive
2239 // but here we need up-to-date style immediately. 2235 // but here we need up-to-date style immediately.
2240 setNeedsStyleRecalc(SubtreeStyleChange, 2236 setNeedsStyleRecalc(SubtreeStyleChange,
2241 StyleChangeReasonForTracing::create( 2237 StyleChangeReasonForTracing::create(
2242 StyleChangeReason::CleanupPlaceholderStyles)); 2238 StyleChangeReason::CleanupPlaceholderStyles));
2243 } 2239 }
2244 } 2240 }
2245 updateStyleAndLayoutTree(); 2241 updateStyleAndLayoutTree();
(...skipping 4330 matching lines...) Expand 10 before | Expand all | Expand 10 after
6576 } 6572 }
6577 6573
6578 void showLiveDocumentInstances() { 6574 void showLiveDocumentInstances() {
6579 WeakDocumentSet& set = liveDocumentSet(); 6575 WeakDocumentSet& set = liveDocumentSet();
6580 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6576 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6581 for (Document* document : set) 6577 for (Document* document : set)
6582 fprintf(stderr, "- Document %p URL: %s\n", document, 6578 fprintf(stderr, "- Document %p URL: %s\n", document,
6583 document->url().getString().utf8().data()); 6579 document->url().getString().utf8().data());
6584 } 6580 }
6585 #endif 6581 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698