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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 mediaQueryMatches = evaluator.eval(media.get()); | 538 mediaQueryMatches = evaluator.eval(media.get()); |
539 } | 539 } |
540 | 540 |
541 // Don't hold up render tree construction and script execution on styles
heets | 541 // Don't hold up render tree construction and script execution on styles
heets |
542 // that are not needed for the rendering at the moment. | 542 // that are not needed for the rendering at the moment. |
543 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); | 543 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); |
544 addPendingSheet(blocking ? Blocking : NonBlocking); | 544 addPendingSheet(blocking ? Blocking : NonBlocking); |
545 | 545 |
546 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. | 546 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. |
547 ResourceLoadPriority priority = blocking ? ResourceLoadPriorityUnresolve
d : ResourceLoadPriorityVeryLow; | 547 ResourceLoadPriority priority = blocking ? ResourceLoadPriorityUnresolve
d : ResourceLoadPriorityVeryLow; |
548 CachedResourceRequest request(ResourceRequest(document()->completeURL(ur
l)), charset, priority); | 548 CachedResourceRequest request(ResourceRequest(document()->completeURL(ur
l)), m_owner->localName(), charset, priority); |
549 request.setInitiator(m_owner); | |
550 m_cachedSheet = document()->cachedResourceLoader()->requestCSSStyleSheet
(request); | 549 m_cachedSheet = document()->cachedResourceLoader()->requestCSSStyleSheet
(request); |
551 | 550 |
552 if (m_cachedSheet) | 551 if (m_cachedSheet) |
553 m_cachedSheet->addClient(this); | 552 m_cachedSheet->addClient(this); |
554 else { | 553 else { |
555 // The request may have been denied if (for example) the stylesheet
is local and the document is remote. | 554 // The request may have been denied if (for example) the stylesheet
is local and the document is remote. |
556 m_loading = false; | 555 m_loading = false; |
557 removePendingSheet(); | 556 removePendingSheet(); |
558 } | 557 } |
559 } else if (m_sheet) { | 558 } else if (m_sheet) { |
(...skipping 12 matching lines...) Expand all Loading... |
572 void LinkStyle::ownerRemoved() | 571 void LinkStyle::ownerRemoved() |
573 { | 572 { |
574 if (m_sheet) | 573 if (m_sheet) |
575 clearSheet(); | 574 clearSheet(); |
576 | 575 |
577 if (styleSheetIsLoading()) | 576 if (styleSheetIsLoading()) |
578 removePendingSheet(RemovePendingSheetNotifyLater); | 577 removePendingSheet(RemovePendingSheetNotifyLater); |
579 } | 578 } |
580 | 579 |
581 } // namespace WebCore | 580 } // namespace WebCore |
OLD | NEW |