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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/frame/ImageBitmapTest.cpp » ('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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #include "core/html/HTMLIFrameElement.h" 138 #include "core/html/HTMLIFrameElement.h"
139 #include "core/html/HTMLInputElement.h" 139 #include "core/html/HTMLInputElement.h"
140 #include "core/html/HTMLLinkElement.h" 140 #include "core/html/HTMLLinkElement.h"
141 #include "core/html/HTMLMetaElement.h" 141 #include "core/html/HTMLMetaElement.h"
142 #include "core/html/HTMLScriptElement.h" 142 #include "core/html/HTMLScriptElement.h"
143 #include "core/html/HTMLStyleElement.h" 143 #include "core/html/HTMLStyleElement.h"
144 #include "core/html/HTMLTemplateElement.h" 144 #include "core/html/HTMLTemplateElement.h"
145 #include "core/html/HTMLTitleElement.h" 145 #include "core/html/HTMLTitleElement.h"
146 #include "core/html/PluginDocument.h" 146 #include "core/html/PluginDocument.h"
147 #include "core/html/WindowNameCollection.h" 147 #include "core/html/WindowNameCollection.h"
148 #include "core/html/canvas/CanvasContextCreationAttributes.h"
148 #include "core/html/canvas/CanvasRenderingContext.h" 149 #include "core/html/canvas/CanvasRenderingContext.h"
149 #include "core/html/canvas/CanvasRenderingContext2D.h" 150 #include "core/html/canvas/CanvasRenderingContext2D.h"
150 #include "core/html/canvas/WebGLRenderingContext.h" 151 #include "core/html/canvas/WebGLRenderingContext.h"
151 #include "core/html/forms/FormController.h" 152 #include "core/html/forms/FormController.h"
152 #include "core/html/imports/HTMLImportLoader.h" 153 #include "core/html/imports/HTMLImportLoader.h"
153 #include "core/html/imports/HTMLImportsController.h" 154 #include "core/html/imports/HTMLImportsController.h"
154 #include "core/html/parser/HTMLDocumentParser.h" 155 #include "core/html/parser/HTMLDocumentParser.h"
155 #include "core/html/parser/HTMLParserIdioms.h" 156 #include "core/html/parser/HTMLParserIdioms.h"
156 #include "core/html/parser/NestingLevelIncrementer.h" 157 #include "core/html/parser/NestingLevelIncrementer.h"
157 #include "core/html/parser/TextResourceDecoder.h" 158 #include "core/html/parser/TextResourceDecoder.h"
(...skipping 4776 matching lines...) Expand 10 before | Expand all | Expand 10 after
4934 { 4935 {
4935 // We don't ASSERT m_ranges.contains(range) to allow us to call this 4936 // We don't ASSERT m_ranges.contains(range) to allow us to call this
4936 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 4937 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044
4937 m_ranges.remove(range); 4938 m_ranges.remove(range);
4938 } 4939 }
4939 4940
4940 void Document::getCSSCanvasContext(const String& type, const String& name, int w idth, int height, CanvasRenderingContext2DOrWebGLRenderingContext& returnValue) 4941 void Document::getCSSCanvasContext(const String& type, const String& name, int w idth, int height, CanvasRenderingContext2DOrWebGLRenderingContext& returnValue)
4941 { 4942 {
4942 HTMLCanvasElement& element = getCSSCanvasElement(name); 4943 HTMLCanvasElement& element = getCSSCanvasElement(name);
4943 element.setSize(IntSize(width, height)); 4944 element.setSize(IntSize(width, height));
4944 CanvasRenderingContext* context = element.getContext(type); 4945 element.getContext(type, CanvasContextCreationAttributes(), returnValue);
4945 if (!context)
4946 return;
4947
4948 if (context->is2d()) {
4949 returnValue.setCanvasRenderingContext2D(toCanvasRenderingContext2D(conte xt));
4950 } else if (context->is3d()) {
4951 returnValue.setWebGLRenderingContext(toWebGLRenderingContext(context));
4952 }
4953 } 4946 }
4954 4947
4955 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name) 4948 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name)
4956 { 4949 {
4957 RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(nam e, nullptr).storedValue->value; 4950 RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(nam e, nullptr).storedValue->value;
4958 if (!element) { 4951 if (!element) {
4959 element = HTMLCanvasElement::create(*this); 4952 element = HTMLCanvasElement::create(*this);
4960 element->setAccelerationDisabled(true); 4953 element->setAccelerationDisabled(true);
4961 } 4954 }
4962 return *element; 4955 return *element;
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
5846 #ifndef NDEBUG 5839 #ifndef NDEBUG
5847 using namespace blink; 5840 using namespace blink;
5848 void showLiveDocumentInstances() 5841 void showLiveDocumentInstances()
5849 { 5842 {
5850 WeakDocumentSet& set = liveDocumentSet(); 5843 WeakDocumentSet& set = liveDocumentSet();
5851 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5844 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5852 for (Document* document : set) 5845 for (Document* document : set)
5853 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5846 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5854 } 5847 }
5855 #endif 5848 #endif
OLDNEW
« 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