OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2012 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 CSSStyleSheetResource::MIMETypeCheck mimeTypeCheck = isQuirksModeBehavior(m_
parserContext.mode()) && isSameOriginRequest ? CSSStyleSheetResource::MIMETypeCh
eck::Lax : CSSStyleSheetResource::MIMETypeCheck::Strict; | 283 CSSStyleSheetResource::MIMETypeCheck mimeTypeCheck = isQuirksModeBehavior(m_
parserContext.mode()) && isSameOriginRequest ? CSSStyleSheetResource::MIMETypeCh
eck::Lax : CSSStyleSheetResource::MIMETypeCheck::Strict; |
284 String sheetText = cachedStyleSheet->sheetText(mimeTypeCheck); | 284 String sheetText = cachedStyleSheet->sheetText(mimeTypeCheck); |
285 | 285 |
286 const ResourceResponse& response = cachedStyleSheet->response(); | 286 const ResourceResponse& response = cachedStyleSheet->response(); |
287 m_sourceMapURL = response.httpHeaderField("SourceMap"); | 287 m_sourceMapURL = response.httpHeaderField("SourceMap"); |
288 if (m_sourceMapURL.isEmpty()) { | 288 if (m_sourceMapURL.isEmpty()) { |
289 // Try to get deprecated header. | 289 // Try to get deprecated header. |
290 m_sourceMapURL = response.httpHeaderField("X-SourceMap"); | 290 m_sourceMapURL = response.httpHeaderField("X-SourceMap"); |
291 } | 291 } |
292 | 292 |
293 Document* singleOwnerDoc = singleOwnerDocument(); | 293 CSSParserContext context(parserContext(), UseCounter::getFrom(this)); |
294 CSSParserContext context(parserContext(), singleOwnerDoc ? singleOwnerDoc->f
rame() : 0, UseCounter::getFrom(this)); | |
295 CSSParser::parseSheet(context, this, sheetText); | 294 CSSParser::parseSheet(context, this, sheetText); |
296 } | 295 } |
297 | 296 |
298 void StyleSheetContents::parseString(const String& sheetText) | 297 void StyleSheetContents::parseString(const String& sheetText) |
299 { | 298 { |
300 parseStringAtPosition(sheetText, TextPosition::minimumPosition()); | 299 parseStringAtPosition(sheetText, TextPosition::minimumPosition()); |
301 } | 300 } |
302 | 301 |
303 void StyleSheetContents::parseStringAtPosition(const String& sheetText, const Te
xtPosition& startPosition) | 302 void StyleSheetContents::parseStringAtPosition(const String& sheetText, const Te
xtPosition& startPosition) |
304 { | 303 { |
305 Document* singleOwnerDoc = singleOwnerDocument(); | 304 CSSParserContext context(parserContext(), UseCounter::getFrom(this)); |
306 CSSParserContext context(parserContext(), singleOwnerDoc ? singleOwnerDoc->f
rame() : 0, UseCounter::getFrom(this)); | |
307 CSSParser::parseSheet(context, this, sheetText); | 305 CSSParser::parseSheet(context, this, sheetText); |
308 } | 306 } |
309 | 307 |
310 bool StyleSheetContents::isLoading() const | 308 bool StyleSheetContents::isLoading() const |
311 { | 309 { |
312 for (unsigned i = 0; i < m_importRules.size(); ++i) { | 310 for (unsigned i = 0; i < m_importRules.size(); ++i) { |
313 if (m_importRules[i]->isLoading()) | 311 if (m_importRules[i]->isLoading()) |
314 return true; | 312 return true; |
315 } | 313 } |
316 return false; | 314 return false; |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 visitor->trace(m_ownerRule); | 625 visitor->trace(m_ownerRule); |
628 visitor->trace(m_importRules); | 626 visitor->trace(m_importRules); |
629 visitor->trace(m_childRules); | 627 visitor->trace(m_childRules); |
630 visitor->trace(m_loadingClients); | 628 visitor->trace(m_loadingClients); |
631 visitor->trace(m_completedClients); | 629 visitor->trace(m_completedClients); |
632 visitor->trace(m_ruleSet); | 630 visitor->trace(m_ruleSet); |
633 #endif | 631 #endif |
634 } | 632 } |
635 | 633 |
636 } | 634 } |
OLD | NEW |