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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 } | 591 } |
592 | 592 |
593 // Don't hold up render tree construction and script execution on styles
heets | 593 // Don't hold up render tree construction and script execution on styles
heets |
594 // that are not needed for the rendering at the moment. | 594 // that are not needed for the rendering at the moment. |
595 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); | 595 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); |
596 addPendingSheet(blocking ? Blocking : NonBlocking); | 596 addPendingSheet(blocking ? Blocking : NonBlocking); |
597 | 597 |
598 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. | 598 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. |
599 FetchRequest request = builder.build(blocking); | 599 FetchRequest request = builder.build(blocking); |
600 AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::cros
soriginAttr); | 600 AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::cros
soriginAttr); |
601 if (!crossOriginMode.isNull()) { | 601 if (!crossOriginMode.isNull()) |
602 StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMo
de, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials; | 602 request.setCrossOriginAccessControl(document().securityOrigin(), cro
ssOriginMode); |
603 request.setCrossOriginAccessControl(document().securityOrigin(), all
owCredentials); | |
604 } | |
605 setResource(document().fetcher()->fetchCSSStyleSheet(request)); | 603 setResource(document().fetcher()->fetchCSSStyleSheet(request)); |
606 | 604 |
607 if (!resource()) { | 605 if (!resource()) { |
608 // The request may have been denied if (for example) the stylesheet
is local and the document is remote. | 606 // The request may have been denied if (for example) the stylesheet
is local and the document is remote. |
609 m_loading = false; | 607 m_loading = false; |
610 removePendingSheet(); | 608 removePendingSheet(); |
611 } | 609 } |
612 } else if (m_sheet) { | 610 } else if (m_sheet) { |
613 // we no longer contain a stylesheet, e.g. perhaps rel or type was chang
ed | 611 // we no longer contain a stylesheet, e.g. perhaps rel or type was chang
ed |
614 RefPtr<StyleSheet> removedSheet = m_sheet; | 612 RefPtr<StyleSheet> removedSheet = m_sheet; |
(...skipping 11 matching lines...) Expand all Loading... |
626 void LinkStyle::ownerRemoved() | 624 void LinkStyle::ownerRemoved() |
627 { | 625 { |
628 if (m_sheet) | 626 if (m_sheet) |
629 clearSheet(); | 627 clearSheet(); |
630 | 628 |
631 if (styleSheetIsLoading()) | 629 if (styleSheetIsLoading()) |
632 removePendingSheet(RemovePendingSheetNotifyLater); | 630 removePendingSheet(RemovePendingSheetNotifyLater); |
633 } | 631 } |
634 | 632 |
635 } // namespace WebCore | 633 } // namespace WebCore |
OLD | NEW |