TagCollection::~TagCollection() { if (m_namespaceURI == starAtom) ownerNode().nodeLists()->removeCachedCollection(this, m_localName); else ownerNode().nodeLists()->removeCachedCollectionWithQualifiedName(*this, m_namespaceURI, m_localName); }
TagCollection::~TagCollection() { if (m_namespaceURI == starAtom) ownerNode().nodeLists()->removeCache(this, type(), m_localName); else ownerNode().nodeLists()->removeCache(this, m_namespaceURI, m_localName); }
TagNodeList::~TagNodeList() { if (m_namespaceURI == starAtom) ownerNode().nodeLists()->removeCacheWithAtomicName(this, m_localName); else ownerNode().nodeLists()->removeCacheWithQualifiedName(this, m_namespaceURI, m_localName); }
ContainerNode& LiveNodeList::rootNode() const { if (isRootedAtDocument() && ownerNode().inDocument()) return ownerNode().document(); return ownerNode(); }
void CSSStyleSheet::checkLoaded() { if (isLoading()) return; if (parent()) parent()->checkLoaded(); m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; }
TagCollection::~TagCollection() { #if !ENABLE(OILPAN) if (m_namespaceURI == starAtom) ownerNode().nodeLists()->removeCache(this, type(), m_localName); else ownerNode().nodeLists()->removeCache(this, m_namespaceURI, m_localName); #endif }
void XSLStyleSheet::checkLoaded() { if (isLoading()) return; if (parent()) parent()->checkLoaded(); if (ownerNode()) ownerNode()->sheetLoaded(); }
void XSLStyleSheet::checkLoaded() { if (isLoading()) return; if (XSLStyleSheet* styleSheet = parentStyleSheet()) styleSheet->checkLoaded(); if (ownerNode()) ownerNode()->sheetLoaded(); }
void CSSStyleSheet::checkLoaded() { if (isLoading()) return; if (parent()) parent()->checkLoaded(); // Avoid |this| being deleted by scripts that run via HTMLTokenizer::executeScriptsWaitingForStylesheets(). // See <rdar://problem/6622300>. RefPtr<CSSStyleSheet> protector(this); m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; }
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HTMLOptionElement> value, ExceptionCode& ec) { HTMLSelectElement* base = toHTMLSelectElement(ownerNode()); if (!value) { ec = TYPE_MISMATCH_ERR; return true; } base->setOption(index, value.get(), ec); return true; }
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtrWillBeRawPtr<HTMLOptionElement> value, ExceptionState& exceptionState) { HTMLSelectElement& base = toHTMLSelectElement(ownerNode()); if (!value) { // undefined or null base.remove(index); return true; } base.setOption(index, value.get(), exceptionState); return true; }
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HTMLOptionElement> value, ExceptionState& exceptionState) { HTMLSelectElement* base = toHTMLSelectElement(ownerNode()); if (!value) { exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::number(index), "HTMLOptionsCollection", "The element provided was not an HTMLOptionElement.")); return true; } base->setOption(index, value.get(), exceptionState); return true; }
Node* LiveNodeListBase::rootNode() const { if (isRootedAtDocument() && m_ownerNode->inDocument()) return m_ownerNode->document(); #if ENABLE(MICRODATA) if (m_rootType == NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr && toElement(ownerNode())->fastHasAttribute(HTMLNames::itemrefAttr)) { if (m_ownerNode->inDocument()) return m_ownerNode->document(); Node* root = m_ownerNode.get(); while (Node* parent = root->parentNode()) root = parent; return root; } #endif return m_ownerNode.get(); }
void CSSStyleSheet::checkLoaded() { if (isLoading()) return; // Avoid |this| being deleted by scripts that run via // ScriptableDocumentParser::executeScriptsWaitingForStylesheets(). // See <rdar://problem/6622300>. RefPtr<CSSStyleSheet> protector(this); if (CSSStyleSheet* styleSheet = parentStyleSheet()) styleSheet->checkLoaded(); RefPtr<Node> owner = ownerNode(); if (!owner) m_loadCompleted = true; else { m_loadCompleted = owner->sheetLoaded(); if (m_loadCompleted) owner->notifyLoadedSheetAndAllCriticalSubresources(m_didLoadErrorOccur); } }
void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index, ExceptionState& exceptionState) { HTMLOptionElement* newOption = element.get(); if (!newOption) { exceptionState.throwTypeError("The element provided was not an HTMLOptionElement."); return; } if (index < -1) { exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1."); return; } HTMLSelectElement* select = toHTMLSelectElement(ownerNode()); if (index == -1 || unsigned(index) >= length()) select->add(newOption, 0, exceptionState); else select->add(newOption, toHTMLOptionElement(item(index)), exceptionState); ASSERT(!exceptionState.hadException()); }
void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index, ExceptionCode& ec) { HTMLOptionElement* newOption = element.get(); if (!newOption) { ec = TYPE_MISMATCH_ERR; return; } if (index < -1) { ec = INDEX_SIZE_ERR; return; } ec = 0; HTMLSelectElement* select = toHTMLSelectElement(ownerNode()); if (index == -1 || unsigned(index) >= length()) select->add(newOption, 0, ec); else select->add(newOption, static_cast<HTMLOptionElement*>(item(index)), ec); ASSERT(!ec); }
void CSSStyleSheet::willMutateRules() { // If we are the only client it is safe to mutate. if (m_contents->clientSize() <= 1 && !m_contents->isReferencedFromResource()) { m_contents->clearRuleSet(); if (Document* document = ownerDocument()) m_contents->removeSheetFromCache(document); m_contents->setMutable(); return; } // Only cacheable stylesheets should have multiple clients. ASSERT((isStyleElement(ownerNode()) && m_contents->isCacheableForStyleElement()) || m_contents->isCacheableForResource()); // Copy-on-write. m_contents->unregisterClient(this); m_contents = m_contents->copy(); m_contents->registerClient(this); m_contents->setMutable(); // Any existing CSSOM wrappers need to be connected to the copied child rules. reattachChildRuleCSSOMWrappers(); }
int HTMLOptionsCollection::selectedIndex() const { return toHTMLSelectElement(ownerNode())->selectedIndex(); }
void HTMLOptionsCollection::remove(int index) { toHTMLSelectElement(ownerNode())->remove(index); }
bool HTMLOptionsCollection::anonymousIndexedSetterRemove(unsigned index, ExceptionState& exceptionState) { HTMLSelectElement* base = toHTMLSelectElement(ownerNode()); base->remove(index); return true; }
void XSLStyleSheet::checkLoaded() { if (ownerNode()) ownerNode()->sheetLoaded(); }
Document* XSLStyleSheet::ownerDocument() { Node* node = ownerNode(); return node ? node->document() : 0; }
Node* ChildNodeList::virtualOwnerNode() const { return &ownerNode(); }
ClassNodeList::~ClassNodeList() { ownerNode()->nodeLists()->removeCacheWithName(this, ClassNodeListType, m_originalClassNames); }
ChildNodeList::~ChildNodeList() { ownerNode()->nodeLists()->removeChildNodeList(this); }
void HTMLOptionsCollection::setSelectedIndex(int index) { toHTMLSelectElement(ownerNode())->setSelectedIndex(index); }
void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exceptionState) { toHTMLSelectElement(ownerNode())->setLength(length, exceptionState); }
void CSSStyleSheet::startLoadingDynamicSheet() { if (Node* owner = ownerNode()) owner->startLoadingDynamicSheet(); }
HTMLTagCollection::~HTMLTagCollection() { ownerNode().nodeLists()->removeCachedCollection(this, m_localName); }
Node* LiveNodeList::virtualOwnerNode() const { return &ownerNode(); }