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

Unified Diff: Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
diff --git a/Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp b/Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
index 6e0f42f46269504071b519bf3b95dd6c11dee20b..30029c769c25237b573b30f3ac6fcc6764bf6d0a 100644
--- a/Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
+++ b/Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
@@ -59,6 +59,7 @@ static void v8HTMLImageElementConstructorMethodCustom(const v8::FunctionCallback
}
Document* document = currentDocument();
+ ASSERT(document);
// Make sure the document is added to the DOM Node map. Otherwise, the HTMLImageElement instance
// may end up being the only node in the map and get garbage-collected prematurely.
@@ -80,7 +81,7 @@ static void v8HTMLImageElementConstructorMethodCustom(const v8::FunctionCallback
optionalHeight = &height;
}
- RefPtr<HTMLImageElement> image = HTMLImageElement::createForJSConstructor(document, optionalWidth, optionalHeight);
+ RefPtr<HTMLImageElement> image = HTMLImageElement::createForJSConstructor(*document, optionalWidth, optionalHeight);
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::associateObjectWithWrapper<V8HTMLImageElement>(image.release(), &V8HTMLImageElementConstructor::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
v8SetReturnValue(args, wrapper);
« no previous file with comments | « Source/bindings/tests/results/V8TestNamedConstructor.cpp ('k') | Source/core/dom/CustomElementRegistrationContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698