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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 LocalFrame* frame = loadingFrame(); | 718 LocalFrame* frame = loadingFrame(); |
719 if (!m_owner->media().isEmpty() && frame && frame->document()) { | 719 if (!m_owner->media().isEmpty() && frame && frame->document()) { |
720 RefPtr<ComputedStyle> documentStyle = StyleResolver::styleForDocumen
t(*frame->document()); | 720 RefPtr<ComputedStyle> documentStyle = StyleResolver::styleForDocumen
t(*frame->document()); |
721 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(m_ow
ner->media()); | 721 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(m_ow
ner->media()); |
722 MediaQueryEvaluator evaluator(frame); | 722 MediaQueryEvaluator evaluator(frame); |
723 mediaQueryMatches = evaluator.eval(media.get()); | 723 mediaQueryMatches = evaluator.eval(media.get()); |
724 } | 724 } |
725 | 725 |
726 // Don't hold up layout tree construction and script execution on styles
heets | 726 // Don't hold up layout tree construction and script execution on styles
heets |
727 // that are not needed for the layout at the moment. | 727 // that are not needed for the layout at the moment. |
728 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); | 728 bool blocking = mediaQueryMatches && !m_owner->isAlternate() && m_owner-
>isCreatedByParser(); |
729 addPendingSheet(blocking ? Blocking : NonBlocking); | 729 addPendingSheet(blocking ? Blocking : NonBlocking); |
730 | 730 |
731 // Load stylesheets that are not needed for the layout immediately with
low priority. | 731 // Load stylesheets that are not needed for the layout immediately with
low priority. |
732 FetchRequest request = builder.build(blocking); | 732 FetchRequest request = builder.build(blocking); |
733 CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(m_owne
r->fastGetAttribute(HTMLNames::crossoriginAttr)); | 733 CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(m_owne
r->fastGetAttribute(HTMLNames::crossoriginAttr)); |
734 if (crossOrigin != CrossOriginAttributeNotSet) { | 734 if (crossOrigin != CrossOriginAttributeNotSet) { |
735 request.setCrossOriginAccessControl(document().securityOrigin(), cro
ssOrigin); | 735 request.setCrossOriginAccessControl(document().securityOrigin(), cro
ssOrigin); |
736 setFetchFollowingCORS(); | 736 setFetchFollowingCORS(); |
737 } | 737 } |
738 setResource(CSSStyleSheetResource::fetch(request, document().fetcher()))
; | 738 setResource(CSSStyleSheetResource::fetch(request, document().fetcher()))
; |
(...skipping 28 matching lines...) Expand all Loading... |
767 } | 767 } |
768 | 768 |
769 DEFINE_TRACE(LinkStyle) | 769 DEFINE_TRACE(LinkStyle) |
770 { | 770 { |
771 visitor->trace(m_sheet); | 771 visitor->trace(m_sheet); |
772 LinkResource::trace(visitor); | 772 LinkResource::trace(visitor); |
773 ResourceOwner<StyleSheetResource>::trace(visitor); | 773 ResourceOwner<StyleSheetResource>::trace(visitor); |
774 } | 774 } |
775 | 775 |
776 } // namespace blink | 776 } // namespace blink |
OLD | NEW |