HTMLParamElement.cpp [plain text]
#include "config.h"
#include "HTMLParamElement.h"
#include "Document.h"
#include "HTMLNames.h"
namespace WebCore {
using namespace HTMLNames;
inline HTMLParamElement::HTMLParamElement(const QualifiedName& tagName, Document& document)
: HTMLElement(tagName, document)
{
ASSERT(hasTagName(paramTag));
}
Ref<HTMLParamElement> HTMLParamElement::create(const QualifiedName& tagName, Document& document)
{
return adoptRef(*new HTMLParamElement(tagName, document));
}
String HTMLParamElement::name() const
{
if (hasName())
return getNameAttribute();
return document().isHTMLDocument() ? emptyAtom : getIdAttribute();
}
String HTMLParamElement::value() const
{
return fastGetAttribute(valueAttr);
}
bool HTMLParamElement::isURLParameter(const String& name)
{
return equalIgnoringCase(name, "data") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "src");
}
bool HTMLParamElement::isURLAttribute(const Attribute& attribute) const
{
if (attribute.name() == valueAttr && isURLParameter(name()))
return true;
return HTMLElement::isURLAttribute(attribute);
}
void HTMLParamElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) const
{
HTMLElement::addSubresourceAttributeURLs(urls);
if (!isURLParameter(name()))
return;
addSubresourceURL(urls, document().completeURL(value()));
}
}