Title: [94319] trunk
Revision
94319
Author
wei...@apple.com
Date
2011-09-01 11:20:45 -0700 (Thu, 01 Sep 2011)

Log Message

WebGLContextEvent should have its own JS wrapper
https://bugs.webkit.org/show_bug.cgi?id=67352

Reviewed by Anders Carlsson.

Source/WebCore: 

The WebGLContextEvent was missing a proper JS wrapper, and thus
anyone using one in an EventListener was actually just getting
a plain old Event. Rectify this by generating the wrapper and 
wrapping it on creating.

Test: fast/canvas/webgl/WebGLContextEvent.html

* CodeGenerators.pri:
Add WebGLContextEvent.idl

* DerivedSources.make:
Add WebGLContextEvent and sort.

* WebCore.xcodeproj/project.pbxproj:
Add generated JSWebGLContextEvent.h/cpp.

* bindings/js/JSEventCustom.cpp:
(WebCore::toJS):
Wrap WebGLContextEvents as JSWebGLContextEvents.

* dom/Event.cpp:
(WebCore::Event::isWebGLContextEvent):
* dom/Event.h:
* html/canvas/WebGLContextEvent.cpp:
(WebCore::WebGLContextEvent::isWebGLContextEvent):
* html/canvas/WebGLContextEvent.h:
Add predicate for WebGLContextEvent.

LayoutTests: 

* fast/canvas/webgl/WebGLContextEvent-expected.txt: Added.
* fast/canvas/webgl/WebGLContextEvent.html: Added.
Add a test that shows that WebGLContextEvents are not just base Events.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94318 => 94319)


--- trunk/LayoutTests/ChangeLog	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/LayoutTests/ChangeLog	2011-09-01 18:20:45 UTC (rev 94319)
@@ -1,3 +1,14 @@
+2011-09-01  Sam Weinig  <s...@webkit.org>
+
+        WebGLContextEvent should have its own JS wrapper
+        https://bugs.webkit.org/show_bug.cgi?id=67352
+
+        Reviewed by Anders Carlsson.
+
+        * fast/canvas/webgl/WebGLContextEvent-expected.txt: Added.
+        * fast/canvas/webgl/WebGLContextEvent.html: Added.
+        Add a test that shows that WebGLContextEvents are not just base Events.
+
 2011-09-01  Eric Carlson  <eric.carl...@apple.com>
 
         Add 'muted' content attribute to HTMLMediaElement

Added: trunk/LayoutTests/fast/canvas/webgl/WebGLContextEvent-expected.txt (0 => 94319)


--- trunk/LayoutTests/fast/canvas/webgl/WebGLContextEvent-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/WebGLContextEvent-expected.txt	2011-09-01 18:20:45 UTC (rev 94319)
@@ -0,0 +1,8 @@
+Test that the event passed to a listener of webglcontextlost is a WebGLContextEvent.
+PASS evt.toString() is '[object WebGLContextEvent]'
+PASS evt.statusMessage is ''
+Test that the event passed to a listener of webglcontextrestored is a WebGLContextEvent.
+PASS evt.toString() is '[object WebGLContextEvent]'
+PASS evt.statusMessage is ''
+PASS extension.restoreContext() was expected value: NO_ERROR.
+

Added: trunk/LayoutTests/fast/canvas/webgl/WebGLContextEvent.html (0 => 94319)


--- trunk/LayoutTests/fast/canvas/webgl/WebGLContextEvent.html	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/WebGLContextEvent.html	2011-09-01 18:20:45 UTC (rev 94319)
@@ -0,0 +1,75 @@
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+
+var evt;
+var canvas;
+var context;
+var extension;
+
+function createNewCanvas()
+{
+    canvas = document.createElement("canvas");
+    canvas.width = 1;
+    canvas.height = 1;
+
+    context = WebGLTestUtils.create3DContext(canvas);
+    extension = context.getExtension("WEBKIT_lose_context");
+    if (!extension) {
+        debug("Could not find the WEBKIT_lose_context extension.");
+        return;
+    }
+}
+
+function runTest()
+{
+    createNewCanvas();
+    canvas.addEventListener("webglcontextlost", function(e) {
+        evt = e;
+        debug("Test that the event passed to a listener of webglcontextlost is a WebGLContextEvent.")
+        shouldBe("evt.toString()", "'[object WebGLContextEvent]'");
+        shouldBe("evt.statusMessage", "''");
+    }, false);
+    extension.loseContext();
+
+
+    createNewCanvas();
+    canvas.addEventListener("webglcontextlost", function(e) {
+        e.preventDefault();
+    }, false);
+    canvas.addEventListener("webglcontextrestored", function(e) {
+        evt = e;
+        debug("Test that the event passed to a listener of webglcontextrestored is a WebGLContextEvent.")
+        shouldBe("evt.toString()", "'[object WebGLContextEvent]'");
+        shouldBe("evt.statusMessage", "''");
+    }, false);
+    extension.loseContext();
+    WebGLTestUtils.shouldGenerateGLError(context, context.NO_ERROR, "extension.restoreContext()");
+
+    finish();
+}
+
+function finish() {
+    successfullyParsed = true;
+    var epilogue = document.createElement("script");
+    epilogue._onload_ = function() {
+        if (window.nonKhronosFrameworkNotifyDone)
+            window.nonKhronosFrameworkNotifyDone();
+    };
+    epilogue.src = ""
+    document.body.appendChild(epilogue);
+}
+
+</script>
+
+</head>
+<body _onload_="runTest()">
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas">
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (94318 => 94319)


--- trunk/Source/WebCore/ChangeLog	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/ChangeLog	2011-09-01 18:20:45 UTC (rev 94319)
@@ -1,3 +1,38 @@
+2011-09-01  Sam Weinig  <s...@webkit.org>
+
+        WebGLContextEvent should have its own JS wrapper
+        https://bugs.webkit.org/show_bug.cgi?id=67352
+
+        Reviewed by Anders Carlsson.
+
+        The WebGLContextEvent was missing a proper JS wrapper, and thus
+        anyone using one in an EventListener was actually just getting
+        a plain old Event. Rectify this by generating the wrapper and 
+        wrapping it on creating.
+
+        Test: fast/canvas/webgl/WebGLContextEvent.html
+
+        * CodeGenerators.pri:
+        Add WebGLContextEvent.idl
+
+        * DerivedSources.make:
+        Add WebGLContextEvent and sort.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add generated JSWebGLContextEvent.h/cpp.
+
+        * bindings/js/JSEventCustom.cpp:
+        (WebCore::toJS):
+        Wrap WebGLContextEvents as JSWebGLContextEvents.
+
+        * dom/Event.cpp:
+        (WebCore::Event::isWebGLContextEvent):
+        * dom/Event.h:
+        * html/canvas/WebGLContextEvent.cpp:
+        (WebCore::WebGLContextEvent::isWebGLContextEvent):
+        * html/canvas/WebGLContextEvent.h:
+        Add predicate for WebGLContextEvent.
+
 2011-09-01  Eric Carlson  <eric.carl...@apple.com>
 
         Add 'muted' content attribute to HTMLMediaElement

Modified: trunk/Source/WebCore/CodeGenerators.pri (94318 => 94319)


--- trunk/Source/WebCore/CodeGenerators.pri	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/CodeGenerators.pri	2011-09-01 18:20:45 UTC (rev 94319)
@@ -226,6 +226,7 @@
     html/canvas/WebGLActiveInfo.idl \
     html/canvas/WebGLBuffer.idl \
     html/canvas/WebGLContextAttributes.idl \
+    html/canvas/WebGLContextEvent.idl \
     html/canvas/WebGLFramebuffer.idl \
     html/canvas/WebGLProgram.idl \
     html/canvas/WebGLRenderbuffer.idl \

Modified: trunk/Source/WebCore/DerivedSources.make (94318 => 94319)


--- trunk/Source/WebCore/DerivedSources.make	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/DerivedSources.make	2011-09-01 18:20:45 UTC (rev 94319)
@@ -54,12 +54,14 @@
 DOM_CLASSES = \
     AbstractView \
     AbstractWorker \
+    ArrayBuffer \
+    ArrayBufferView \
     Attr \
     AudioBuffer \
     AudioBufferCallback \
     AudioBufferSourceNode \
+    AudioChannelMerger \
     AudioChannelSplitter \
-    AudioChannelMerger \
     AudioContext \
     AudioDestinationNode \
     AudioGain \
@@ -70,22 +72,11 @@
     AudioParam \
     AudioProcessingEvent \
     AudioSourceNode \
-    BiquadFilterNode \
-    ConvolverNode \
-    DelayNode \
-    DynamicsCompressorNode \
-    HighPass2FilterNode \
-    _javascript_AudioNode \
-    LowPass2FilterNode \
-    MediaElementAudioSourceNode \
-    OfflineAudioCompletionEvent \
-    RealtimeAnalyserNode \
-    WaveShaperNode \
     BarInfo \
     BeforeLoadEvent \
     BeforeProcessEvent \
+    BiquadFilterNode \
     Blob \
-    WebKitBlobBuilder \
     CDATASection \
     CSSCharsetRule \
     CSSFontFaceRule \
@@ -101,31 +92,10 @@
     CSSUnknownRule \
     CSSValue \
     CSSValueList \
-    WebGLActiveInfo \
-    ArrayBufferView \
-    ArrayBuffer \
-    DataView \
-    WebGLBuffer \
-    Int8Array \
-    WebGLContextAttributes \
-    Float32Array \
-    Float64Array \
-    WebGLFramebuffer \
     CanvasGradient \
-    Int32Array \
     CanvasPattern \
-    WebGLProgram \
-    WebGLRenderbuffer \
     CanvasRenderingContext \
     CanvasRenderingContext2D \
-    WebGLRenderingContext \
-    WebGLShader \
-    Int16Array \
-    WebGLTexture \
-    WebGLUniformLocation \
-    Uint8Array \
-    Uint32Array \
-    Uint16Array \
     CharacterData \
     ClientRect \
     ClientRectList \
@@ -134,13 +104,11 @@
     Comment \
     CompositionEvent \
     Console \
+    ConvolverNode \
     Coordinates \
     Counter \
     Crypto \
     CustomEvent \
-    DataTransferItem \
-    DataTransferItems \
-    DedicatedWorkerContext \
     DOMApplicationCache \
     DOMCoreException \
     DOMFileSystem \
@@ -153,17 +121,22 @@
     DOMPlugin \
     DOMPluginArray \
     DOMSelection \
+    DOMSettableTokenList \
     DOMStringList \
     DOMStringMap \
-    DOMSettableTokenList \
     DOMTokenList \
     DOMURL \
     DOMWindow \
     DataTransferItem \
+    DataTransferItem \
     DataTransferItems \
+    DataTransferItems \
+    DataView \
     Database \
     DatabaseCallback \
     DatabaseSync \
+    DedicatedWorkerContext \
+    DelayNode \
     DeviceMotionEvent \
     DeviceOrientationEvent \
     DirectoryEntry \
@@ -173,16 +146,17 @@
     Document \
     DocumentFragment \
     DocumentType \
+    DynamicsCompressorNode \
     Element \
     ElementTimeControl \
     Entity \
     EntityReference \
     EntriesCallback \
     Entry \
-    EntrySync \
     EntryArray \
     EntryArraySync \
     EntryCallback \
+    EntrySync \
     ErrorCallback \
     ErrorEvent \
     Event \
@@ -194,20 +168,19 @@
     FileCallback \
     FileEntry \
     FileEntrySync \
+    FileError \
     FileException \
-    FileError \
     FileList \
     FileReader \
     FileReaderSync \
+    FileSystemCallback \
     FileWriter \
     FileWriterCallback \
     FileWriterSync \
-    FileSystemCallback \
-    WebKitFlags \
+    Float32Array \
+    Float64Array \
     Geolocation \
     Geoposition \
-    HashChangeEvent \
-    History \
     HTMLAllCollection \
     HTMLAnchorElement \
     HTMLAppletElement \
@@ -221,9 +194,9 @@
     HTMLButtonElement \
     HTMLCanvasElement \
     HTMLCollection \
+    HTMLDListElement \
     HTMLDataListElement \
     HTMLDetailsElement \
-    HTMLDListElement \
     HTMLDirectoryElement \
     HTMLDivElement \
     HTMLDocument \
@@ -281,11 +254,14 @@
     HTMLUListElement \
     HTMLUnknownElement \
     HTMLVideoElement \
+    HashChangeEvent \
+    HighPass2FilterNode \
+    History \
     IDBAny \
     IDBCursor \
+    IDBDatabase \
     IDBDatabaseError \
     IDBDatabaseException \
-    IDBDatabase \
     IDBFactory \
     IDBIndex \
     IDBKey \
@@ -296,10 +272,16 @@
     ImageData \
     InjectedScriptHost \
     InspectorFrontendHost \
+    Int16Array \
+    Int32Array \
+    Int8Array \
     Internals \
+    _javascript_AudioNode \
     KeyboardEvent \
     LocalMediaStream \
     Location \
+    LowPass2FilterNode \
+    MediaElementAudioSourceNode \
     MediaError \
     MediaList \
     MediaQueryList \
@@ -331,8 +313,8 @@
     NotificationCenter \
     OESStandardDerivatives \
     OESTextureFloat \
-     OESVertexArrayObject \
-     WebGLVertexArrayObjectOES \
+    OESVertexArrayObject \
+    OfflineAudioCompletionEvent \
     OperationNotAllowedException \
     OverflowEvent \
     PageTransitionEvent \
@@ -349,16 +331,9 @@
     RGBColor \
     Range \
     RangeException \
+    RealtimeAnalyserNode \
     Rect \
     RequestAnimationFrameCallback \
-    SharedWorker \
-    SharedWorkerContext \
-    ScriptProfile \
-    ScriptProfileNode \
-    SignalingCallback \
-    SpeechInputEvent \
-    SpeechInputResult \
-    SpeechInputResultList \
     SQLError \
     SQLException \
     SQLResultSet \
@@ -370,13 +345,6 @@
     SQLTransactionErrorCallback \
     SQLTransactionSync \
     SQLTransactionSyncCallback \
-    Storage \
-    StorageEvent \
-    StorageInfo \
-    StorageInfoErrorCallback \
-    StorageInfoQuotaCallback \
-    StorageInfoUsageCallback \
-    StringCallback \
     SVGAElement \
     SVGAltGlyphDefElement \
     SVGAltGlyphElement \
@@ -460,12 +428,12 @@
     SVGLineElement \
     SVGLinearGradientElement \
     SVGLocatable \
+    SVGMPathElement \
     SVGMarkerElement \
     SVGMaskElement \
     SVGMatrix \
     SVGMetadataElement \
     SVGMissingGlyphElement \
-    SVGMPathElement \
     SVGNumber \
     SVGNumberList \
     SVGPaint \
@@ -524,12 +492,27 @@
     SVGURIReference \
     SVGUnitTypes \
     SVGUseElement \
+    SVGVKernElement \
     SVGViewElement \
-    SVGVKernElement \
     SVGZoomAndPan \
     SVGZoomEvent \
     Screen \
+    ScriptProfile \
+    ScriptProfileNode \
+    SharedWorker \
+    SharedWorkerContext \
+    SignalingCallback \
+    SpeechInputEvent \
+    SpeechInputResult \
+    SpeechInputResultList \
+    Storage \
+    StorageEvent \
+    StorageInfo \
+    StorageInfoErrorCallback \
+    StorageInfoQuotaCallback \
+    StorageInfoUsageCallback \
     StringCallback \
+    StringCallback \
     StyleMedia \
     StyleSheet \
     StyleSheetList \
@@ -542,14 +525,32 @@
     TouchList \
     TreeWalker \
     UIEvent \
+    Uint16Array \
+    Uint32Array \
+    Uint8Array \
     ValidityState \
+    WaveShaperNode \
+    WebGLActiveInfo \
+    WebGLBuffer \
+    WebGLContextAttributes \
+    WebGLContextEvent \
+    WebGLFramebuffer \
+    WebGLProgram \
+    WebGLRenderbuffer \
+    WebGLRenderingContext \
+    WebGLShader \
+    WebGLTexture \
+    WebGLUniformLocation \
+    WebGLVertexArrayObjectOES \
     WebKitAnimation \
     WebKitAnimationEvent \
     WebKitAnimationList \
+    WebKitBlobBuilder \
     WebKitCSSKeyframeRule \
     WebKitCSSKeyframesRule \
     WebKitCSSMatrix \
     WebKitCSSTransformValue \
+    WebKitFlags \
     WebKitLoseContext \
     WebKitPoint \
     WebKitTransitionEvent \

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (94318 => 94319)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-09-01 18:20:45 UTC (rev 94319)
@@ -4925,6 +4925,8 @@
 		BC275B7D11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */; };
 		BC275B8111C5D2B400C9206C /* JSEventSourceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B8011C5D2B400C9206C /* JSEventSourceCustom.cpp */; };
 		BC275CB311C5E85C00C9206C /* JSArrayBufferCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */; };
+		BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */; };
+		BC2CBF7B140F1D58003879BE /* JSWebGLContextEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2CBF7A140F1D58003879BE /* JSWebGLContextEvent.cpp */; };
 		BC2CC8DF0F32881000A9DF26 /* RenderObjectChildList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CC8DE0F32881000A9DF26 /* RenderObjectChildList.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */; };
 		BC2ED6BC0C6BD2F000920BFF /* JSAttrCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */; };
@@ -11641,6 +11643,8 @@
 		BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSMatrixCustom.cpp; sourceTree = "<group>"; };
 		BC275B8011C5D2B400C9206C /* JSEventSourceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventSourceCustom.cpp; sourceTree = "<group>"; };
 		BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSArrayBufferCustom.cpp; sourceTree = "<group>"; };
+		BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextEvent.h; sourceTree = "<group>"; };
+		BC2CBF7A140F1D58003879BE /* JSWebGLContextEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextEvent.cpp; sourceTree = "<group>"; };
 		BC2CC8DE0F32881000A9DF26 /* RenderObjectChildList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderObjectChildList.h; sourceTree = "<group>"; };
 		BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSElementCustom.cpp; sourceTree = "<group>"; };
 		BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAttrCustom.cpp; sourceTree = "<group>"; };
@@ -16948,6 +16952,8 @@
 				49C7B9811042D2D30009D447 /* JSWebGLBuffer.h */,
 				6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */,
 				6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */,
+				BC2CBF7A140F1D58003879BE /* JSWebGLContextEvent.cpp */,
+				BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */,
 				49C7B9841042D2D30009D447 /* JSWebGLFramebuffer.cpp */,
 				49C7B9851042D2D30009D447 /* JSWebGLFramebuffer.h */,
 				49C7B9881042D2D30009D447 /* JSWebGLProgram.cpp */,
@@ -23470,6 +23476,7 @@
 				B10B6980140C174000BC1C26 /* WebVTTToken.h in Headers */,
 				B10B6982140C174000BC1C26 /* WebVTTTokenizer.h in Headers */,
 				9B0FB192140DB5790022588F /* HTTPValidation.h in Headers */,
+				BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */,
 				BC274B2F140EBEB200EADFA6 /* CSSBorderImageSliceValue.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -26283,6 +26290,7 @@
 				E45322AB140CE267005A0F92 /* SelectorQuery.cpp in Sources */,
 				B10B6981140C174000BC1C26 /* WebVTTTokenizer.cpp in Sources */,
 				9B0FB191140DB5790022588F /* HTTPValidation.cpp in Sources */,
+				BC2CBF7B140F1D58003879BE /* JSWebGLContextEvent.cpp in Sources */,
 				BC274B31140EBED800EADFA6 /* CSSBorderImageSliceValue.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

Modified: trunk/Source/WebCore/bindings/js/JSEventCustom.cpp (94318 => 94319)


--- trunk/Source/WebCore/bindings/js/JSEventCustom.cpp	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/bindings/js/JSEventCustom.cpp	2011-09-01 18:20:45 UTC (rev 94319)
@@ -115,6 +115,11 @@
 #include "MediaStreamEvent.h"
 #endif
 
+#if ENABLE(WEBGL)
+#include "JSWebGLContextEvent.h"
+#include "WebGLContextEvent.h"
+#endif
+
 using namespace JSC;
 
 namespace WebCore {
@@ -217,6 +222,10 @@
     else if (event->isMediaStreamEvent())
         wrapper = CREATE_DOM_WRAPPER(exec, globalObject, MediaStreamEvent, event);
 #endif
+#if ENABLE(WEBGL)
+    else if (event->isWebGLContextEvent())
+        wrapper = CREATE_DOM_WRAPPER(exec, globalObject, WebGLContextEvent, event);
+#endif
     else
         wrapper = CREATE_DOM_WRAPPER(exec, globalObject, Event, event);
 

Modified: trunk/Source/WebCore/dom/Event.cpp (94318 => 94319)


--- trunk/Source/WebCore/dom/Event.cpp	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/dom/Event.cpp	2011-09-01 18:20:45 UTC (rev 94319)
@@ -279,6 +279,14 @@
 }
 #endif
 
+#if ENABLE(WEBGL)
+bool Event::isWebGLContextEvent() const
+{
+    return false;
+}
+#endif
+
+
 bool Event::storesResultAsString() const
 {
     return false;

Modified: trunk/Source/WebCore/dom/Event.h (94318 => 94319)


--- trunk/Source/WebCore/dom/Event.h	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/dom/Event.h	2011-09-01 18:20:45 UTC (rev 94319)
@@ -163,6 +163,10 @@
 #if ENABLE(MEDIA_STREAM)
         virtual bool isMediaStreamEvent() const;
 #endif
+#if ENABLE(WEBGL)
+        virtual bool isWebGLContextEvent() const;
+#endif
+
         bool propagationStopped() const { return m_propagationStopped || m_immediatePropagationStopped; }
         bool immediatePropagationStopped() const { return m_immediatePropagationStopped; }
 

Modified: trunk/Source/WebCore/html/canvas/WebGLContextEvent.cpp (94318 => 94319)


--- trunk/Source/WebCore/html/canvas/WebGLContextEvent.cpp	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/html/canvas/WebGLContextEvent.cpp	2011-09-01 18:20:45 UTC (rev 94319)
@@ -51,4 +51,9 @@
     m_statusMessage = statusMessage;
 }
 
+bool WebGLContextEvent::isWebGLContextEvent() const
+{
+    return true;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/html/canvas/WebGLContextEvent.h (94318 => 94319)


--- trunk/Source/WebCore/html/canvas/WebGLContextEvent.h	2011-09-01 18:10:51 UTC (rev 94318)
+++ trunk/Source/WebCore/html/canvas/WebGLContextEvent.h	2011-09-01 18:20:45 UTC (rev 94319)
@@ -44,6 +44,8 @@
 
     void initEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage);
 
+    virtual bool isWebGLContextEvent() const;
+
     const String& statusMessage() const { return m_statusMessage; }
 
 private:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to