本文整理汇总了C++中HTMLDocument::removeDocumentNamedItem方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLDocument::removeDocumentNamedItem方法的具体用法?C++ HTMLDocument::removeDocumentNamedItem怎么用?C++ HTMLDocument::removeDocumentNamedItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLDocument
的用法示例。
在下文中一共展示了HTMLDocument::removeDocumentNamedItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseAttribute
void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == altAttr) {
if (renderer() && renderer()->isRenderImage())
toRenderImage(renderer())->updateAltText();
} else if (name == srcAttr || name == srcsetAttr) {
ImageWithScale candidate = bestFitSourceForImageAttributes(document().deviceScaleFactor(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr));
m_bestFitImageURL = candidate.imageURL(fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr));
float candidateScaleFactor = candidate.scaleFactor();
if (candidateScaleFactor > 0)
m_imageDevicePixelRatio = 1 / candidateScaleFactor;
if (renderer() && renderer()->isImage())
toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevicePixelRatio);
m_imageLoader.updateFromElementIgnoringPreviousError();
} else if (name == usemapAttr) {
setIsLink(!value.isNull() && !shouldProhibitLinks(this));
if (inDocument() && !m_lowercasedUsemap.isNull())
document().removeImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
// The HTMLImageElement's useMap() value includes the '#' symbol at the beginning, which has to be stripped off.
// FIXME: We should check that the first character is '#'.
// FIXME: HTML5 specification says we should strip any leading string before '#'.
// FIXME: HTML5 specification says we should ignore usemap attributes without #.
if (value.length() > 1)
m_lowercasedUsemap = value.string().substring(1).lower();
else
m_lowercasedUsemap = nullAtom;
if (inDocument() && !m_lowercasedUsemap.isNull())
document().addImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
} else if (name == onbeforeloadAttr)
setAttributeEventListener(eventNames().beforeloadEvent, name, value);
else if (name == compositeAttr) {
// FIXME: images don't support blend modes in their compositing attribute.
BlendMode blendOp = BlendModeNormal;
if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp))
m_compositeOperator = CompositeSourceOver;
} else {
if (name == nameAttr) {
bool willHaveName = !value.isNull();
if (hasName() != willHaveName && inDocument() && document().isHTMLDocument()) {
HTMLDocument* document = toHTMLDocument(&this->document());
const AtomicString& id = getIdAttribute();
if (!id.isEmpty() && id != getNameAttribute()) {
if (willHaveName)
document->addDocumentNamedItem(*id.impl(), *this);
else
document->removeDocumentNamedItem(*id.impl(), *this);
}
}
}
HTMLElement::parseAttribute(name, value);
}
}