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

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

Issue 322043008: Evaluate MediaQueryLists on actual media changes only. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 673
674 MediaQueryMatcher& Document::mediaQueryMatcher() 674 MediaQueryMatcher& Document::mediaQueryMatcher()
675 { 675 {
676 if (!m_mediaQueryMatcher) 676 if (!m_mediaQueryMatcher)
677 m_mediaQueryMatcher = MediaQueryMatcher::create(this); 677 m_mediaQueryMatcher = MediaQueryMatcher::create(this);
678 return *m_mediaQueryMatcher; 678 return *m_mediaQueryMatcher;
679 } 679 }
680 680
681 void Document::mediaQueryAffectingValueChanged() 681 void Document::mediaQueryAffectingValueChanged()
682 { 682 {
683 m_evaluateMediaQueriesOnStyleRecalc = true;
683 styleEngine()->clearMediaQueryRuleSetStyleSheets(); 684 styleEngine()->clearMediaQueryRuleSetStyleSheets();
684 } 685 }
685 686
686 void Document::setCompatibilityMode(CompatibilityMode mode) 687 void Document::setCompatibilityMode(CompatibilityMode mode)
687 { 688 {
688 if (m_compatibilityModeLocked || mode == m_compatibilityMode) 689 if (m_compatibilityModeLocked || mode == m_compatibilityMode)
689 return; 690 return;
690 bool wasInQuirksMode = inQuirksMode(); 691 bool wasInQuirksMode = inQuirksMode();
691 m_compatibilityMode = mode; 692 m_compatibilityMode = mode;
692 selectorQueryCache().invalidate(); 693 selectorQueryCache().invalidate();
(...skipping 2756 matching lines...) Expand 10 before | Expand all | Expand 10 after
3449 return; 3450 return;
3450 3451
3451 m_styleEngine->resolverChanged(updateMode); 3452 m_styleEngine->resolverChanged(updateMode);
3452 3453
3453 if (didLayoutWithPendingStylesheets() && !m_styleEngine->hasPendingSheets()) { 3454 if (didLayoutWithPendingStylesheets() && !m_styleEngine->hasPendingSheets()) {
3454 // We need to manually repaint because we avoid doing all repaints in la yout or style 3455 // We need to manually repaint because we avoid doing all repaints in la yout or style
3455 // recalc while sheets are still loading to avoid FOUC. 3456 // recalc while sheets are still loading to avoid FOUC.
3456 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; 3457 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
3457 renderView()->repaintViewAndCompositedLayers(); 3458 renderView()->repaintViewAndCompositedLayers();
3458 } 3459 }
3459
3460 m_evaluateMediaQueriesOnStyleRecalc = true;
3461 } 3460 }
3462 3461
3463 void Document::styleResolverMayHaveChanged() 3462 void Document::styleResolverMayHaveChanged()
3464 { 3463 {
3465 styleResolverChanged(hasNodesWithPlaceholderStyle() ? FullStyleUpdate : Anal yzedStyleUpdate); 3464 styleResolverChanged(hasNodesWithPlaceholderStyle() ? FullStyleUpdate : Anal yzedStyleUpdate);
3466 } 3465 }
3467 3466
3468 void Document::setHoverNode(PassRefPtrWillBeRawPtr<Node> newHoverNode) 3467 void Document::setHoverNode(PassRefPtrWillBeRawPtr<Node> newHoverNode)
3469 { 3468 {
3470 m_hoverNode = newHoverNode; 3469 m_hoverNode = newHoverNode;
(...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after
5854 visitor->trace(m_compositorPendingAnimations); 5853 visitor->trace(m_compositorPendingAnimations);
5855 visitor->trace(m_contextDocument); 5854 visitor->trace(m_contextDocument);
5856 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5855 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5857 DocumentSupplementable::trace(visitor); 5856 DocumentSupplementable::trace(visitor);
5858 TreeScope::trace(visitor); 5857 TreeScope::trace(visitor);
5859 ContainerNode::trace(visitor); 5858 ContainerNode::trace(visitor);
5860 ExecutionContext::trace(visitor); 5859 ExecutionContext::trace(visitor);
5861 } 5860 }
5862 5861
5863 } // namespace WebCore 5862 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698