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

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

Issue 177983005: Remove CanvasRenderingContext from the web exposed objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
« 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 #include "core/html/HTMLIFrameElement.h" 128 #include "core/html/HTMLIFrameElement.h"
129 #include "core/html/HTMLInputElement.h" 129 #include "core/html/HTMLInputElement.h"
130 #include "core/html/HTMLLinkElement.h" 130 #include "core/html/HTMLLinkElement.h"
131 #include "core/html/HTMLMetaElement.h" 131 #include "core/html/HTMLMetaElement.h"
132 #include "core/html/HTMLNameCollection.h" 132 #include "core/html/HTMLNameCollection.h"
133 #include "core/html/HTMLScriptElement.h" 133 #include "core/html/HTMLScriptElement.h"
134 #include "core/html/HTMLStyleElement.h" 134 #include "core/html/HTMLStyleElement.h"
135 #include "core/html/HTMLTemplateElement.h" 135 #include "core/html/HTMLTemplateElement.h"
136 #include "core/html/HTMLTitleElement.h" 136 #include "core/html/HTMLTitleElement.h"
137 #include "core/html/PluginDocument.h" 137 #include "core/html/PluginDocument.h"
138 #include "core/html/canvas/CanvasRenderingContext.h"
139 #include "core/html/canvas/CanvasRenderingContext2D.h"
140 #include "core/html/canvas/WebGLRenderingContext.h"
138 #include "core/html/forms/FormController.h" 141 #include "core/html/forms/FormController.h"
139 #include "core/html/imports/HTMLImport.h" 142 #include "core/html/imports/HTMLImport.h"
140 #include "core/html/parser/HTMLDocumentParser.h" 143 #include "core/html/parser/HTMLDocumentParser.h"
141 #include "core/html/parser/HTMLParserIdioms.h" 144 #include "core/html/parser/HTMLParserIdioms.h"
142 #include "core/html/parser/NestingLevelIncrementer.h" 145 #include "core/html/parser/NestingLevelIncrementer.h"
143 #include "core/html/parser/TextResourceDecoder.h" 146 #include "core/html/parser/TextResourceDecoder.h"
144 #include "core/inspector/InspectorCounters.h" 147 #include "core/inspector/InspectorCounters.h"
145 #include "core/inspector/InspectorInstrumentation.h" 148 #include "core/inspector/InspectorInstrumentation.h"
146 #include "core/inspector/ScriptCallStack.h" 149 #include "core/inspector/ScriptCallStack.h"
147 #include "core/loader/CookieJar.h" 150 #include "core/loader/CookieJar.h"
(...skipping 4553 matching lines...) Expand 10 before | Expand all | Expand 10 after
4701 m_ranges.add(range); 4704 m_ranges.add(range);
4702 } 4705 }
4703 4706
4704 void Document::detachRange(Range* range) 4707 void Document::detachRange(Range* range)
4705 { 4708 {
4706 // We don't ASSERT m_ranges.contains(range) to allow us to call this 4709 // We don't ASSERT m_ranges.contains(range) to allow us to call this
4707 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 4710 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044
4708 m_ranges.remove(range); 4711 m_ranges.remove(range);
4709 } 4712 }
4710 4713
4711 CanvasRenderingContext* Document::getCSSCanvasContext(const String& type, const String& name, int width, int height) 4714 void Document::getCSSCanvasContext(const String& type, const String& name, int w idth, int height, bool& is2d, RefPtr<CanvasRenderingContext2D>& context2d, bool& is3d, RefPtr<WebGLRenderingContext>& context3d)
4712 { 4715 {
4713 HTMLCanvasElement& element = getCSSCanvasElement(name); 4716 HTMLCanvasElement& element = getCSSCanvasElement(name);
4714 element.setSize(IntSize(width, height)); 4717 element.setSize(IntSize(width, height));
4715 return element.getContext(type); 4718 CanvasRenderingContext* context = element.getContext(type);
4719 if (!context)
4720 return;
4721
4722 if (context->is2d()) {
4723 is2d = true;
4724 context2d = toCanvasRenderingContext2D(context);
4725 } else if (context->is3d()) {
4726 is3d = true;
4727 context3d = toWebGLRenderingContext(context);
4728 }
4716 } 4729 }
4717 4730
4718 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name) 4731 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name)
4719 { 4732 {
4720 RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, nullptr). storedValue->value; 4733 RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, nullptr). storedValue->value;
4721 if (!element) { 4734 if (!element) {
4722 element = HTMLCanvasElement::create(*this); 4735 element = HTMLCanvasElement::create(*this);
4723 element->setAccelerationDisabled(true); 4736 element->setAccelerationDisabled(true);
4724 } 4737 }
4725 return *element; 4738 return *element;
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
5435 void Document::defaultEventHandler(Event* event) 5448 void Document::defaultEventHandler(Event* event)
5436 { 5449 {
5437 if (frame() && frame()->remotePlatformLayer()) { 5450 if (frame() && frame()->remotePlatformLayer()) {
5438 frame()->chromeClient().forwardInputEvent(this, event); 5451 frame()->chromeClient().forwardInputEvent(this, event);
5439 return; 5452 return;
5440 } 5453 }
5441 Node::defaultEventHandler(event); 5454 Node::defaultEventHandler(event);
5442 } 5455 }
5443 5456
5444 } // namespace WebCore 5457 } // 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