OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) | 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2004, 2006, 2010 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2006, 2010 Apple Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "core/dom/DocumentParser.h" | 29 #include "core/dom/DocumentParser.h" |
30 #include "core/frame/LocalFrame.h" | 30 #include "core/frame/LocalFrame.h" |
31 #include "core/loader/DocumentLoader.h" | 31 #include "core/loader/DocumentLoader.h" |
32 #include "core/loader/FrameLoader.h" | 32 #include "core/loader/FrameLoader.h" |
33 #include "core/loader/appcache/ApplicationCacheHost.h" | 33 #include "core/loader/appcache/ApplicationCacheHost.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 using namespace HTMLNames; | 37 using namespace HTMLNames; |
38 | 38 |
39 HTMLHtmlElement::HTMLHtmlElement(Document& document) | 39 inline HTMLHtmlElement::HTMLHtmlElement(Document& document) |
40 : HTMLElement(htmlTag, document) | 40 : HTMLElement(htmlTag, document) |
41 { | 41 { |
42 ScriptWrappable::init(this); | 42 ScriptWrappable::init(this); |
43 } | 43 } |
44 | 44 |
45 PassRefPtrWillBeRawPtr<HTMLHtmlElement> HTMLHtmlElement::create(Document& docume
nt) | 45 DEFINE_NODE_FACTORY(HTMLHtmlElement) |
46 { | |
47 return adoptRefWillBeRefCountedGarbageCollected(new HTMLHtmlElement(document
)); | |
48 } | |
49 | 46 |
50 bool HTMLHtmlElement::isURLAttribute(const Attribute& attribute) const | 47 bool HTMLHtmlElement::isURLAttribute(const Attribute& attribute) const |
51 { | 48 { |
52 return attribute.name() == manifestAttr || HTMLElement::isURLAttribute(attri
bute); | 49 return attribute.name() == manifestAttr || HTMLElement::isURLAttribute(attri
bute); |
53 } | 50 } |
54 | 51 |
55 void HTMLHtmlElement::insertedByParser() | 52 void HTMLHtmlElement::insertedByParser() |
56 { | 53 { |
57 // When parsing a fragment, its dummy document has a null parser. | 54 // When parsing a fragment, its dummy document has a null parser. |
58 if (!document().parser() || !document().parser()->documentWasLoadedAsPartOfN
avigation()) | 55 if (!document().parser() || !document().parser()->documentWasLoadedAsPartOfN
avigation()) |
59 return; | 56 return; |
60 | 57 |
61 if (!document().frame()) | 58 if (!document().frame()) |
62 return; | 59 return; |
63 | 60 |
64 DocumentLoader* documentLoader = document().frame()->loader().documentLoader
(); | 61 DocumentLoader* documentLoader = document().frame()->loader().documentLoader
(); |
65 if (!documentLoader) | 62 if (!documentLoader) |
66 return; | 63 return; |
67 | 64 |
68 const AtomicString& manifest = fastGetAttribute(manifestAttr); | 65 const AtomicString& manifest = fastGetAttribute(manifestAttr); |
69 if (manifest.isEmpty()) | 66 if (manifest.isEmpty()) |
70 documentLoader->applicationCacheHost()->selectCacheWithoutManifest(); | 67 documentLoader->applicationCacheHost()->selectCacheWithoutManifest(); |
71 else | 68 else |
72 documentLoader->applicationCacheHost()->selectCacheWithManifest(document
().completeURL(manifest)); | 69 documentLoader->applicationCacheHost()->selectCacheWithManifest(document
().completeURL(manifest)); |
73 } | 70 } |
74 | 71 |
75 } | 72 } |
OLD | NEW |