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. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. |
8 * All rights reserved. | 8 * All rights reserved. |
9 * (C) 2007 Eric Seidel (eric@webkit.org) | 9 * (C) 2007 Eric Seidel (eric@webkit.org) |
10 * | 10 * |
(...skipping 2494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2505 size_t index, | 2505 size_t index, |
2506 SynchronizationOfLazyAttribute inSynchronizationOfLazyAttribute) { | 2506 SynchronizationOfLazyAttribute inSynchronizationOfLazyAttribute) { |
2507 MutableAttributeCollection attributes = | 2507 MutableAttributeCollection attributes = |
2508 ensureUniqueElementData().attributes(); | 2508 ensureUniqueElementData().attributes(); |
2509 SECURITY_DCHECK(index < attributes.size()); | 2509 SECURITY_DCHECK(index < attributes.size()); |
2510 | 2510 |
2511 QualifiedName name = attributes[index].name(); | 2511 QualifiedName name = attributes[index].name(); |
2512 AtomicString valueBeingRemoved = attributes[index].value(); | 2512 AtomicString valueBeingRemoved = attributes[index].value(); |
2513 | 2513 |
2514 if (!inSynchronizationOfLazyAttribute) { | 2514 if (!inSynchronizationOfLazyAttribute) { |
2515 if (!valueBeingRemoved.isNull()) | 2515 if (!valueBeingRemoved.isNull()) { |
2516 willModifyAttribute(name, valueBeingRemoved, nullAtom); | 2516 willModifyAttribute(name, valueBeingRemoved, nullAtom); |
| 2517 } else if (getCustomElementState() == CustomElementState::Custom) { |
| 2518 // This would otherwise be enqueued by willModifyAttribute. |
| 2519 CustomElement::enqueueAttributeChangedCallback( |
| 2520 this, name, valueBeingRemoved, nullAtom); |
| 2521 } |
2517 } | 2522 } |
2518 | 2523 |
2519 if (Attr* attrNode = attrIfExists(name)) | 2524 if (Attr* attrNode = attrIfExists(name)) |
2520 detachAttrNodeFromElementWithValue(attrNode, attributes[index].value()); | 2525 detachAttrNodeFromElementWithValue(attrNode, attributes[index].value()); |
2521 | 2526 |
2522 attributes.remove(index); | 2527 attributes.remove(index); |
2523 | 2528 |
2524 if (!inSynchronizationOfLazyAttribute) | 2529 if (!inSynchronizationOfLazyAttribute) |
2525 didRemoveAttribute(name, valueBeingRemoved); | 2530 didRemoveAttribute(name, valueBeingRemoved); |
2526 } | 2531 } |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3505 updateExtraNamedItemRegistration(oldId, newId); | 3510 updateExtraNamedItemRegistration(oldId, newId); |
3506 } | 3511 } |
3507 | 3512 |
3508 void Element::willModifyAttribute(const QualifiedName& name, | 3513 void Element::willModifyAttribute(const QualifiedName& name, |
3509 const AtomicString& oldValue, | 3514 const AtomicString& oldValue, |
3510 const AtomicString& newValue) { | 3515 const AtomicString& newValue) { |
3511 if (name == HTMLNames::nameAttr) { | 3516 if (name == HTMLNames::nameAttr) { |
3512 updateName(oldValue, newValue); | 3517 updateName(oldValue, newValue); |
3513 } | 3518 } |
3514 | 3519 |
| 3520 if (getCustomElementState() == CustomElementState::Custom) { |
| 3521 CustomElement::enqueueAttributeChangedCallback(this, name, oldValue, |
| 3522 newValue); |
| 3523 } |
| 3524 |
3515 if (oldValue != newValue) { | 3525 if (oldValue != newValue) { |
3516 document().styleEngine().attributeChangedForElement(name, *this); | 3526 document().styleEngine().attributeChangedForElement(name, *this); |
3517 if (getCustomElementState() == CustomElementState::Custom) | 3527 if (isUpgradedV0CustomElement()) { |
3518 CustomElement::enqueueAttributeChangedCallback(this, name, oldValue, | |
3519 newValue); | |
3520 else if (isUpgradedV0CustomElement()) | |
3521 V0CustomElement::attributeDidChange(this, name.localName(), oldValue, | 3528 V0CustomElement::attributeDidChange(this, name.localName(), oldValue, |
3522 newValue); | 3529 newValue); |
| 3530 } |
3523 } | 3531 } |
3524 | 3532 |
3525 if (MutationObserverInterestGroup* recipients = | 3533 if (MutationObserverInterestGroup* recipients = |
3526 MutationObserverInterestGroup::createForAttributesMutation(*this, | 3534 MutationObserverInterestGroup::createForAttributesMutation(*this, |
3527 name)) | 3535 name)) |
3528 recipients->enqueueMutationRecord( | 3536 recipients->enqueueMutationRecord( |
3529 MutationRecord::createAttributes(this, name, oldValue)); | 3537 MutationRecord::createAttributes(this, name, oldValue)); |
3530 | 3538 |
3531 InspectorInstrumentation::willModifyDOMAttr(this, oldValue, newValue); | 3539 InspectorInstrumentation::willModifyDOMAttr(this, oldValue, newValue); |
3532 } | 3540 } |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4104 } | 4112 } |
4105 | 4113 |
4106 DEFINE_TRACE_WRAPPERS(Element) { | 4114 DEFINE_TRACE_WRAPPERS(Element) { |
4107 if (hasRareData()) { | 4115 if (hasRareData()) { |
4108 visitor->traceWrappers(elementRareData()); | 4116 visitor->traceWrappers(elementRareData()); |
4109 } | 4117 } |
4110 ContainerNode::traceWrappers(visitor); | 4118 ContainerNode::traceWrappers(visitor); |
4111 } | 4119 } |
4112 | 4120 |
4113 } // namespace blink | 4121 } // namespace blink |
OLD | NEW |