本文整理汇总了C++中HTMLDocument::addExtraNamedItem方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLDocument::addExtraNamedItem方法的具体用法?C++ HTMLDocument::addExtraNamedItem怎么用?C++ HTMLDocument::addExtraNamedItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLDocument
的用法示例。
在下文中一共展示了HTMLDocument::addExtraNamedItem方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseMappedAttribute
void HTMLAppletElement::parseMappedAttribute(MappedAttribute* attr)
{
if (attr->name() == altAttr ||
attr->name() == archiveAttr ||
attr->name() == codeAttr ||
attr->name() == codebaseAttr ||
attr->name() == mayscriptAttr ||
attr->name() == objectAttr) {
// Do nothing.
} else if (attr->name() == nameAttr) {
const AtomicString& newName = attr->value();
if (inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeNamedItem(m_name);
document->addNamedItem(newName);
}
m_name = newName;
} else if (attr->name() == idAttr) {
const AtomicString& newId = attr->value();
if (inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeExtraNamedItem(m_id);
document->addExtraNamedItem(newId);
}
m_id = newId;
// also call superclass
HTMLPlugInElement::parseMappedAttribute(attr);
} else
HTMLPlugInElement::parseMappedAttribute(attr);
}
示例2: updateDocNamedItem
void HTMLObjectElement::updateDocNamedItem()
{
// The rule is "<object> elements with no children other than
// <param> elements, unknown elements and whitespace can be
// found by name in a document, and other <object> elements cannot."
bool wasNamedItem = m_docNamedItem;
bool isNamedItem = true;
Node* child = firstChild();
while (child && isNamedItem) {
if (child->isElementNode()) {
Element* element = static_cast<Element*>(child);
if (HTMLElement::isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag))
isNamedItem = false;
} else if (child->isTextNode()) {
if (!static_cast<Text*>(child)->containsOnlyWhitespace())
isNamedItem = false;
} else
isNamedItem = false;
child = child->nextSibling();
}
if (isNamedItem != wasNamedItem && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
if (isNamedItem) {
document->addNamedItem(m_name);
document->addExtraNamedItem(m_id);
} else {
document->removeNamedItem(m_name);
document->removeExtraNamedItem(m_id);
}
}
m_docNamedItem = isNamedItem;
}
示例3: parseMappedAttribute
void HTMLIFrameElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == widthAttr)
addCSSLength(attr, CSSPropertyWidth, attr->value());
else if (attr->name() == heightAttr)
addCSSLength(attr, CSSPropertyHeight, attr->value());
else if (attr->name() == alignAttr)
addHTMLAlignment(attr);
else if (attr->name() == nameAttr) {
const AtomicString& newName = attr->value();
if (inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeExtraNamedItem(m_name);
document->addExtraNamedItem(newName);
}
m_name = newName;
} else if (attr->name() == frameborderAttr) {
// Frame border doesn't really match the HTML4 spec definition for iframes. It simply adds
// a presentational hint that the border should be off if set to zero.
if (!attr->isNull() && !attr->value().toInt())
// Add a rule that nulls out our border width.
addCSSLength(attr, CSSPropertyBorderWidth, "0");
} else if (attr->name() == sandboxAttr)
setSandboxFlags(parseSandboxAttribute(attr));
else
HTMLFrameElementBase::parseMappedAttribute(attr);
}
示例4: parseMappedAttribute
void HTMLImageElement::parseMappedAttribute(Attribute* attr)
{
const QualifiedName& attrName = attr->name();
if (attrName == altAttr) {
if (renderer() && renderer()->isImage())
toRenderImage(renderer())->updateAltText();
} else if (attrName == srcAttr)
m_imageLoader.updateFromElementIgnoringPreviousError();
else if (attrName == widthAttr)
addCSSLength(attr, CSSPropertyWidth, attr->value());
else if (attrName == heightAttr)
addCSSLength(attr, CSSPropertyHeight, attr->value());
else if (attrName == borderAttr) {
// border="noborder" -> border="0"
applyBorderAttribute(attr);
} else if (attrName == vspaceAttr) {
addCSSLength(attr, CSSPropertyMarginTop, attr->value());
addCSSLength(attr, CSSPropertyMarginBottom, attr->value());
} else if (attrName == hspaceAttr) {
addCSSLength(attr, CSSPropertyMarginLeft, attr->value());
addCSSLength(attr, CSSPropertyMarginRight, attr->value());
} else if (attrName == alignAttr)
addHTMLAlignment(attr);
else if (attrName == valignAttr)
addCSSProperty(attr, CSSPropertyVerticalAlign, attr->value());
else if (attrName == usemapAttr)
setIsLink(!attr->isNull());
else if (attrName == onabortAttr)
setAttributeEventListener(eventNames().abortEvent, createAttributeEventListener(this, attr));
else if (attrName == onloadAttr)
setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr));
else if (attrName == onbeforeloadAttr)
setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
else if (attrName == compositeAttr) {
if (!parseCompositeOperator(attr->value(), m_compositeOperator))
m_compositeOperator = CompositeSourceOver;
} else if (attrName == nameAttr) {
const AtomicString& newName = attr->value();
if (inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeNamedItem(m_name);
document->addNamedItem(newName);
}
m_name = newName;
} else if (isIdAttributeName(attr->name())) {
const AtomicString& newId = attr->value();
if (inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeExtraNamedItem(m_id);
document->addExtraNamedItem(newId);
}
m_id = newId;
// also call superclass
HTMLElement::parseMappedAttribute(attr);
} else
HTMLElement::parseMappedAttribute(attr);
}
示例5: parseMappedAttribute
void HTMLObjectElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == typeAttr) {
m_serviceType = attr->value().lower();
size_t pos = m_serviceType.find(";");
if (pos != notFound)
m_serviceType = m_serviceType.left(pos);
if (renderer())
setNeedsWidgetUpdate(true);
if (!isImageType() && m_imageLoader)
m_imageLoader.clear();
} else if (attr->name() == dataAttr) {
m_url = stripLeadingAndTrailingHTMLSpaces(attr->value());
if (renderer()) {
setNeedsWidgetUpdate(true);
if (isImageType()) {
if (!m_imageLoader)
m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElementIgnoringPreviousError();
}
}
} else if (attr->name() == classidAttr) {
m_classId = attr->value();
if (renderer())
setNeedsWidgetUpdate(true);
} else if (attr->name() == onloadAttr)
setAttributeEventListener(eventNames().loadEvent, NULL_METHOD_RESULT(this, attr));
else if (attr->name() == onbeforeloadAttr)
setAttributeEventListener(eventNames().beforeloadEvent, NULL_METHOD_RESULT(this, attr));
else if (attr->name() == nameAttr) {
const AtomicString& newName = attr->value();
if (isDocNamedItem() && inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeNamedItem(m_name);
document->addNamedItem(newName);
}
m_name = newName;
} else if (attr->name() == borderAttr) {
addCSSLength(attr, CSSPropertyBorderWidth, attr->value().toInt() ? attr->value() : "0");
addCSSProperty(attr, CSSPropertyBorderTopStyle, CSSValueSolid);
addCSSProperty(attr, CSSPropertyBorderRightStyle, CSSValueSolid);
addCSSProperty(attr, CSSPropertyBorderBottomStyle, CSSValueSolid);
addCSSProperty(attr, CSSPropertyBorderLeftStyle, CSSValueSolid);
} else if (isIdAttributeName(attr->name())) {
const AtomicString& newId = attr->value();
if (isDocNamedItem() && inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeExtraNamedItem(m_id);
document->addExtraNamedItem(newId);
}
m_id = newId;
// also call superclass
HTMLPlugInImageElement::parseMappedAttribute(attr);
} else
HTMLPlugInImageElement::parseMappedAttribute(attr);
}
示例6: insertedIntoDocument
void HTMLObjectElement::insertedIntoDocument()
{
if (isDocNamedItem() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->addNamedItem(m_name);
document->addExtraNamedItem(m_id);
}
HTMLPlugInElement::insertedIntoDocument();
}
示例7: insertedIntoDocument
void HTMLImageElement::insertedIntoDocument()
{
if (document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->addNamedItem(m_name);
document->addExtraNamedItem(m_id);
}
HTMLElement::insertedIntoDocument();
}
示例8: parseMappedAttribute
void HTMLObjectElement::parseMappedAttribute(Attribute* attr)
{
String val = attr->value();
int pos;
if (attr->name() == typeAttr) {
m_serviceType = val.lower();
pos = m_serviceType.find(";");
if (pos != -1)
m_serviceType = m_serviceType.left(pos);
if (renderer())
m_needWidgetUpdate = true;
if (!isImageType() && m_imageLoader)
m_imageLoader.clear();
} else if (attr->name() == dataAttr) {
m_url = deprecatedParseURL(val);
if (renderer())
m_needWidgetUpdate = true;
if (renderer() && isImageType()) {
if (!m_imageLoader)
m_imageLoader.set(new HTMLImageLoader(this));
m_imageLoader->updateFromElementIgnoringPreviousError();
}
} else if (attr->name() == classidAttr) {
m_classId = val;
if (renderer())
m_needWidgetUpdate = true;
} else if (attr->name() == onloadAttr)
setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr));
else if (attr->name() == onbeforeloadAttr)
setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
else if (attr->name() == nameAttr) {
const AtomicString& newName = attr->value();
if (isDocNamedItem() && inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeNamedItem(m_name);
document->addNamedItem(newName);
}
m_name = newName;
} else if (isIdAttributeName(attr->name())) {
const AtomicString& newId = attr->value();
if (isDocNamedItem() && inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeExtraNamedItem(m_id);
document->addExtraNamedItem(newId);
}
m_id = newId;
// also call superclass
HTMLPlugInElement::parseMappedAttribute(attr);
} else
HTMLPlugInElement::parseMappedAttribute(attr);
}
示例9: insertedIntoDocument
void HTMLObjectElement::insertedIntoDocument()
{
HTMLPlugInImageElement::insertedIntoDocument();
if (!inDocument())
return;
if (isDocNamedItem() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->addNamedItem(m_name);
document->addExtraNamedItem(m_id);
}
FormAssociatedElement::insertedIntoDocument();
}
示例10: insertedIntoDocument
void HTMLImageElement::insertedIntoDocument()
{
if (document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->addNamedItem(m_name);
document->addExtraNamedItem(m_id);
}
// If we have been inserted from a renderer-less document,
// our loader may have not fetched the image, so do it now.
if (!m_imageLoader.image())
m_imageLoader.updateFromElement();
HTMLElement::insertedIntoDocument();
}
示例11: parseAttribute
void HTMLIFrameElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == nameAttr) {
if (inDocument() && document()->isHTMLDocument() && !isInShadowTree()) {
HTMLDocument* document = toHTMLDocument(this->document());
document->removeExtraNamedItem(m_name);
document->addExtraNamedItem(value);
}
m_name = value;
} else if (name == sandboxAttr) {
String invalidTokens;
setSandboxFlags(value.isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(value, invalidTokens));
if (!invalidTokens.isNull())
document()->addConsoleMessage(OtherMessageSource, ErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalidTokens);
} else if (name == seamlessAttr) {
// If we're adding or removing the seamless attribute, we need to force the content document to recalculate its StyleResolver.
if (contentDocument())
contentDocument()->styleResolverChanged(DeferRecalcStyle);
} else
HTMLFrameElementBase::parseAttribute(name, value);
}
示例12: insertedIntoDocument
void HTMLImageElement::insertedIntoDocument()
{
if (document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->addNamedItem(m_name);
document->addExtraNamedItem(m_id);
}
// If we have been inserted from a renderer-less document,
// our loader may have not fetched the image, so do it now.
if (!m_imageLoader.image())
m_imageLoader.updateFromElement();
HTMLElement::insertedIntoDocument();
Request* req = cache()->loader()->requestForUrl(src().string());
if (!req)
return;
req->setNode(PassRefPtr<Node>(this));
}
示例13: parseMappedAttribute
void HTMLImageElement::parseMappedAttribute(MappedAttribute* attr)
{
const QualifiedName& attrName = attr->name();
if (attrName == altAttr) {
if (renderer() && renderer()->isImage())
static_cast<RenderImage*>(renderer())->updateAltText();
} else if (attrName == srcAttr)
m_imageLoader.updateFromElement();
else if (attrName == widthAttr)
addCSSLength(attr, CSSPropertyWidth, attr->value());
else if (attrName == heightAttr)
addCSSLength(attr, CSSPropertyHeight, attr->value());
else if (attrName == borderAttr) {
// border="noborder" -> border="0"
addCSSLength(attr, CSSPropertyBorderWidth, attr->value().toInt() ? attr->value() : "0");
addCSSProperty(attr, CSSPropertyBorderTopStyle, CSSValueSolid);
addCSSProperty(attr, CSSPropertyBorderRightStyle, CSSValueSolid);
addCSSProperty(attr, CSSPropertyBorderBottomStyle, CSSValueSolid);
addCSSProperty(attr, CSSPropertyBorderLeftStyle, CSSValueSolid);
} else if (attrName == vspaceAttr) {
addCSSLength(attr, CSSPropertyMarginTop, attr->value());
addCSSLength(attr, CSSPropertyMarginBottom, attr->value());
} else if (attrName == hspaceAttr) {
addCSSLength(attr, CSSPropertyMarginLeft, attr->value());
addCSSLength(attr, CSSPropertyMarginRight, attr->value());
} else if (attrName == alignAttr)
addHTMLAlignment(attr);
else if (attrName == valignAttr)
addCSSProperty(attr, CSSPropertyVerticalAlign, attr->value());
else if (attrName == usemapAttr) {
if (attr->value().string()[0] == '#')
usemap = attr->value();
else
usemap = document()->completeURL(parseURL(attr->value())).string();
setIsLink(!attr->isNull());
} else if (attrName == ismapAttr)
ismap = true;
else if (attrName == onabortAttr)
setInlineEventListenerForTypeAndAttribute(eventNames().abortEvent, attr);
else if (attrName == onloadAttr)
setInlineEventListenerForTypeAndAttribute(eventNames().loadEvent, attr);
else if (attrName == compositeAttr) {
if (!parseCompositeOperator(attr->value(), m_compositeOperator))
m_compositeOperator = CompositeSourceOver;
} else if (attrName == nameAttr) {
const AtomicString& newName = attr->value();
if (inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeNamedItem(m_name);
document->addNamedItem(newName);
}
m_name = newName;
} else if (attr->name() == idAttr) {
const AtomicString& newId = attr->value();
if (inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeExtraNamedItem(m_id);
document->addExtraNamedItem(newId);
}
m_id = newId;
// also call superclass
HTMLElement::parseMappedAttribute(attr);
} else
HTMLElement::parseMappedAttribute(attr);
}