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

Unified Diff: Source/core/dom/Document.cpp

Issue 795833004: Use dictionaries for context creation attributes. Eliminate custom bindings. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/frame/ImageBitmapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 5a09d1d367578cc53657d00fa5ce5ccae1876ee8..ef71e9c544cb790dc463698b89162921bac8697d 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -145,6 +145,7 @@
#include "core/html/HTMLTitleElement.h"
#include "core/html/PluginDocument.h"
#include "core/html/WindowNameCollection.h"
+#include "core/html/canvas/CanvasContextCreationAttributes.h"
#include "core/html/canvas/CanvasRenderingContext.h"
#include "core/html/canvas/CanvasRenderingContext2D.h"
#include "core/html/canvas/WebGLRenderingContext.h"
@@ -4941,15 +4942,7 @@ void Document::getCSSCanvasContext(const String& type, const String& name, int w
{
HTMLCanvasElement& element = getCSSCanvasElement(name);
element.setSize(IntSize(width, height));
- CanvasRenderingContext* context = element.getContext(type);
- if (!context)
- return;
-
- if (context->is2d()) {
- returnValue.setCanvasRenderingContext2D(toCanvasRenderingContext2D(context));
- } else if (context->is3d()) {
- returnValue.setWebGLRenderingContext(toWebGLRenderingContext(context));
- }
+ element.getContext(type, CanvasContextCreationAttributes(), returnValue);
}
HTMLCanvasElement& Document::getCSSCanvasElement(const String& name)
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/frame/ImageBitmapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698