| 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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 AtomicString oldId = elementData()->idForStyleResolution(); | 1027 AtomicString oldId = elementData()->idForStyleResolution(); |
| 1028 AtomicString newId = makeIdForStyleResolution(newValue, document().inQui
rksMode()); | 1028 AtomicString newId = makeIdForStyleResolution(newValue, document().inQui
rksMode()); |
| 1029 if (newId != oldId) { | 1029 if (newId != oldId) { |
| 1030 elementData()->setIdForStyleResolution(newId); | 1030 elementData()->setIdForStyleResolution(newId); |
| 1031 shouldInvalidateStyle = testShouldInvalidateStyle && checkNeedsStyle
InvalidationForIdChange(oldId, newId, styleResolver->ensureRuleFeatureSet()); | 1031 shouldInvalidateStyle = testShouldInvalidateStyle && checkNeedsStyle
InvalidationForIdChange(oldId, newId, styleResolver->ensureRuleFeatureSet()); |
| 1032 } | 1032 } |
| 1033 } else if (name == classAttr) { | 1033 } else if (name == classAttr) { |
| 1034 classAttributeChanged(newValue); | 1034 classAttributeChanged(newValue); |
| 1035 } else if (name == HTMLNames::nameAttr) { | 1035 } else if (name == HTMLNames::nameAttr) { |
| 1036 setHasName(!newValue.isNull()); | 1036 setHasName(!newValue.isNull()); |
| 1037 } else if (name == HTMLNames::pseudoAttr) { |
| 1038 shouldInvalidateStyle |= testShouldInvalidateStyle && isInShadowTree(); |
| 1037 } | 1039 } |
| 1038 | 1040 |
| 1039 invalidateNodeListCachesInAncestors(&name, this); | 1041 invalidateNodeListCachesInAncestors(&name, this); |
| 1040 | 1042 |
| 1041 // If there is currently no StyleResolver, we can't be sure that this attrib
ute change won't affect style. | 1043 // If there is currently no StyleResolver, we can't be sure that this attrib
ute change won't affect style. |
| 1042 shouldInvalidateStyle |= !styleResolver; | 1044 shouldInvalidateStyle |= !styleResolver; |
| 1043 | 1045 |
| 1044 if (shouldInvalidateStyle) | 1046 if (shouldInvalidateStyle) |
| 1045 setNeedsStyleRecalc(SubtreeStyleChange); | 1047 setNeedsStyleRecalc(SubtreeStyleChange); |
| 1046 | 1048 |
| (...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 continue; | 2430 continue; |
| 2429 content.append(toText(child)->data()); | 2431 content.append(toText(child)->data()); |
| 2430 } | 2432 } |
| 2431 | 2433 |
| 2432 ASSERT(content.length() == totalLength); | 2434 ASSERT(content.length() == totalLength); |
| 2433 return content.toString(); | 2435 return content.toString(); |
| 2434 } | 2436 } |
| 2435 | 2437 |
| 2436 const AtomicString& Element::shadowPseudoId() const | 2438 const AtomicString& Element::shadowPseudoId() const |
| 2437 { | 2439 { |
| 2438 if (ShadowRoot* root = containingShadowRoot()) { | 2440 return getAttribute(pseudoAttr); |
| 2439 if (root->type() == ShadowRoot::UserAgentShadowRoot) | |
| 2440 return fastGetAttribute(pseudoAttr); | |
| 2441 } | |
| 2442 return nullAtom; | |
| 2443 } | 2441 } |
| 2444 | 2442 |
| 2445 void Element::setShadowPseudoId(const AtomicString& id) | 2443 void Element::setShadowPseudoId(const AtomicString& id) |
| 2446 { | 2444 { |
| 2447 ASSERT(CSSSelector::parsePseudoType(id) == CSSSelector::PseudoWebKitCustomEl
ement || CSSSelector::parsePseudoType(id) == CSSSelector::PseudoUserAgentCustomE
lement); | |
| 2448 setAttribute(pseudoAttr, id); | 2445 setAttribute(pseudoAttr, id); |
| 2449 } | 2446 } |
| 2450 | 2447 |
| 2451 bool Element::isInDescendantTreeOf(const Element* shadowHost) const | 2448 bool Element::isInDescendantTreeOf(const Element* shadowHost) const |
| 2452 { | 2449 { |
| 2453 ASSERT(shadowHost); | 2450 ASSERT(shadowHost); |
| 2454 ASSERT(isShadowHost(shadowHost)); | 2451 ASSERT(isShadowHost(shadowHost)); |
| 2455 | 2452 |
| 2456 const ShadowRoot* shadowRoot = containingShadowRoot(); | 2453 const ShadowRoot* shadowRoot = containingShadowRoot(); |
| 2457 while (shadowRoot) { | 2454 while (shadowRoot) { |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3540 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems | 3537 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems |
| 3541 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 | 3538 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 |
| 3542 if (hasTagName(optionTag) || hasTagName(optgroupTag)) | 3539 if (hasTagName(optionTag) || hasTagName(optgroupTag)) |
| 3543 return false; | 3540 return false; |
| 3544 if (FullscreenElementStack::isActiveFullScreenElement(this)) | 3541 if (FullscreenElementStack::isActiveFullScreenElement(this)) |
| 3545 return false; | 3542 return false; |
| 3546 return true; | 3543 return true; |
| 3547 } | 3544 } |
| 3548 | 3545 |
| 3549 } // namespace WebCore | 3546 } // namespace WebCore |
| OLD | NEW |