| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 ASSERT(e); | 126 ASSERT(e); |
| 127 ASSERT(e->inDocument()); | 127 ASSERT(e->inDocument()); |
| 128 Document& document = e->document(); | 128 Document& document = e->document(); |
| 129 if (m_sheet) | 129 if (m_sheet) |
| 130 clearSheet(e); | 130 clearSheet(e); |
| 131 | 131 |
| 132 // If type is empty or CSS, this is a CSS style sheet. | 132 // If type is empty or CSS, this is a CSS style sheet. |
| 133 const AtomicString& type = this->type(); | 133 const AtomicString& type = this->type(); |
| 134 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); | 134 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); |
| 135 if (isCSS(e, type) && passesContentSecurityPolicyChecks) { | 135 if (isCSS(e, type) && passesContentSecurityPolicyChecks) { |
| 136 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media()); | 136 RefPtrWillBeRawPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(m
edia()); |
| 137 | 137 |
| 138 MediaQueryEvaluator screenEval("screen", true); | 138 MediaQueryEvaluator screenEval("screen", true); |
| 139 MediaQueryEvaluator printEval("print", true); | 139 MediaQueryEvaluator printEval("print", true); |
| 140 if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.g
et())) { | 140 if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.g
et())) { |
| 141 m_loading = true; | 141 m_loading = true; |
| 142 TextPosition startPosition = m_startPosition == TextPosition::belowR
angePosition() ? TextPosition::minimumPosition() : m_startPosition; | 142 TextPosition startPosition = m_startPosition == TextPosition::belowR
angePosition() ? TextPosition::minimumPosition() : m_startPosition; |
| 143 m_sheet = StyleEngine::createSheet(e, text, startPosition, m_created
ByParser); | 143 m_sheet = StyleEngine::createSheet(e, text, startPosition, m_created
ByParser); |
| 144 m_sheet->setMediaQueries(mediaQueries.release()); | 144 m_sheet->setMediaQueries(mediaQueries.release()); |
| 145 m_loading = false; | 145 m_loading = false; |
| 146 } | 146 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 165 document.styleEngine()->removePendingSheet(m_sheet->ownerNode()); | 165 document.styleEngine()->removePendingSheet(m_sheet->ownerNode()); |
| 166 return true; | 166 return true; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void StyleElement::startLoadingDynamicSheet(Document& document) | 169 void StyleElement::startLoadingDynamicSheet(Document& document) |
| 170 { | 170 { |
| 171 document.styleEngine()->addPendingSheet(); | 171 document.styleEngine()->addPendingSheet(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } | 174 } |
| OLD | NEW |