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

Side by Side Diff: Source/core/html/HTMLLinkElement.cpp

Issue 335313003: MediaQueryEvaluator getting mediaType from MediaValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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
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 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 return; 662 return;
663 663
664 m_loading = true; 664 m_loading = true;
665 665
666 bool mediaQueryMatches = true; 666 bool mediaQueryMatches = true;
667 if (!m_owner->media().isEmpty()) { 667 if (!m_owner->media().isEmpty()) {
668 LocalFrame* frame = loadingFrame(); 668 LocalFrame* frame = loadingFrame();
669 if (Document* document = loadingFrame()->document()) { 669 if (Document* document = loadingFrame()->document()) {
670 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocum ent(*document); 670 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocum ent(*document);
671 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create( m_owner->media()); 671 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create( m_owner->media());
672 MediaQueryEvaluator evaluator(frame->view()->mediaType(), frame) ; 672 MediaQueryEvaluator evaluator(frame);
673 mediaQueryMatches = evaluator.eval(media.get()); 673 mediaQueryMatches = evaluator.eval(media.get());
674 } 674 }
675 } 675 }
676 676
677 // Don't hold up render tree construction and script execution on styles heets 677 // Don't hold up render tree construction and script execution on styles heets
678 // that are not needed for the rendering at the moment. 678 // that are not needed for the rendering at the moment.
679 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); 679 bool blocking = mediaQueryMatches && !m_owner->isAlternate();
680 addPendingSheet(blocking ? Blocking : NonBlocking); 680 addPendingSheet(blocking ? Blocking : NonBlocking);
681 681
682 // Load stylesheets that are not needed for the rendering immediately wi th low priority. 682 // Load stylesheets that are not needed for the rendering immediately wi th low priority.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 removePendingSheet(); 714 removePendingSheet();
715 } 715 }
716 716
717 void LinkStyle::trace(Visitor* visitor) 717 void LinkStyle::trace(Visitor* visitor)
718 { 718 {
719 visitor->trace(m_sheet); 719 visitor->trace(m_sheet);
720 LinkResource::trace(visitor); 720 LinkResource::trace(visitor);
721 } 721 }
722 722
723 } // namespace WebCore 723 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698