OLD | NEW |
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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 return; | 646 return; |
647 | 647 |
648 m_loading = true; | 648 m_loading = true; |
649 | 649 |
650 bool mediaQueryMatches = true; | 650 bool mediaQueryMatches = true; |
651 if (!m_owner->media().isEmpty()) { | 651 if (!m_owner->media().isEmpty()) { |
652 LocalFrame* frame = loadingFrame(); | 652 LocalFrame* frame = loadingFrame(); |
653 if (Document* document = loadingFrame()->document()) { | 653 if (Document* document = loadingFrame()->document()) { |
654 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocum
ent(*document); | 654 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocum
ent(*document); |
655 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(
m_owner->media()); | 655 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(
m_owner->media()); |
656 MediaQueryEvaluator evaluator(frame->view()->mediaType(), frame,
documentStyle.get()); | 656 MediaQueryEvaluator evaluator(frame->view()->mediaType(), frame)
; |
657 mediaQueryMatches = evaluator.eval(media.get()); | 657 mediaQueryMatches = evaluator.eval(media.get()); |
658 } | 658 } |
659 } | 659 } |
660 | 660 |
661 // Don't hold up render tree construction and script execution on styles
heets | 661 // Don't hold up render tree construction and script execution on styles
heets |
662 // that are not needed for the rendering at the moment. | 662 // that are not needed for the rendering at the moment. |
663 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); | 663 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); |
664 addPendingSheet(blocking ? Blocking : NonBlocking); | 664 addPendingSheet(blocking ? Blocking : NonBlocking); |
665 | 665 |
666 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. | 666 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. |
(...skipping 25 matching lines...) Expand all Loading... |
692 void LinkStyle::ownerRemoved() | 692 void LinkStyle::ownerRemoved() |
693 { | 693 { |
694 if (m_sheet) | 694 if (m_sheet) |
695 clearSheet(); | 695 clearSheet(); |
696 | 696 |
697 if (styleSheetIsLoading()) | 697 if (styleSheetIsLoading()) |
698 removePendingSheet(RemovePendingSheetNotifyLater); | 698 removePendingSheet(RemovePendingSheetNotifyLater); |
699 } | 699 } |
700 | 700 |
701 } // namespace WebCore | 701 } // namespace WebCore |
OLD | NEW |