| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 DEFINE_NODE_FACTORY(HTMLHtmlElement) | 43 DEFINE_NODE_FACTORY(HTMLHtmlElement) |
| 44 | 44 |
| 45 bool HTMLHtmlElement::isURLAttribute(const Attribute& attribute) const | 45 bool HTMLHtmlElement::isURLAttribute(const Attribute& attribute) const |
| 46 { | 46 { |
| 47 return attribute.name() == manifestAttr || HTMLElement::isURLAttribute(attri
bute); | 47 return attribute.name() == manifestAttr || HTMLElement::isURLAttribute(attri
bute); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void HTMLHtmlElement::insertedByParser() | 50 void HTMLHtmlElement::insertedByParser() |
| 51 { | 51 { |
| 52 // When parsing a fragment, its dummy document has a null parser. | 52 // When parsing a fragment, its dummy document has a null parser. |
| 53 if (!document().parser() || !document().parser()->documentWasLoadedAsPartOfN
avigation()) | 53 if (!document().parser()) |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 maybeSetupApplicationCache(); |
| 57 |
| 58 document().parser()->documentElementAvailable(); |
| 59 if (document().frame()) { |
| 60 document().frame()->loader().dispatchDocumentElementAvailable(); |
| 61 document().frame()->loader().runScriptsAtDocumentElementAvailable(); |
| 62 // runScriptsAtDocumentElementAvailable might have invalidated m_documen
t. |
| 63 } |
| 64 } |
| 65 |
| 66 void HTMLHtmlElement::maybeSetupApplicationCache() |
| 67 { |
| 56 if (!document().frame()) | 68 if (!document().frame()) |
| 57 return; | 69 return; |
| 58 | 70 |
| 59 DocumentLoader* documentLoader = document().frame()->loader().documentLoader
(); | 71 DocumentLoader* documentLoader = document().frame()->loader().documentLoader
(); |
| 60 if (!documentLoader) | 72 if (!documentLoader || !document().parser()->documentWasLoadedAsPartOfNaviga
tion()) |
| 61 return; | 73 return; |
| 62 | |
| 63 const AtomicString& manifest = fastGetAttribute(manifestAttr); | 74 const AtomicString& manifest = fastGetAttribute(manifestAttr); |
| 64 if (manifest.isEmpty()) | 75 if (manifest.isEmpty()) |
| 65 documentLoader->applicationCacheHost()->selectCacheWithoutManifest(); | 76 documentLoader->applicationCacheHost()->selectCacheWithoutManifest(); |
| 66 else | 77 else |
| 67 documentLoader->applicationCacheHost()->selectCacheWithManifest(document
().completeURL(manifest)); | 78 documentLoader->applicationCacheHost()->selectCacheWithManifest(document
().completeURL(manifest)); |
| 68 } | 79 } |
| 69 | 80 |
| 70 } // namespace blink | 81 } // namespace blink |
| OLD | NEW |