OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2008, 2009 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // to kick off import/include loads that can hang off some parent sh
eet. | 115 // to kick off import/include loads that can hang off some parent sh
eet. |
116 if (m_isXSL) { | 116 if (m_isXSL) { |
117 KURL finalURL(ParsedURLString, m_localHref); | 117 KURL finalURL(ParsedURLString, m_localHref); |
118 m_sheet = XSLStyleSheet::createEmbedded(this, finalURL); | 118 m_sheet = XSLStyleSheet::createEmbedded(this, finalURL); |
119 m_loading = false; | 119 m_loading = false; |
120 } | 120 } |
121 } else { | 121 } else { |
122 clearResource(); | 122 clearResource(); |
123 | 123 |
124 String url = document().completeURL(href).string(); | 124 String url = document().completeURL(href).string(); |
125 if (!dispatchBeforeLoadEvent(url)) | |
126 return; | |
127 | 125 |
128 ResourcePtr<StyleSheetResource> resource; | 126 ResourcePtr<StyleSheetResource> resource; |
129 FetchRequest request(ResourceRequest(document().completeURL(href)),
FetchInitiatorTypeNames::processinginstruction); | 127 FetchRequest request(ResourceRequest(document().completeURL(href)),
FetchInitiatorTypeNames::processinginstruction); |
130 if (m_isXSL) { | 128 if (m_isXSL) { |
131 resource = document().fetcher()->fetchXSLStyleSheet(request); | 129 resource = document().fetcher()->fetchXSLStyleSheet(request); |
132 } else { | 130 } else { |
133 String charset = attrs.get("charset"); | 131 String charset = attrs.get("charset"); |
134 if (charset.isEmpty()) | 132 if (charset.isEmpty()) |
135 charset = document().charset(); | 133 charset = document().charset(); |
136 request.setCharset(charset); | 134 request.setCharset(charset); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 m_sheet->clearOwnerNode(); | 244 m_sheet->clearOwnerNode(); |
247 m_sheet = nullptr; | 245 m_sheet = nullptr; |
248 } | 246 } |
249 | 247 |
250 // If we're in document teardown, then we don't need to do any notification
of our sheet's removal. | 248 // If we're in document teardown, then we don't need to do any notification
of our sheet's removal. |
251 if (document().isActive()) | 249 if (document().isActive()) |
252 document().removedStyleSheet(removedSheet.get()); | 250 document().removedStyleSheet(removedSheet.get()); |
253 } | 251 } |
254 | 252 |
255 } // namespace | 253 } // namespace |
OLD | NEW |