~ubuntu-branches/ubuntu/lucid/webkit/lucid-security

« back to all changes in this revision

Viewing changes to WebCore/html/HTMLCanvasElement.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type)
151
151
{
152
 
    // A Canvas can either be "2D" or "3D" never both. If you request a 2D canvas and the existing
153
 
    // context is already 2D, just return that. If the existing context is 3D, then destroy it
154
 
    // before creating a new 2D context. Vice versa when requesting a 3D canvas. Requesting a
 
152
    // A Canvas can either be "2D" or "webgl" but never both. If you request a 2D canvas and the existing
 
153
    // context is already 2D, just return that. If the existing context is WebGL, then destroy it
 
154
    // before creating a new 2D context. Vice versa when requesting a WebGL canvas. Requesting a
155
155
    // context with any other type string will destroy any existing context.
156
156
    
157
157
    // FIXME - The code depends on the context not going away once created, to prevent JS from
167
167
#if ENABLE(3D_CANVAS)    
168
168
    Settings* settings = document()->settings();
169
169
    if (settings && settings->webGLEnabled()) {
 
170
        // Accept the legacy "webkit-3d" name as well as the provisional "experimental-webgl" name.
 
171
        // Once ratified, we will also accept "webgl" as the context name.
170
172
        if ((type == "webkit-3d") ||
171
 
            (type == "GL")) {
 
173
            (type == "experimental-webgl")) {
172
174
            if (m_context && !m_context->is3d())
173
175
                return 0;
174
176
            if (!m_context) {