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

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

Issue 16708002: Simplify Custom Element constructors to be functions, not wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 6 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/Document.h ('k') | Source/core/dom/Document.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 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "core/css/MediaQueryMatcher.h" 49 #include "core/css/MediaQueryMatcher.h"
50 #include "core/css/StylePropertySet.h" 50 #include "core/css/StylePropertySet.h"
51 #include "core/css/StyleSheetContents.h" 51 #include "core/css/StyleSheetContents.h"
52 #include "core/css/StyleSheetList.h" 52 #include "core/css/StyleSheetList.h"
53 #include "core/css/resolver/StyleResolver.h" 53 #include "core/css/resolver/StyleResolver.h"
54 #include "core/dom/Attr.h" 54 #include "core/dom/Attr.h"
55 #include "core/dom/Attribute.h" 55 #include "core/dom/Attribute.h"
56 #include "core/dom/CDATASection.h" 56 #include "core/dom/CDATASection.h"
57 #include "core/dom/Comment.h" 57 #include "core/dom/Comment.h"
58 #include "core/dom/ContextFeatures.h" 58 #include "core/dom/ContextFeatures.h"
59 #include "core/dom/CustomElementConstructor.h"
60 #include "core/dom/CustomElementRegistry.h" 59 #include "core/dom/CustomElementRegistry.h"
61 #include "core/dom/DOMImplementation.h" 60 #include "core/dom/DOMImplementation.h"
62 #include "core/dom/DOMNamedFlowCollection.h" 61 #include "core/dom/DOMNamedFlowCollection.h"
63 #include "core/dom/DocumentEventQueue.h" 62 #include "core/dom/DocumentEventQueue.h"
64 #include "core/dom/DocumentFragment.h" 63 #include "core/dom/DocumentFragment.h"
65 #include "core/dom/DocumentLifecycleObserver.h" 64 #include "core/dom/DocumentLifecycleObserver.h"
66 #include "core/dom/DocumentMarkerController.h" 65 #include "core/dom/DocumentMarkerController.h"
67 #include "core/dom/DocumentSharedObjectPool.h" 66 #include "core/dom/DocumentSharedObjectPool.h"
68 #include "core/dom/DocumentStyleSheetCollection.h" 67 #include "core/dom/DocumentStyleSheetCollection.h"
69 #include "core/dom/DocumentType.h" 68 #include "core/dom/DocumentType.h"
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 element = createElementNS(namespaceURI, qualifiedName, ec); 823 element = createElementNS(namespaceURI, qualifiedName, ec);
825 824
826 if (!typeExtension.isNull()) { 825 if (!typeExtension.isNull()) {
827 setTypeExtension(element.get(), typeExtension); 826 setTypeExtension(element.get(), typeExtension);
828 ensureCustomElementRegistry()->didGiveTypeExtension(element.get(), typeE xtension); 827 ensureCustomElementRegistry()->didGiveTypeExtension(element.get(), typeE xtension);
829 } 828 }
830 829
831 return element; 830 return element;
832 } 831 }
833 832
834 PassRefPtr<CustomElementConstructor> Document::registerElement(WebCore::ScriptSt ate* state, const AtomicString& name, ExceptionCode& ec) 833 ScriptValue Document::registerElement(WebCore::ScriptState* state, const AtomicS tring& name, ExceptionCode& ec)
835 { 834 {
836 return registerElement(state, name, Dictionary(), ec); 835 return registerElement(state, name, Dictionary(), ec);
837 } 836 }
838 837
839 PassRefPtr<CustomElementConstructor> Document::registerElement(WebCore::ScriptSt ate* state, const AtomicString& name, const Dictionary& options, ExceptionCode& ec) 838 ScriptValue Document::registerElement(WebCore::ScriptState* state, const AtomicS tring& name, const Dictionary& options, ExceptionCode& ec)
840 { 839 {
841 if (!isHTMLDocument() && !isXHTMLDocument()) { 840 if (!isHTMLDocument() && !isXHTMLDocument()) {
842 ec = NOT_SUPPORTED_ERR; 841 ec = NOT_SUPPORTED_ERR;
843 return 0; 842 return ScriptValue();
844 } 843 }
845 844
846 return ensureCustomElementRegistry()->registerElement(state, name, options, ec); 845 return ensureCustomElementRegistry()->registerElement(state, name, options, ec);
847 } 846 }
848 847
849 CustomElementRegistry* Document::ensureCustomElementRegistry() 848 CustomElementRegistry* Document::ensureCustomElementRegistry()
850 { 849 {
851 if (!m_registry) { 850 if (!m_registry) {
852 ASSERT(isHTMLDocument() || isXHTMLDocument()); 851 ASSERT(isHTMLDocument() || isXHTMLDocument());
853 m_registry = adoptRef(new CustomElementRegistry(this)); 852 m_registry = adoptRef(new CustomElementRegistry(this));
(...skipping 4381 matching lines...) Expand 10 before | Expand all | Expand 10 after
5235 } 5234 }
5236 5235
5237 void Document::addLifecycleObserver(DocumentLifecycleObserver* observer) 5236 void Document::addLifecycleObserver(DocumentLifecycleObserver* observer)
5238 { 5237 {
5239 if (!m_lifecycleNotifier) 5238 if (!m_lifecycleNotifier)
5240 m_lifecycleNotifier = DocumentLifecycleNotifier::create(); 5239 m_lifecycleNotifier = DocumentLifecycleNotifier::create();
5241 m_lifecycleNotifier->addObserver(observer); 5240 m_lifecycleNotifier->addObserver(observer);
5242 } 5241 }
5243 5242
5244 } // namespace WebCore 5243 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698