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

Side by Side Diff: Source/bindings/v8/CustomElementHelpers.h

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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 21 matching lines...) Expand all
32 #define CustomElementHelpers_h 32 #define CustomElementHelpers_h
33 33
34 #include "bindings/v8/DOMDataStore.h" 34 #include "bindings/v8/DOMDataStore.h"
35 #include "bindings/v8/ScriptValue.h" 35 #include "bindings/v8/ScriptValue.h"
36 #include "core/dom/CustomElementDefinition.h" 36 #include "core/dom/CustomElementDefinition.h"
37 #include "core/dom/CustomElementRegistry.h" 37 #include "core/dom/CustomElementRegistry.h"
38 #include "core/dom/Element.h" 38 #include "core/dom/Element.h"
39 #include "wtf/Forward.h" 39 #include "wtf/Forward.h"
40 #include "wtf/HashSet.h" 40 #include "wtf/HashSet.h"
41 #include "wtf/PassRefPtr.h" 41 #include "wtf/PassRefPtr.h"
42 #include "wtf/text/AtomicString.h"
42 43
43 namespace WebCore { 44 namespace WebCore {
44 45
45 class CustomElementConstructor;
46 class CustomElementInvocation; 46 class CustomElementInvocation;
47 class Document;
47 class HTMLElement; 48 class HTMLElement;
48 class QualifiedName; 49 class QualifiedName;
49 class SVGElement; 50 class SVGElement;
50 class ScriptState; 51 class ScriptState;
51 52
52 class CustomElementHelpers { 53 class CustomElementHelpers {
53 public: 54 public:
54 static void didRegisterDefinition(CustomElementDefinition*, ScriptExecutionC ontext*, const HashSet<Element*>& upgradeCandidates, const ScriptValue& prototyp eValue); 55 static void didRegisterDefinition(CustomElementDefinition*, ScriptExecutionC ontext*, const HashSet<Element*>& upgradeCandidates, const ScriptValue& prototyp eValue);
55 56
56 static bool initializeConstructorWrapper(CustomElementConstructor*, const Sc riptValue& prototype, ScriptState*); 57 static ScriptValue createConstructor(ScriptState*, const ScriptValue& protot ype, Document*, const AtomicString& namespaceURI, const AtomicString& name, cons t AtomicString& type);
57 58
58 static bool isValidPrototypeParameter(const ScriptValue&, ScriptState*, Atom icString& namespaceURI); 59 static bool isValidPrototypeParameter(const ScriptValue&, ScriptState*, Atom icString& namespaceURI);
59 static bool isValidPrototypeParameter(const ScriptValue&, ScriptState*); 60 static bool isValidPrototypeParameter(const ScriptValue&, ScriptState*);
60 61
61 static bool isFeatureAllowed(ScriptState*); 62 static bool isFeatureAllowed(ScriptState*);
62 static bool isFeatureAllowed(v8::Handle<v8::Context>); 63 static bool isFeatureAllowed(v8::Handle<v8::Context>);
63 64
64 static WrapperTypeInfo* findWrapperType(v8::Handle<v8::Value> chain); 65 static WrapperTypeInfo* findWrapperType(v8::Handle<v8::Value> chain);
65 66
66 static const QualifiedName* findLocalName(v8::Handle<v8::Object> chain); 67 static const QualifiedName* findLocalName(v8::Handle<v8::Object> chain);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 112
112 inline bool CustomElementHelpers::isValidPrototypeParameter(const ScriptValue& v alue, ScriptState* state) 113 inline bool CustomElementHelpers::isValidPrototypeParameter(const ScriptValue& v alue, ScriptState* state)
113 { 114 {
114 AtomicString namespaceURI; 115 AtomicString namespaceURI;
115 return isValidPrototypeParameter(value, state, namespaceURI); 116 return isValidPrototypeParameter(value, state, namespaceURI);
116 } 117 }
117 118
118 } // namespace WebCore 119 } // namespace WebCore
119 120
120 #endif // CustomElementHelpers_h 121 #endif // CustomElementHelpers_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/bindings/v8/CustomElementHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698