Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: Source/core/dom/Element.cpp

Issue 18789002: Implement Custom Elements' attributeChangedCallback. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Sync to tip. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/CustomElementLifecycleCallbacks.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 24 matching lines...) Expand all
35 #include "core/css/CSSParser.h" 35 #include "core/css/CSSParser.h"
36 #include "core/css/CSSStyleSheet.h" 36 #include "core/css/CSSStyleSheet.h"
37 #include "core/css/CSSValuePool.h" 37 #include "core/css/CSSValuePool.h"
38 #include "core/css/PropertySetCSSStyleDeclaration.h" 38 #include "core/css/PropertySetCSSStyleDeclaration.h"
39 #include "core/css/StylePropertySet.h" 39 #include "core/css/StylePropertySet.h"
40 #include "core/css/resolver/StyleResolver.h" 40 #include "core/css/resolver/StyleResolver.h"
41 #include "core/dom/Attr.h" 41 #include "core/dom/Attr.h"
42 #include "core/dom/Attribute.h" 42 #include "core/dom/Attribute.h"
43 #include "core/dom/ClientRect.h" 43 #include "core/dom/ClientRect.h"
44 #include "core/dom/ClientRectList.h" 44 #include "core/dom/ClientRectList.h"
45 #include "core/dom/CustomElementCallbackDispatcher.h"
45 #include "core/dom/CustomElementRegistry.h" 46 #include "core/dom/CustomElementRegistry.h"
46 #include "core/dom/DatasetDOMStringMap.h" 47 #include "core/dom/DatasetDOMStringMap.h"
47 #include "core/dom/Document.h" 48 #include "core/dom/Document.h"
48 #include "core/dom/DocumentSharedObjectPool.h" 49 #include "core/dom/DocumentSharedObjectPool.h"
49 #include "core/dom/ElementRareData.h" 50 #include "core/dom/ElementRareData.h"
50 #include "core/dom/ExceptionCode.h" 51 #include "core/dom/ExceptionCode.h"
51 #include "core/dom/FullscreenController.h" 52 #include "core/dom/FullscreenController.h"
52 #include "core/dom/MutationObserverInterestGroup.h" 53 #include "core/dom/MutationObserverInterestGroup.h"
53 #include "core/dom/MutationRecord.h" 54 #include "core/dom/MutationRecord.h"
54 #include "core/dom/NamedNodeMap.h" 55 #include "core/dom/NamedNodeMap.h"
(...skipping 2741 matching lines...) Expand 10 before | Expand all | Expand 10 after
2796 2797
2797 if (oldValue != newValue) { 2798 if (oldValue != newValue) {
2798 if (attached() && document()->styleResolver() && document()->styleResolv er()->hasSelectorForAttribute(name.localName())) 2799 if (attached() && document()->styleResolver() && document()->styleResolv er()->hasSelectorForAttribute(name.localName()))
2799 setNeedsStyleRecalc(); 2800 setNeedsStyleRecalc();
2800 } 2801 }
2801 2802
2802 if (OwnPtr<MutationObserverInterestGroup> recipients = MutationObserverInter estGroup::createForAttributesMutation(this, name)) 2803 if (OwnPtr<MutationObserverInterestGroup> recipients = MutationObserverInter estGroup::createForAttributesMutation(this, name))
2803 recipients->enqueueMutationRecord(MutationRecord::createAttributes(this, name, oldValue)); 2804 recipients->enqueueMutationRecord(MutationRecord::createAttributes(this, name, oldValue));
2804 2805
2805 InspectorInstrumentation::willModifyDOMAttr(document(), this, oldValue, newV alue); 2806 InspectorInstrumentation::willModifyDOMAttr(document(), this, oldValue, newV alue);
2807
2808 if (isUpgradedCustomElement()) {
2809 RefPtr<CustomElementDefinition> definition = document()->registry()->fin dFor(this);
2810 CustomElementCallbackDispatcher::instance().enqueueAttributeChangedCallb ack(definition->callbacks(), this, name.localName(), oldValue, newValue);
2811 }
2806 } 2812 }
2807 2813
2808 void Element::didAddAttribute(const QualifiedName& name, const AtomicString& val ue) 2814 void Element::didAddAttribute(const QualifiedName& name, const AtomicString& val ue)
2809 { 2815 {
2810 attributeChanged(name, value); 2816 attributeChanged(name, value);
2811 InspectorInstrumentation::didModifyDOMAttr(document(), this, name.localName( ), value); 2817 InspectorInstrumentation::didModifyDOMAttr(document(), this, name.localName( ), value);
2812 dispatchSubtreeModifiedEvent(); 2818 dispatchSubtreeModifiedEvent();
2813 } 2819 }
2814 2820
2815 void Element::didModifyAttribute(const QualifiedName& name, const AtomicString& value) 2821 void Element::didModifyAttribute(const QualifiedName& name, const AtomicString& value)
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 return 0; 3633 return 0;
3628 } 3634 }
3629 3635
3630 Attribute* UniqueElementData::attributeItem(unsigned index) 3636 Attribute* UniqueElementData::attributeItem(unsigned index)
3631 { 3637 {
3632 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3638 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3633 return &m_attributeVector.at(index); 3639 return &m_attributeVector.at(index);
3634 } 3640 }
3635 3641
3636 } // namespace WebCore 3642 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/CustomElementLifecycleCallbacks.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698