OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 | 1802 |
1803 const Vector<RefPtr<Attr> >& Element::attrNodeList() | 1803 const Vector<RefPtr<Attr> >& Element::attrNodeList() |
1804 { | 1804 { |
1805 ASSERT(hasSyntheticAttrChildNodes()); | 1805 ASSERT(hasSyntheticAttrChildNodes()); |
1806 return *attrNodeListForElement(this); | 1806 return *attrNodeListForElement(this); |
1807 } | 1807 } |
1808 | 1808 |
1809 PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionCode& ec) | 1809 PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionCode& ec) |
1810 { | 1810 { |
1811 if (!attrNode) { | 1811 if (!attrNode) { |
1812 ec = TYPE_MISMATCH_ERR; | 1812 ec = TypeMismatchError; |
1813 return 0; | 1813 return 0; |
1814 } | 1814 } |
1815 | 1815 |
1816 RefPtr<Attr> oldAttrNode = attrIfExists(attrNode->qualifiedName()); | 1816 RefPtr<Attr> oldAttrNode = attrIfExists(attrNode->qualifiedName()); |
1817 if (oldAttrNode.get() == attrNode) | 1817 if (oldAttrNode.get() == attrNode) |
1818 return attrNode; // This Attr is already attached to the element. | 1818 return attrNode; // This Attr is already attached to the element. |
1819 | 1819 |
1820 // InuseAttributeError: Raised if node is an Attr that is already an attribu
te of another Element object. | 1820 // InuseAttributeError: Raised if node is an Attr that is already an attribu
te of another Element object. |
1821 // The DOM user must explicitly clone Attr nodes to re-use them in other ele
ments. | 1821 // The DOM user must explicitly clone Attr nodes to re-use them in other ele
ments. |
1822 if (attrNode->ownerElement()) { | 1822 if (attrNode->ownerElement()) { |
(...skipping 22 matching lines...) Expand all Loading... |
1845 } | 1845 } |
1846 | 1846 |
1847 PassRefPtr<Attr> Element::setAttributeNodeNS(Attr* attr, ExceptionCode& ec) | 1847 PassRefPtr<Attr> Element::setAttributeNodeNS(Attr* attr, ExceptionCode& ec) |
1848 { | 1848 { |
1849 return setAttributeNode(attr, ec); | 1849 return setAttributeNode(attr, ec); |
1850 } | 1850 } |
1851 | 1851 |
1852 PassRefPtr<Attr> Element::removeAttributeNode(Attr* attr, ExceptionCode& ec) | 1852 PassRefPtr<Attr> Element::removeAttributeNode(Attr* attr, ExceptionCode& ec) |
1853 { | 1853 { |
1854 if (!attr) { | 1854 if (!attr) { |
1855 ec = TYPE_MISMATCH_ERR; | 1855 ec = TypeMismatchError; |
1856 return 0; | 1856 return 0; |
1857 } | 1857 } |
1858 if (attr->ownerElement() != this) { | 1858 if (attr->ownerElement() != this) { |
1859 ec = NotFoundError; | 1859 ec = NotFoundError; |
1860 return 0; | 1860 return 0; |
1861 } | 1861 } |
1862 | 1862 |
1863 ASSERT(document() == attr->document()); | 1863 ASSERT(document() == attr->document()); |
1864 | 1864 |
1865 synchronizeAttribute(attr->qualifiedName()); | 1865 synchronizeAttribute(attr->qualifiedName()); |
(...skipping 12 matching lines...) Expand all Loading... |
1878 bool Element::parseAttributeName(QualifiedName& out, const AtomicString& namespa
ceURI, const AtomicString& qualifiedName, ExceptionCode& ec) | 1878 bool Element::parseAttributeName(QualifiedName& out, const AtomicString& namespa
ceURI, const AtomicString& qualifiedName, ExceptionCode& ec) |
1879 { | 1879 { |
1880 String prefix, localName; | 1880 String prefix, localName; |
1881 if (!Document::parseQualifiedName(qualifiedName, prefix, localName, ec)) | 1881 if (!Document::parseQualifiedName(qualifiedName, prefix, localName, ec)) |
1882 return false; | 1882 return false; |
1883 ASSERT(!ec); | 1883 ASSERT(!ec); |
1884 | 1884 |
1885 QualifiedName qName(prefix, localName, namespaceURI); | 1885 QualifiedName qName(prefix, localName, namespaceURI); |
1886 | 1886 |
1887 if (!Document::hasValidNamespaceForAttributes(qName)) { | 1887 if (!Document::hasValidNamespaceForAttributes(qName)) { |
1888 ec = NAMESPACE_ERR; | 1888 ec = NamespaceError; |
1889 return false; | 1889 return false; |
1890 } | 1890 } |
1891 | 1891 |
1892 out = qName; | 1892 out = qName; |
1893 return true; | 1893 return true; |
1894 } | 1894 } |
1895 | 1895 |
1896 void Element::setAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
g& qualifiedName, const AtomicString& value, ExceptionCode& ec) | 1896 void Element::setAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
g& qualifiedName, const AtomicString& value, ExceptionCode& ec) |
1897 { | 1897 { |
1898 QualifiedName parsedName = anyName; | 1898 QualifiedName parsedName = anyName; |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2442 } | 2442 } |
2443 | 2443 |
2444 bool Element::matchesReadWritePseudoClass() const | 2444 bool Element::matchesReadWritePseudoClass() const |
2445 { | 2445 { |
2446 return false; | 2446 return false; |
2447 } | 2447 } |
2448 | 2448 |
2449 bool Element::webkitMatchesSelector(const String& selector, ExceptionCode& ec) | 2449 bool Element::webkitMatchesSelector(const String& selector, ExceptionCode& ec) |
2450 { | 2450 { |
2451 if (selector.isEmpty()) { | 2451 if (selector.isEmpty()) { |
2452 ec = SYNTAX_ERR; | 2452 ec = SyntaxError; |
2453 return false; | 2453 return false; |
2454 } | 2454 } |
2455 | 2455 |
2456 SelectorQuery* selectorQuery = document()->selectorQueryCache()->add(selecto
r, document(), ec); | 2456 SelectorQuery* selectorQuery = document()->selectorQueryCache()->add(selecto
r, document(), ec); |
2457 if (!selectorQuery) | 2457 if (!selectorQuery) |
2458 return false; | 2458 return false; |
2459 return selectorQuery->matches(this); | 2459 return selectorQuery->matches(this); |
2460 } | 2460 } |
2461 | 2461 |
2462 bool Element::shouldAppearIndeterminate() const | 2462 bool Element::shouldAppearIndeterminate() const |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3566 return 0; | 3566 return 0; |
3567 } | 3567 } |
3568 | 3568 |
3569 Attribute* UniqueElementData::attributeItem(unsigned index) | 3569 Attribute* UniqueElementData::attributeItem(unsigned index) |
3570 { | 3570 { |
3571 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); | 3571 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); |
3572 return &m_attributeVector.at(index); | 3572 return &m_attributeVector.at(index); |
3573 } | 3573 } |
3574 | 3574 |
3575 } // namespace WebCore | 3575 } // namespace WebCore |
OLD | NEW |