This source file includes following definitions.
- create
- isURLAttribute
- insertedByParser
#include "config.h"
#include "core/html/HTMLHtmlElement.h"
#include "HTMLNames.h"
#include "core/dom/Document.h"
#include "core/dom/DocumentParser.h"
#include "core/frame/LocalFrame.h"
#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/appcache/ApplicationCacheHost.h"
namespace WebCore {
using namespace HTMLNames;
HTMLHtmlElement::HTMLHtmlElement(Document& document)
: HTMLElement(htmlTag, document)
{
ScriptWrappable::init(this);
}
PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(Document& document)
{
return adoptRef(new HTMLHtmlElement(document));
}
bool HTMLHtmlElement::isURLAttribute(const Attribute& attribute) const
{
return attribute.name() == manifestAttr || HTMLElement::isURLAttribute(attribute);
}
void HTMLHtmlElement::insertedByParser()
{
if (!document().parser() || !document().parser()->documentWasLoadedAsPartOfNavigation())
return;
if (!document().frame())
return;
DocumentLoader* documentLoader = document().frame()->loader().documentLoader();
if (!documentLoader)
return;
const AtomicString& manifest = fastGetAttribute(manifestAttr);
if (manifest.isEmpty())
documentLoader->applicationCacheHost()->selectCacheWithoutManifest();
else
documentLoader->applicationCacheHost()->selectCacheWithManifest(document().completeURL(manifest));
}
}