| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Rob Buis | 2 * Copyright (C) 2006, 2007 Rob Buis |
| 3 * Copyright (C) 2008 Apple, Inc. All rights reserved. | 3 * Copyright (C) 2008 Apple, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (m_sheet) { | 123 if (m_sheet) { |
| 124 if (m_sheet->isLoading()) | 124 if (m_sheet->isLoading()) |
| 125 document.styleEngine()->removePendingSheet(e); | 125 document.styleEngine()->removePendingSheet(e); |
| 126 clearSheet(); | 126 clearSheet(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 // If type is empty or CSS, this is a CSS style sheet. | 129 // If type is empty or CSS, this is a CSS style sheet. |
| 130 const AtomicString& type = this->type(); | 130 const AtomicString& type = this->type(); |
| 131 bool passesContentSecurityPolicyChecks = document.contentSecurityPolicy()->a
llowStyleHash(text) || document.contentSecurityPolicy()->allowStyleNonce(e->fast
GetAttribute(HTMLNames::nonceAttr)) || document.contentSecurityPolicy()->allowIn
lineStyle(e->document().url(), m_startPosition.m_line); | 131 bool passesContentSecurityPolicyChecks = document.contentSecurityPolicy()->a
llowStyleHash(text) || document.contentSecurityPolicy()->allowStyleNonce(e->fast
GetAttribute(HTMLNames::nonceAttr)) || document.contentSecurityPolicy()->allowIn
lineStyle(e->document().url(), m_startPosition.m_line); |
| 132 if (isCSS(e, type) && passesContentSecurityPolicyChecks) { | 132 if (isCSS(e, type) && passesContentSecurityPolicyChecks) { |
| 133 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media()); | 133 RefPtrWillBeRawPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(m
edia()); |
| 134 | 134 |
| 135 MediaQueryEvaluator screenEval("screen", true); | 135 MediaQueryEvaluator screenEval("screen", true); |
| 136 MediaQueryEvaluator printEval("print", true); | 136 MediaQueryEvaluator printEval("print", true); |
| 137 if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.g
et())) { | 137 if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.g
et())) { |
| 138 m_loading = true; | 138 m_loading = true; |
| 139 TextPosition startPosition = m_startPosition == TextPosition::belowR
angePosition() ? TextPosition::minimumPosition() : m_startPosition; | 139 TextPosition startPosition = m_startPosition == TextPosition::belowR
angePosition() ? TextPosition::minimumPosition() : m_startPosition; |
| 140 m_sheet = StyleEngine::createSheet(e, text, startPosition, m_created
ByParser); | 140 m_sheet = StyleEngine::createSheet(e, text, startPosition, m_created
ByParser); |
| 141 m_sheet->setMediaQueries(mediaQueries.release()); | 141 m_sheet->setMediaQueries(mediaQueries.release()); |
| 142 m_loading = false; | 142 m_loading = false; |
| 143 } | 143 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 162 document.styleEngine()->removePendingSheet(m_sheet->ownerNode()); | 162 document.styleEngine()->removePendingSheet(m_sheet->ownerNode()); |
| 163 return true; | 163 return true; |
| 164 } | 164 } |
| 165 | 165 |
| 166 void StyleElement::startLoadingDynamicSheet(Document& document) | 166 void StyleElement::startLoadingDynamicSheet(Document& document) |
| 167 { | 167 { |
| 168 document.styleEngine()->addPendingSheet(); | 168 document.styleEngine()->addPendingSheet(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } | 171 } |
| OLD | NEW |