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 14 matching lines...) Expand all Loading... |
25 #include "core/css/MediaList.h" | 25 #include "core/css/MediaList.h" |
26 #include "core/css/StylePropertySet.h" | 26 #include "core/css/StylePropertySet.h" |
27 #include "core/css/StyleRule.h" | 27 #include "core/css/StyleRule.h" |
28 #include "core/css/StyleRuleImport.h" | 28 #include "core/css/StyleRuleImport.h" |
29 #include "core/css/parser/CSSParser.h" | 29 #include "core/css/parser/CSSParser.h" |
30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
31 #include "core/dom/Node.h" | 31 #include "core/dom/Node.h" |
32 #include "core/dom/StyleEngine.h" | 32 #include "core/dom/StyleEngine.h" |
33 #include "core/fetch/CSSStyleSheetResource.h" | 33 #include "core/fetch/CSSStyleSheetResource.h" |
34 #include "core/frame/UseCounter.h" | 34 #include "core/frame/UseCounter.h" |
| 35 #include "core/inspector/InspectorTraceEvents.h" |
35 #include "platform/TraceEvent.h" | 36 #include "platform/TraceEvent.h" |
36 #include "platform/weborigin/SecurityOrigin.h" | 37 #include "platform/weborigin/SecurityOrigin.h" |
37 #include "wtf/Deque.h" | 38 #include "wtf/Deque.h" |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 // Rough size estimate for the memory cache. | 42 // Rough size estimate for the memory cache. |
42 unsigned StyleSheetContents::estimatedSizeInBytes() const | 43 unsigned StyleSheetContents::estimatedSizeInBytes() const |
43 { | 44 { |
44 // Note that this does not take into account size of the strings hanging fro
m various objects. | 45 // Note that this does not take into account size of the strings hanging fro
m various objects. |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 if (prefix.isNull()) | 313 if (prefix.isNull()) |
313 return nullAtom; // No namespace. If an element/attribute has a namespac
e, we won't match it. | 314 return nullAtom; // No namespace. If an element/attribute has a namespac
e, we won't match it. |
314 if (prefix == starAtom) | 315 if (prefix == starAtom) |
315 return starAtom; // We'll match any namespace. | 316 return starAtom; // We'll match any namespace. |
316 return m_namespaces.get(prefix); | 317 return m_namespaces.get(prefix); |
317 } | 318 } |
318 | 319 |
319 void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cach
edStyleSheet, const SecurityOrigin* securityOrigin) | 320 void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cach
edStyleSheet, const SecurityOrigin* securityOrigin) |
320 { | 321 { |
321 TRACE_EVENT0("blink", "StyleSheetContents::parseAuthorStyleSheet"); | 322 TRACE_EVENT0("blink", "StyleSheetContents::parseAuthorStyleSheet"); |
| 323 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ParseAuthorSty
leSheet", "data", InspectorParseAuthorStyleSheetEvent::data(cachedStyleSheet)); |
322 | 324 |
323 bool quirksMode = isQuirksModeBehavior(m_parserContext.mode()); | 325 bool quirksMode = isQuirksModeBehavior(m_parserContext.mode()); |
324 | 326 |
325 bool enforceMIMEType = !quirksMode; | 327 bool enforceMIMEType = !quirksMode; |
326 bool hasValidMIMEType = false; | 328 bool hasValidMIMEType = false; |
327 String sheetText = cachedStyleSheet->sheetText(enforceMIMEType, &hasValidMIM
EType); | 329 String sheetText = cachedStyleSheet->sheetText(enforceMIMEType, &hasValidMIM
EType); |
328 | 330 |
329 CSSParserContext context(parserContext(), UseCounter::getFrom(this)); | 331 CSSParserContext context(parserContext(), UseCounter::getFrom(this)); |
330 CSSParser::parseSheet(context, this, sheetText, TextPosition::minimumPositio
n(), 0, true); | 332 CSSParser::parseSheet(context, this, sheetText, TextPosition::minimumPositio
n(), 0, true); |
331 | 333 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 visitor->trace(m_ownerRule); | 689 visitor->trace(m_ownerRule); |
688 visitor->trace(m_importRules); | 690 visitor->trace(m_importRules); |
689 visitor->trace(m_childRules); | 691 visitor->trace(m_childRules); |
690 visitor->trace(m_loadingClients); | 692 visitor->trace(m_loadingClients); |
691 visitor->trace(m_completedClients); | 693 visitor->trace(m_completedClients); |
692 visitor->trace(m_ruleSet); | 694 visitor->trace(m_ruleSet); |
693 #endif | 695 #endif |
694 } | 696 } |
695 | 697 |
696 } | 698 } |
OLD | NEW |