| 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 if (const Attribute* attribute = elementData()->getAttributeItem(localName,
shouldIgnoreAttributeCase())) | 877 if (const Attribute* attribute = elementData()->getAttributeItem(localName,
shouldIgnoreAttributeCase())) |
| 878 return attribute->value(); | 878 return attribute->value(); |
| 879 return nullAtom; | 879 return nullAtom; |
| 880 } | 880 } |
| 881 | 881 |
| 882 const AtomicString& Element::getAttributeNS(const AtomicString& namespaceURI, co
nst AtomicString& localName) const | 882 const AtomicString& Element::getAttributeNS(const AtomicString& namespaceURI, co
nst AtomicString& localName) const |
| 883 { | 883 { |
| 884 return getAttribute(QualifiedName(nullAtom, localName, namespaceURI)); | 884 return getAttribute(QualifiedName(nullAtom, localName, namespaceURI)); |
| 885 } | 885 } |
| 886 | 886 |
| 887 void Element::setAttribute(const AtomicString& localName, const AtomicString& va
lue, ExceptionState& es) | 887 void Element::setAttribute(const AtomicString& localName, const AtomicString& va
lue, ExceptionState& exceptionState) |
| 888 { | 888 { |
| 889 if (!Document::isValidName(localName)) { | 889 if (!Document::isValidName(localName)) { |
| 890 es.throwUninformativeAndGenericDOMException(InvalidCharacterError); | 890 exceptionState.throwUninformativeAndGenericDOMException(InvalidCharacter
Error); |
| 891 return; | 891 return; |
| 892 } | 892 } |
| 893 | 893 |
| 894 synchronizeAttribute(localName); | 894 synchronizeAttribute(localName); |
| 895 const AtomicString& caseAdjustedLocalName = shouldIgnoreAttributeCase() ? lo
calName.lower() : localName; | 895 const AtomicString& caseAdjustedLocalName = shouldIgnoreAttributeCase() ? lo
calName.lower() : localName; |
| 896 | 896 |
| 897 size_t index = elementData() ? elementData()->getAttributeItemIndex(caseAdju
stedLocalName, false) : kNotFound; | 897 size_t index = elementData() ? elementData()->getAttributeItemIndex(caseAdju
stedLocalName, false) : kNotFound; |
| 898 const QualifiedName& qName = index != kNotFound ? attributeItem(index)->name
() : QualifiedName(nullAtom, caseAdjustedLocalName, nullAtom); | 898 const QualifiedName& qName = index != kNotFound ? attributeItem(index)->name
() : QualifiedName(nullAtom, caseAdjustedLocalName, nullAtom); |
| 899 setAttributeInternal(index, qName, value, NotInSynchronizationOfLazyAttribut
e); | 899 setAttributeInternal(index, qName, value, NotInSynchronizationOfLazyAttribut
e); |
| 900 } | 900 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 String Element::nodeName() const | 1225 String Element::nodeName() const |
| 1226 { | 1226 { |
| 1227 return m_tagName.toString(); | 1227 return m_tagName.toString(); |
| 1228 } | 1228 } |
| 1229 | 1229 |
| 1230 String Element::nodeNamePreservingCase() const | 1230 String Element::nodeNamePreservingCase() const |
| 1231 { | 1231 { |
| 1232 return m_tagName.toString(); | 1232 return m_tagName.toString(); |
| 1233 } | 1233 } |
| 1234 | 1234 |
| 1235 void Element::setPrefix(const AtomicString& prefix, ExceptionState& es) | 1235 void Element::setPrefix(const AtomicString& prefix, ExceptionState& exceptionSta
te) |
| 1236 { | 1236 { |
| 1237 checkSetPrefix(prefix, es); | 1237 checkSetPrefix(prefix, exceptionState); |
| 1238 if (es.hadException()) | 1238 if (exceptionState.hadException()) |
| 1239 return; | 1239 return; |
| 1240 | 1240 |
| 1241 m_tagName.setPrefix(prefix.isEmpty() ? AtomicString() : prefix); | 1241 m_tagName.setPrefix(prefix.isEmpty() ? AtomicString() : prefix); |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 KURL Element::baseURI() const | 1244 KURL Element::baseURI() const |
| 1245 { | 1245 { |
| 1246 const AtomicString& baseAttribute = getAttribute(baseAttr); | 1246 const AtomicString& baseAttribute = getAttribute(baseAttr); |
| 1247 KURL base(KURL(), baseAttribute); | 1247 KURL base(KURL(), baseAttribute); |
| 1248 if (!base.protocol().isEmpty()) | 1248 if (!base.protocol().isEmpty()) |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 return ensureElementRareData().ensureShadow(); | 1694 return ensureElementRareData().ensureShadow(); |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 void Element::didAffectSelector(AffectedSelectorMask mask) | 1697 void Element::didAffectSelector(AffectedSelectorMask mask) |
| 1698 { | 1698 { |
| 1699 setNeedsStyleRecalc(); | 1699 setNeedsStyleRecalc(); |
| 1700 if (ElementShadow* elementShadow = shadowWhereNodeCanBeDistributed(*this)) | 1700 if (ElementShadow* elementShadow = shadowWhereNodeCanBeDistributed(*this)) |
| 1701 elementShadow->didAffectSelector(mask); | 1701 elementShadow->didAffectSelector(mask); |
| 1702 } | 1702 } |
| 1703 | 1703 |
| 1704 PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& es) | 1704 PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exceptionState) |
| 1705 { | 1705 { |
| 1706 if (alwaysCreateUserAgentShadowRoot()) | 1706 if (alwaysCreateUserAgentShadowRoot()) |
| 1707 ensureUserAgentShadowRoot(); | 1707 ensureUserAgentShadowRoot(); |
| 1708 | 1708 |
| 1709 if (RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled()) | 1709 if (RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled()) |
| 1710 return PassRefPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this, Shadow
Root::AuthorShadowRoot)); | 1710 return PassRefPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this, Shadow
Root::AuthorShadowRoot)); |
| 1711 | 1711 |
| 1712 // Since some elements recreates shadow root dynamically, multiple shadow | 1712 // Since some elements recreates shadow root dynamically, multiple shadow |
| 1713 // subtrees won't work well in that element. Until they are fixed, we disabl
e | 1713 // subtrees won't work well in that element. Until they are fixed, we disabl
e |
| 1714 // adding author shadow root for them. | 1714 // adding author shadow root for them. |
| 1715 if (!areAuthorShadowsAllowed()) { | 1715 if (!areAuthorShadowsAllowed()) { |
| 1716 es.throwUninformativeAndGenericDOMException(HierarchyRequestError); | 1716 exceptionState.throwUninformativeAndGenericDOMException(HierarchyRequest
Error); |
| 1717 return 0; | 1717 return 0; |
| 1718 } | 1718 } |
| 1719 return PassRefPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this, ShadowRoot
::AuthorShadowRoot)); | 1719 return PassRefPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this, ShadowRoot
::AuthorShadowRoot)); |
| 1720 } | 1720 } |
| 1721 | 1721 |
| 1722 ShadowRoot* Element::shadowRoot() const | 1722 ShadowRoot* Element::shadowRoot() const |
| 1723 { | 1723 { |
| 1724 ElementShadow* elementShadow = shadow(); | 1724 ElementShadow* elementShadow = shadow(); |
| 1725 if (!elementShadow) | 1725 if (!elementShadow) |
| 1726 return 0; | 1726 return 0; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1911 strncpy(buffer, result.toString().utf8().data(), length - 1); | 1911 strncpy(buffer, result.toString().utf8().data(), length - 1); |
| 1912 } | 1912 } |
| 1913 #endif | 1913 #endif |
| 1914 | 1914 |
| 1915 const Vector<RefPtr<Attr> >& Element::attrNodeList() | 1915 const Vector<RefPtr<Attr> >& Element::attrNodeList() |
| 1916 { | 1916 { |
| 1917 ASSERT(hasSyntheticAttrChildNodes()); | 1917 ASSERT(hasSyntheticAttrChildNodes()); |
| 1918 return *attrNodeListForElement(this); | 1918 return *attrNodeListForElement(this); |
| 1919 } | 1919 } |
| 1920 | 1920 |
| 1921 PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionState& es) | 1921 PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionState& excep
tionState) |
| 1922 { | 1922 { |
| 1923 if (!attrNode) { | 1923 if (!attrNode) { |
| 1924 es.throwUninformativeAndGenericDOMException(TypeMismatchError); | 1924 exceptionState.throwUninformativeAndGenericDOMException(TypeMismatchErro
r); |
| 1925 return 0; | 1925 return 0; |
| 1926 } | 1926 } |
| 1927 | 1927 |
| 1928 RefPtr<Attr> oldAttrNode = attrIfExists(attrNode->qualifiedName()); | 1928 RefPtr<Attr> oldAttrNode = attrIfExists(attrNode->qualifiedName()); |
| 1929 if (oldAttrNode.get() == attrNode) | 1929 if (oldAttrNode.get() == attrNode) |
| 1930 return attrNode; // This Attr is already attached to the element. | 1930 return attrNode; // This Attr is already attached to the element. |
| 1931 | 1931 |
| 1932 // InUseAttributeError: Raised if node is an Attr that is already an attribu
te of another Element object. | 1932 // InUseAttributeError: Raised if node is an Attr that is already an attribu
te of another Element object. |
| 1933 // The DOM user must explicitly clone Attr nodes to re-use them in other ele
ments. | 1933 // The DOM user must explicitly clone Attr nodes to re-use them in other ele
ments. |
| 1934 if (attrNode->ownerElement()) { | 1934 if (attrNode->ownerElement()) { |
| 1935 es.throwUninformativeAndGenericDOMException(InUseAttributeError); | 1935 exceptionState.throwUninformativeAndGenericDOMException(InUseAttributeEr
ror); |
| 1936 return 0; | 1936 return 0; |
| 1937 } | 1937 } |
| 1938 | 1938 |
| 1939 synchronizeAllAttributes(); | 1939 synchronizeAllAttributes(); |
| 1940 UniqueElementData* elementData = ensureUniqueElementData(); | 1940 UniqueElementData* elementData = ensureUniqueElementData(); |
| 1941 | 1941 |
| 1942 size_t index = elementData->getAttributeItemIndex(attrNode->qualifiedName(),
shouldIgnoreAttributeCase()); | 1942 size_t index = elementData->getAttributeItemIndex(attrNode->qualifiedName(),
shouldIgnoreAttributeCase()); |
| 1943 if (index != kNotFound) { | 1943 if (index != kNotFound) { |
| 1944 if (oldAttrNode) | 1944 if (oldAttrNode) |
| 1945 detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->a
ttributeItem(index)->value()); | 1945 detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->a
ttributeItem(index)->value()); |
| 1946 else | 1946 else |
| 1947 oldAttrNode = Attr::create(document(), attrNode->qualifiedName(), el
ementData->attributeItem(index)->value()); | 1947 oldAttrNode = Attr::create(document(), attrNode->qualifiedName(), el
ementData->attributeItem(index)->value()); |
| 1948 } | 1948 } |
| 1949 | 1949 |
| 1950 setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), No
tInSynchronizationOfLazyAttribute); | 1950 setAttributeInternal(index, attrNode->qualifiedName(), attrNode->value(), No
tInSynchronizationOfLazyAttribute); |
| 1951 | 1951 |
| 1952 attrNode->attachToElement(this); | 1952 attrNode->attachToElement(this); |
| 1953 treeScope().adoptIfNeeded(*attrNode); | 1953 treeScope().adoptIfNeeded(*attrNode); |
| 1954 ensureAttrNodeListForElement(this).append(attrNode); | 1954 ensureAttrNodeListForElement(this).append(attrNode); |
| 1955 | 1955 |
| 1956 return oldAttrNode.release(); | 1956 return oldAttrNode.release(); |
| 1957 } | 1957 } |
| 1958 | 1958 |
| 1959 PassRefPtr<Attr> Element::setAttributeNodeNS(Attr* attr, ExceptionState& es) | 1959 PassRefPtr<Attr> Element::setAttributeNodeNS(Attr* attr, ExceptionState& excepti
onState) |
| 1960 { | 1960 { |
| 1961 return setAttributeNode(attr, es); | 1961 return setAttributeNode(attr, exceptionState); |
| 1962 } | 1962 } |
| 1963 | 1963 |
| 1964 PassRefPtr<Attr> Element::removeAttributeNode(Attr* attr, ExceptionState& es) | 1964 PassRefPtr<Attr> Element::removeAttributeNode(Attr* attr, ExceptionState& except
ionState) |
| 1965 { | 1965 { |
| 1966 if (!attr) { | 1966 if (!attr) { |
| 1967 es.throwUninformativeAndGenericDOMException(TypeMismatchError); | 1967 exceptionState.throwUninformativeAndGenericDOMException(TypeMismatchErro
r); |
| 1968 return 0; | 1968 return 0; |
| 1969 } | 1969 } |
| 1970 if (attr->ownerElement() != this) { | 1970 if (attr->ownerElement() != this) { |
| 1971 es.throwUninformativeAndGenericDOMException(NotFoundError); | 1971 exceptionState.throwUninformativeAndGenericDOMException(NotFoundError); |
| 1972 return 0; | 1972 return 0; |
| 1973 } | 1973 } |
| 1974 | 1974 |
| 1975 ASSERT(document() == attr->document()); | 1975 ASSERT(document() == attr->document()); |
| 1976 | 1976 |
| 1977 synchronizeAttribute(attr->qualifiedName()); | 1977 synchronizeAttribute(attr->qualifiedName()); |
| 1978 | 1978 |
| 1979 size_t index = elementData()->getAttrIndex(attr); | 1979 size_t index = elementData()->getAttrIndex(attr); |
| 1980 if (index == kNotFound) { | 1980 if (index == kNotFound) { |
| 1981 es.throwUninformativeAndGenericDOMException(NotFoundError); | 1981 exceptionState.throwUninformativeAndGenericDOMException(NotFoundError); |
| 1982 return 0; | 1982 return 0; |
| 1983 } | 1983 } |
| 1984 | 1984 |
| 1985 RefPtr<Attr> guard(attr); | 1985 RefPtr<Attr> guard(attr); |
| 1986 detachAttrNodeAtIndex(attr, index); | 1986 detachAttrNodeAtIndex(attr, index); |
| 1987 return guard.release(); | 1987 return guard.release(); |
| 1988 } | 1988 } |
| 1989 | 1989 |
| 1990 bool Element::parseAttributeName(QualifiedName& out, const AtomicString& namespa
ceURI, const AtomicString& qualifiedName, ExceptionState& es) | 1990 bool Element::parseAttributeName(QualifiedName& out, const AtomicString& namespa
ceURI, const AtomicString& qualifiedName, ExceptionState& exceptionState) |
| 1991 { | 1991 { |
| 1992 String prefix, localName; | 1992 String prefix, localName; |
| 1993 if (!Document::parseQualifiedName(qualifiedName, prefix, localName, es)) | 1993 if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptio
nState)) |
| 1994 return false; | 1994 return false; |
| 1995 ASSERT(!es.hadException()); | 1995 ASSERT(!exceptionState.hadException()); |
| 1996 | 1996 |
| 1997 QualifiedName qName(prefix, localName, namespaceURI); | 1997 QualifiedName qName(prefix, localName, namespaceURI); |
| 1998 | 1998 |
| 1999 if (!Document::hasValidNamespaceForAttributes(qName)) { | 1999 if (!Document::hasValidNamespaceForAttributes(qName)) { |
| 2000 es.throwUninformativeAndGenericDOMException(NamespaceError); | 2000 exceptionState.throwUninformativeAndGenericDOMException(NamespaceError); |
| 2001 return false; | 2001 return false; |
| 2002 } | 2002 } |
| 2003 | 2003 |
| 2004 out = qName; | 2004 out = qName; |
| 2005 return true; | 2005 return true; |
| 2006 } | 2006 } |
| 2007 | 2007 |
| 2008 void Element::setAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
g& qualifiedName, const AtomicString& value, ExceptionState& es) | 2008 void Element::setAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
g& qualifiedName, const AtomicString& value, ExceptionState& exceptionState) |
| 2009 { | 2009 { |
| 2010 QualifiedName parsedName = anyName; | 2010 QualifiedName parsedName = anyName; |
| 2011 if (!parseAttributeName(parsedName, namespaceURI, qualifiedName, es)) | 2011 if (!parseAttributeName(parsedName, namespaceURI, qualifiedName, exceptionSt
ate)) |
| 2012 return; | 2012 return; |
| 2013 setAttribute(parsedName, value); | 2013 setAttribute(parsedName, value); |
| 2014 } | 2014 } |
| 2015 | 2015 |
| 2016 void Element::removeAttributeInternal(size_t index, SynchronizationOfLazyAttribu
te inSynchronizationOfLazyAttribute) | 2016 void Element::removeAttributeInternal(size_t index, SynchronizationOfLazyAttribu
te inSynchronizationOfLazyAttribute) |
| 2017 { | 2017 { |
| 2018 ASSERT_WITH_SECURITY_IMPLICATION(index < attributeCount()); | 2018 ASSERT_WITH_SECURITY_IMPLICATION(index < attributeCount()); |
| 2019 | 2019 |
| 2020 UniqueElementData* elementData = ensureUniqueElementData(); | 2020 UniqueElementData* elementData = ensureUniqueElementData(); |
| 2021 | 2021 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 String Element::innerHTML() const | 2224 String Element::innerHTML() const |
| 2225 { | 2225 { |
| 2226 return createMarkup(this, ChildrenOnly); | 2226 return createMarkup(this, ChildrenOnly); |
| 2227 } | 2227 } |
| 2228 | 2228 |
| 2229 String Element::outerHTML() const | 2229 String Element::outerHTML() const |
| 2230 { | 2230 { |
| 2231 return createMarkup(this); | 2231 return createMarkup(this); |
| 2232 } | 2232 } |
| 2233 | 2233 |
| 2234 void Element::setInnerHTML(const String& html, ExceptionState& es) | 2234 void Element::setInnerHTML(const String& html, ExceptionState& exceptionState) |
| 2235 { | 2235 { |
| 2236 if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html
, this, AllowScriptingContent, "innerHTML", es)) { | 2236 if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html
, this, AllowScriptingContent, "innerHTML", exceptionState)) { |
| 2237 ContainerNode* container = this; | 2237 ContainerNode* container = this; |
| 2238 if (hasTagName(templateTag)) | 2238 if (hasTagName(templateTag)) |
| 2239 container = toHTMLTemplateElement(this)->content(); | 2239 container = toHTMLTemplateElement(this)->content(); |
| 2240 replaceChildrenWithFragment(container, fragment.release(), es); | 2240 replaceChildrenWithFragment(container, fragment.release(), exceptionStat
e); |
| 2241 } | 2241 } |
| 2242 } | 2242 } |
| 2243 | 2243 |
| 2244 void Element::setOuterHTML(const String& html, ExceptionState& es) | 2244 void Element::setOuterHTML(const String& html, ExceptionState& exceptionState) |
| 2245 { | 2245 { |
| 2246 Node* p = parentNode(); | 2246 Node* p = parentNode(); |
| 2247 if (!p || !p->isElementNode()) { | 2247 if (!p || !p->isElementNode()) { |
| 2248 es.throwUninformativeAndGenericDOMException(NoModificationAllowedError); | 2248 exceptionState.throwUninformativeAndGenericDOMException(NoModificationAl
lowedError); |
| 2249 return; | 2249 return; |
| 2250 } | 2250 } |
| 2251 RefPtr<Element> parent = toElement(p); | 2251 RefPtr<Element> parent = toElement(p); |
| 2252 RefPtr<Node> prev = previousSibling(); | 2252 RefPtr<Node> prev = previousSibling(); |
| 2253 RefPtr<Node> next = nextSibling(); | 2253 RefPtr<Node> next = nextSibling(); |
| 2254 | 2254 |
| 2255 RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, pa
rent.get(), AllowScriptingContent, "outerHTML", es); | 2255 RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, pa
rent.get(), AllowScriptingContent, "outerHTML", exceptionState); |
| 2256 if (es.hadException()) | 2256 if (exceptionState.hadException()) |
| 2257 return; | 2257 return; |
| 2258 | 2258 |
| 2259 parent->replaceChild(fragment.release(), this, es); | 2259 parent->replaceChild(fragment.release(), this, exceptionState); |
| 2260 RefPtr<Node> node = next ? next->previousSibling() : 0; | 2260 RefPtr<Node> node = next ? next->previousSibling() : 0; |
| 2261 if (!es.hadException() && node && node->isTextNode()) | 2261 if (!exceptionState.hadException() && node && node->isTextNode()) |
| 2262 mergeWithNextTextNode(node.release(), es); | 2262 mergeWithNextTextNode(node.release(), exceptionState); |
| 2263 | 2263 |
| 2264 if (!es.hadException() && prev && prev->isTextNode()) | 2264 if (!exceptionState.hadException() && prev && prev->isTextNode()) |
| 2265 mergeWithNextTextNode(prev.release(), es); | 2265 mergeWithNextTextNode(prev.release(), exceptionState); |
| 2266 } | 2266 } |
| 2267 | 2267 |
| 2268 String Element::innerText() | 2268 String Element::innerText() |
| 2269 { | 2269 { |
| 2270 // We need to update layout, since plainText uses line boxes in the render t
ree. | 2270 // We need to update layout, since plainText uses line boxes in the render t
ree. |
| 2271 document().updateLayoutIgnorePendingStylesheets(); | 2271 document().updateLayoutIgnorePendingStylesheets(); |
| 2272 | 2272 |
| 2273 if (!renderer()) | 2273 if (!renderer()) |
| 2274 return textContent(true); | 2274 return textContent(true); |
| 2275 | 2275 |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2676 return hasRareData() ? elementRareData()->pseudoElement(pseudoId) : 0; | 2676 return hasRareData() ? elementRareData()->pseudoElement(pseudoId) : 0; |
| 2677 } | 2677 } |
| 2678 | 2678 |
| 2679 RenderObject* Element::pseudoElementRenderer(PseudoId pseudoId) const | 2679 RenderObject* Element::pseudoElementRenderer(PseudoId pseudoId) const |
| 2680 { | 2680 { |
| 2681 if (PseudoElement* element = pseudoElement(pseudoId)) | 2681 if (PseudoElement* element = pseudoElement(pseudoId)) |
| 2682 return element->renderer(); | 2682 return element->renderer(); |
| 2683 return 0; | 2683 return 0; |
| 2684 } | 2684 } |
| 2685 | 2685 |
| 2686 bool Element::webkitMatchesSelector(const String& selector, ExceptionState& es) | 2686 bool Element::webkitMatchesSelector(const String& selector, ExceptionState& exce
ptionState) |
| 2687 { | 2687 { |
| 2688 if (selector.isEmpty()) { | 2688 if (selector.isEmpty()) { |
| 2689 es.throwUninformativeAndGenericDOMException(SyntaxError); | 2689 exceptionState.throwUninformativeAndGenericDOMException(SyntaxError); |
| 2690 return false; | 2690 return false; |
| 2691 } | 2691 } |
| 2692 | 2692 |
| 2693 SelectorQuery* selectorQuery = document().selectorQueryCache().add(selector,
document(), es); | 2693 SelectorQuery* selectorQuery = document().selectorQueryCache().add(selector,
document(), exceptionState); |
| 2694 if (!selectorQuery) | 2694 if (!selectorQuery) |
| 2695 return false; | 2695 return false; |
| 2696 return selectorQuery->matches(*this); | 2696 return selectorQuery->matches(*this); |
| 2697 } | 2697 } |
| 2698 | 2698 |
| 2699 DOMTokenList* Element::classList() | 2699 DOMTokenList* Element::classList() |
| 2700 { | 2700 { |
| 2701 ElementRareData& rareData = ensureElementRareData(); | 2701 ElementRareData& rareData = ensureElementRareData(); |
| 2702 if (!rareData.classList()) | 2702 if (!rareData.classList()) |
| 2703 rareData.setClassList(ClassList::create(this)); | 2703 rareData.setClassList(ClassList::create(this)); |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3516 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems | 3516 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems |
| 3517 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 | 3517 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 |
| 3518 if (hasTagName(optionTag) || hasTagName(optgroupTag)) | 3518 if (hasTagName(optionTag) || hasTagName(optgroupTag)) |
| 3519 return false; | 3519 return false; |
| 3520 if (FullscreenElementStack::isActiveFullScreenElement(this)) | 3520 if (FullscreenElementStack::isActiveFullScreenElement(this)) |
| 3521 return false; | 3521 return false; |
| 3522 return true; | 3522 return true; |
| 3523 } | 3523 } |
| 3524 | 3524 |
| 3525 } // namespace WebCore | 3525 } // namespace WebCore |
| OLD | NEW |