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

Side by Side Diff: sky/engine/core/dom/Document.cpp

Issue 876913002: Remove CSSCanvas values. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/dom/Document.h ('k') | sky/engine/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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 HTMLImportsController::removeFrom(*this); 376 HTMLImportsController::removeFrom(*this);
377 377
378 // removeDetachedChildren() doesn't always unregister IDs, 378 // removeDetachedChildren() doesn't always unregister IDs,
379 // so tear down scope information upfront to avoid having stale references i n the map. 379 // so tear down scope information upfront to avoid having stale references i n the map.
380 destroyTreeScopeData(); 380 destroyTreeScopeData();
381 381
382 removeDetachedChildren(); 382 removeDetachedChildren();
383 383
384 m_markers->clear(); 384 m_markers->clear();
385 385
386 m_cssCanvasElements.clear();
387
388 // FIXME: consider using ActiveDOMObject. 386 // FIXME: consider using ActiveDOMObject.
389 if (m_scriptedAnimationController) 387 if (m_scriptedAnimationController)
390 m_scriptedAnimationController->clearDocumentPointer(); 388 m_scriptedAnimationController->clearDocumentPointer();
391 m_scriptedAnimationController.clear(); 389 m_scriptedAnimationController.clear();
392 390
393 m_lifecycle.advanceTo(DocumentLifecycle::Disposed); 391 m_lifecycle.advanceTo(DocumentLifecycle::Disposed);
394 lifecycleNotifier().notifyDocumentWasDisposed(); 392 lifecycleNotifier().notifyDocumentWasDisposed();
395 } 393 }
396 #endif 394 #endif
397 395
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
2141 m_ranges.add(range); 2139 m_ranges.add(range);
2142 } 2140 }
2143 2141
2144 void Document::detachRange(Range* range) 2142 void Document::detachRange(Range* range)
2145 { 2143 {
2146 // We don't ASSERT m_ranges.contains(range) to allow us to call this 2144 // We don't ASSERT m_ranges.contains(range) to allow us to call this
2147 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 2145 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044
2148 m_ranges.remove(range); 2146 m_ranges.remove(range);
2149 } 2147 }
2150 2148
2151 void Document::getCSSCanvasContext(const String& type, const String& name, int w idth, int height, RefPtr<CanvasRenderingContext2D>& context2d, RefPtr<WebGLRende ringContext>& context3d)
2152 {
2153 HTMLCanvasElement& element = getCSSCanvasElement(name);
2154 element.setSize(IntSize(width, height));
2155 CanvasRenderingContext* context = element.getContext(type);
2156 if (!context)
2157 return;
2158
2159 if (context->is2d()) {
2160 context2d = toCanvasRenderingContext2D(context);
2161 } else if (context->is3d()) {
2162 context3d = toWebGLRenderingContext(context);
2163 }
2164 }
2165
2166 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name)
2167 {
2168 RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, nullptr). storedValue->value;
2169 if (!element) {
2170 element = HTMLCanvasElement::create(*this);
2171 element->setAccelerationDisabled(true);
2172 }
2173 return *element;
2174 }
2175
2176 void Document::reportBlockedScriptExecutionToInspector(const String& directiveTe xt) 2149 void Document::reportBlockedScriptExecutionToInspector(const String& directiveTe xt)
2177 { 2150 {
2178 } 2151 }
2179 2152
2180 void Document::addMessage(PassRefPtr<ConsoleMessage> consoleMessage) 2153 void Document::addMessage(PassRefPtr<ConsoleMessage> consoleMessage)
2181 { 2154 {
2182 if (!m_frame) 2155 if (!m_frame)
2183 return; 2156 return;
2184 2157
2185 if (!consoleMessage->scriptState() && consoleMessage->url().isNull() && !con soleMessage->lineNumber()) { 2158 if (!consoleMessage->scriptState() && consoleMessage->url().isNull() && !con soleMessage->lineNumber()) {
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 using namespace blink; 2356 using namespace blink;
2384 void showLiveDocumentInstances() 2357 void showLiveDocumentInstances()
2385 { 2358 {
2386 WeakDocumentSet& set = liveDocumentSet(); 2359 WeakDocumentSet& set = liveDocumentSet();
2387 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 2360 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
2388 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 2361 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
2389 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 2362 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
2390 } 2363 }
2391 } 2364 }
2392 #endif 2365 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Document.h ('k') | sky/engine/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698