| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 412 |
| 413 m_loading = false; | 413 m_loading = false; |
| 414 sheetLoaded(); | 414 sheetLoaded(); |
| 415 notifyLoadedSheetAndAllCriticalSubresources(false); | 415 notifyLoadedSheetAndAllCriticalSubresources(false); |
| 416 return; | 416 return; |
| 417 } | 417 } |
| 418 | 418 |
| 419 RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(href, par
serContext); | 419 RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(href, par
serContext); |
| 420 | 420 |
| 421 m_sheet = CSSStyleSheet::create(styleSheet, m_owner); | 421 m_sheet = CSSStyleSheet::create(styleSheet, m_owner); |
| 422 m_sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(m_ow
ner->media())); | 422 m_sheet->setMediaQueries(MediaQuerySet::create(m_owner->media())); |
| 423 m_sheet->setTitle(m_owner->title()); | 423 m_sheet->setTitle(m_owner->title()); |
| 424 | 424 |
| 425 styleSheet->parseAuthorStyleSheet(cachedStyleSheet, m_owner->document()->sec
urityOrigin()); | 425 styleSheet->parseAuthorStyleSheet(cachedStyleSheet, m_owner->document()->sec
urityOrigin()); |
| 426 | 426 |
| 427 m_loading = false; | 427 m_loading = false; |
| 428 styleSheet->notifyLoadedSheet(cachedStyleSheet); | 428 styleSheet->notifyLoadedSheet(cachedStyleSheet); |
| 429 styleSheet->checkLoaded(); | 429 styleSheet->checkLoaded(); |
| 430 | 430 |
| 431 if (styleSheet->isCacheable()) | 431 if (styleSheet->isCacheable()) |
| 432 const_cast<CachedCSSStyleSheet*>(cachedStyleSheet)->saveParsedStyleSheet
(styleSheet); | 432 const_cast<CachedCSSStyleSheet*>(cachedStyleSheet)->saveParsedStyleSheet
(styleSheet); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 } | 566 } |
| 567 | 567 |
| 568 if (!m_owner->shouldLoadLink()) | 568 if (!m_owner->shouldLoadLink()) |
| 569 return; | 569 return; |
| 570 | 570 |
| 571 m_loading = true; | 571 m_loading = true; |
| 572 | 572 |
| 573 bool mediaQueryMatches = true; | 573 bool mediaQueryMatches = true; |
| 574 if (!m_owner->media().isEmpty()) { | 574 if (!m_owner->media().isEmpty()) { |
| 575 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument(
document()); | 575 RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument(
document()); |
| 576 RefPtr<MediaQuerySet> media = MediaQuerySet::createAllowingDescripti
onSyntax(m_owner->media()); | 576 RefPtr<MediaQuerySet> media = MediaQuerySet::create(m_owner->media()
); |
| 577 MediaQueryEvaluator evaluator(document()->frame()->view()->mediaType
(), document()->frame(), documentStyle.get()); | 577 MediaQueryEvaluator evaluator(document()->frame()->view()->mediaType
(), document()->frame(), documentStyle.get()); |
| 578 mediaQueryMatches = evaluator.eval(media.get()); | 578 mediaQueryMatches = evaluator.eval(media.get()); |
| 579 } | 579 } |
| 580 | 580 |
| 581 // Don't hold up render tree construction and script execution on styles
heets | 581 // Don't hold up render tree construction and script execution on styles
heets |
| 582 // that are not needed for the rendering at the moment. | 582 // that are not needed for the rendering at the moment. |
| 583 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); | 583 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); |
| 584 addPendingSheet(blocking ? Blocking : NonBlocking); | 584 addPendingSheet(blocking ? Blocking : NonBlocking); |
| 585 | 585 |
| 586 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. | 586 // Load stylesheets that are not needed for the rendering immediately wi
th low priority. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 610 void LinkStyle::ownerRemoved() | 610 void LinkStyle::ownerRemoved() |
| 611 { | 611 { |
| 612 if (m_sheet) | 612 if (m_sheet) |
| 613 clearSheet(); | 613 clearSheet(); |
| 614 | 614 |
| 615 if (styleSheetIsLoading()) | 615 if (styleSheetIsLoading()) |
| 616 removePendingSheet(RemovePendingSheetNotifyLater); | 616 removePendingSheet(RemovePendingSheetNotifyLater); |
| 617 } | 617 } |
| 618 | 618 |
| 619 } // namespace WebCore | 619 } // namespace WebCore |
| OLD | NEW |