| 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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 | 725 |
| 726 bool mediaQueryMatches = true; | 726 bool mediaQueryMatches = true; |
| 727 LocalFrame* frame = loadingFrame(); | 727 LocalFrame* frame = loadingFrame(); |
| 728 if (!m_owner->media().isEmpty() && frame && frame->document()) { | 728 if (!m_owner->media().isEmpty() && frame && frame->document()) { |
| 729 RefPtr<ComputedStyle> documentStyle = StyleResolver::styleForDocumen
t(*frame->document()); | 729 RefPtr<ComputedStyle> documentStyle = StyleResolver::styleForDocumen
t(*frame->document()); |
| 730 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(m_ow
ner->media()); | 730 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(m_ow
ner->media()); |
| 731 MediaQueryEvaluator evaluator(frame); | 731 MediaQueryEvaluator evaluator(frame); |
| 732 mediaQueryMatches = evaluator.eval(media.get()); | 732 mediaQueryMatches = evaluator.eval(media.get()); |
| 733 } | 733 } |
| 734 | 734 |
| 735 // Don't hold up render tree construction and script execution on styles
heets | 735 // Don't hold up layout tree construction and script execution on styles
heets |
| 736 // that are not needed for the rendering at the moment. | 736 // that are not needed for the layout at the moment. |
| 737 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); | 737 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); |
| 738 addPendingSheet(blocking ? Blocking : NonBlocking); | 738 addPendingSheet(blocking ? Blocking : NonBlocking); |
| 739 | 739 |
| 740 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. | 740 // Load stylesheets that are not needed for the layout immediately with
low priority. |
| 741 FetchRequest request = builder.build(blocking); | 741 FetchRequest request = builder.build(blocking); |
| 742 AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::cros
soriginAttr); | 742 AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::cros
soriginAttr); |
| 743 if (!crossOriginMode.isNull()) { | 743 if (!crossOriginMode.isNull()) { |
| 744 request.setCrossOriginAccessControl(document().securityOrigin(), cro
ssOriginMode); | 744 request.setCrossOriginAccessControl(document().securityOrigin(), cro
ssOriginMode); |
| 745 setFetchFollowingCORS(); | 745 setFetchFollowingCORS(); |
| 746 } | 746 } |
| 747 setResource(document().fetcher()->fetchCSSStyleSheet(request)); | 747 setResource(document().fetcher()->fetchCSSStyleSheet(request)); |
| 748 | 748 |
| 749 if (!resource()) { | 749 if (!resource()) { |
| 750 // The request may have been denied if (for example) the stylesheet
is local and the document is remote, or if there was a Content Security Policy F
ailure. | 750 // The request may have been denied if (for example) the stylesheet
is local and the document is remote, or if there was a Content Security Policy F
ailure. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 775 removePendingSheet(); | 775 removePendingSheet(); |
| 776 } | 776 } |
| 777 | 777 |
| 778 DEFINE_TRACE(LinkStyle) | 778 DEFINE_TRACE(LinkStyle) |
| 779 { | 779 { |
| 780 visitor->trace(m_sheet); | 780 visitor->trace(m_sheet); |
| 781 LinkResource::trace(visitor); | 781 LinkResource::trace(visitor); |
| 782 } | 782 } |
| 783 | 783 |
| 784 } // namespace blink | 784 } // namespace blink |
| OLD | NEW |