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

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

Issue 23009004: Process Custom Elements in post-order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 PassRefPtr<Element> Document::createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState& es) 712 PassRefPtr<Element> Document::createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState& es)
713 { 713 {
714 if (!isValidName(localName)) { 714 if (!isValidName(localName)) {
715 es.throwDOMException(InvalidCharacterError); 715 es.throwDOMException(InvalidCharacterError);
716 return 0; 716 return 0;
717 } 717 }
718 718
719 RefPtr<Element> element; 719 RefPtr<Element> element;
720 720
721 if (CustomElement::isCustomTagName(localName) && registrationContext()) 721 if (CustomElement::isCustomTagName(localName) && registrationContext())
722 element = registrationContext()->createCustomTagElement(this, QualifiedN ame(nullAtom, localName, xhtmlNamespaceURI)); 722 element = registrationContext()->createCustomTagElement(this, QualifiedN ame(nullAtom, localName, xhtmlNamespaceURI), CustomElementRegistrationContext::C reatedByDOM);
723 else 723 else
724 element = createElement(localName, es); 724 element = createElement(localName, es);
725 725
726 if (!typeExtension.isNull() && !typeExtension.isEmpty()) 726 if (!typeExtension.isNull() && !typeExtension.isEmpty())
727 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension); 727 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension);
728 728
729 return element; 729 return element;
730 } 730 }
731 731
732 PassRefPtr<Element> Document::createElementNS(const AtomicString& namespaceURI, const String& qualifiedName, const AtomicString& typeExtension, ExceptionState& es) 732 PassRefPtr<Element> Document::createElementNS(const AtomicString& namespaceURI, const String& qualifiedName, const AtomicString& typeExtension, ExceptionState& es)
733 { 733 {
734 String prefix, localName; 734 String prefix, localName;
735 if (!parseQualifiedName(qualifiedName, prefix, localName, es)) 735 if (!parseQualifiedName(qualifiedName, prefix, localName, es))
736 return 0; 736 return 0;
737 737
738 QualifiedName qName(prefix, localName, namespaceURI); 738 QualifiedName qName(prefix, localName, namespaceURI);
739 if (!hasValidNamespaceForElements(qName)) { 739 if (!hasValidNamespaceForElements(qName)) {
740 es.throwDOMException(NamespaceError); 740 es.throwDOMException(NamespaceError);
741 return 0; 741 return 0;
742 } 742 }
743 743
744 RefPtr<Element> element; 744 RefPtr<Element> element;
745 if (CustomElement::isCustomTagName(qName.localName()) && registrationContext ()) 745 if (CustomElement::isCustomTagName(qName.localName()) && registrationContext ())
746 element = registrationContext()->createCustomTagElement(this, qName); 746 element = registrationContext()->createCustomTagElement(this, qName, Cus tomElementRegistrationContext::CreatedByDOM);
747 else 747 else
748 element = createElementNS(namespaceURI, qualifiedName, es); 748 element = createElementNS(namespaceURI, qualifiedName, es);
749 749
750 if (!typeExtension.isNull() && !typeExtension.isEmpty()) 750 if (!typeExtension.isNull() && !typeExtension.isEmpty())
751 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension); 751 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension);
752 752
753 return element; 753 return element;
754 } 754 }
755 755
756 ScriptValue Document::registerElement(WebCore::ScriptState* state, const AtomicS tring& name, ExceptionState& es) 756 ScriptValue Document::registerElement(WebCore::ScriptState* state, const AtomicS tring& name, ExceptionState& es)
(...skipping 4464 matching lines...) Expand 10 before | Expand all | Expand 10 after
5221 { 5221 {
5222 return DocumentLifecycleNotifier::create(this); 5222 return DocumentLifecycleNotifier::create(this);
5223 } 5223 }
5224 5224
5225 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5225 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5226 { 5226 {
5227 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5227 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5228 } 5228 }
5229 5229
5230 } // namespace WebCore 5230 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698