| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 if (RuntimeEnabledFeatures::xsltEnabled()) | 159 if (RuntimeEnabledFeatures::xsltEnabled()) |
| 160 resource = XSLStyleSheetResource::fetch(request, document().fetcher(
)); | 160 resource = XSLStyleSheetResource::fetch(request, document().fetcher(
)); |
| 161 } else { | 161 } else { |
| 162 request.setCharset(charset.isEmpty() ? document().characterSet() : chars
et); | 162 request.setCharset(charset.isEmpty() ? document().characterSet() : chars
et); |
| 163 resource = CSSStyleSheetResource::fetch(request, document().fetcher()); | 163 resource = CSSStyleSheetResource::fetch(request, document().fetcher()); |
| 164 } | 164 } |
| 165 | 165 |
| 166 if (resource) { | 166 if (resource) { |
| 167 m_loading = true; | 167 m_loading = true; |
| 168 if (!m_isXSL) | 168 if (!m_isXSL) |
| 169 document().styleEngine().addPendingSheet(); | 169 document().styleEngine().addPendingSheet(m_styleEngineContext); |
| 170 setResource(resource); | 170 setResource(resource); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool ProcessingInstruction::isLoading() const | 174 bool ProcessingInstruction::isLoading() const |
| 175 { | 175 { |
| 176 if (m_loading) | 176 if (m_loading) |
| 177 return true; | 177 return true; |
| 178 if (!m_sheet) | 178 if (!m_sheet) |
| 179 return false; | 179 return false; |
| 180 return m_sheet->isLoading(); | 180 return m_sheet->isLoading(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 bool ProcessingInstruction::sheetLoaded() | 183 bool ProcessingInstruction::sheetLoaded() |
| 184 { | 184 { |
| 185 if (!isLoading()) { | 185 if (!isLoading()) { |
| 186 if (!DocumentXSLT::sheetLoaded(document(), this)) | 186 if (!DocumentXSLT::sheetLoaded(document(), this)) |
| 187 document().styleEngine().removePendingSheet(this); | 187 document().styleEngine().removePendingSheet(this, m_styleEngineConte
xt); |
| 188 return true; | 188 return true; |
| 189 } | 189 } |
| 190 return false; | 190 return false; |
| 191 } | 191 } |
| 192 | 192 |
| 193 void ProcessingInstruction::setCSSStyleSheet(const String& href, const KURL& bas
eURL, const String& charset, const CSSStyleSheetResource* sheet) | 193 void ProcessingInstruction::setCSSStyleSheet(const String& href, const KURL& bas
eURL, const String& charset, const CSSStyleSheetResource* sheet) |
| 194 { | 194 { |
| 195 if (!inShadowIncludingDocument()) { | 195 if (!inShadowIncludingDocument()) { |
| 196 DCHECK(!m_sheet); | 196 DCHECK(!m_sheet); |
| 197 return; | 197 return; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 281 |
| 282 // If we're in document teardown, then we don't need to do any notification
of our sheet's removal. | 282 // If we're in document teardown, then we don't need to do any notification
of our sheet's removal. |
| 283 if (document().isActive()) | 283 if (document().isActive()) |
| 284 document().styleEngine().setNeedsActiveStyleUpdate(removedSheet, FullSty
leUpdate); | 284 document().styleEngine().setNeedsActiveStyleUpdate(removedSheet, FullSty
leUpdate); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void ProcessingInstruction::clearSheet() | 287 void ProcessingInstruction::clearSheet() |
| 288 { | 288 { |
| 289 DCHECK(m_sheet); | 289 DCHECK(m_sheet); |
| 290 if (m_sheet->isLoading()) | 290 if (m_sheet->isLoading()) |
| 291 document().styleEngine().removePendingSheet(this); | 291 document().styleEngine().removePendingSheet(this, m_styleEngineContext); |
| 292 m_sheet.release()->clearOwnerNode(); | 292 m_sheet.release()->clearOwnerNode(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 DEFINE_TRACE(ProcessingInstruction) | 295 DEFINE_TRACE(ProcessingInstruction) |
| 296 { | 296 { |
| 297 visitor->trace(m_sheet); | 297 visitor->trace(m_sheet); |
| 298 visitor->trace(m_listenerForXSLT); | 298 visitor->trace(m_listenerForXSLT); |
| 299 CharacterData::trace(visitor); | 299 CharacterData::trace(visitor); |
| 300 ResourceOwner<StyleSheetResource>::trace(visitor); | 300 ResourceOwner<StyleSheetResource>::trace(visitor); |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace blink | 303 } // namespace blink |
| OLD | NEW |