Changeset 205360 in webkit


Ignore:
Timestamp:
Sep 2, 2016 12:14:46 PM (8 years ago)
Author:
Chris Dumez
Message:

REGRESSION (r204839): [mac-wk1] LayoutTest webgl/max-active-contexts-webglcontextlost-prevent-default.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=161205

Reviewed by Geoffrey Garen.

Source/WebCore:

Fixes several issues:

  • Add missing isReachableFromOpaqueRoots() implementation for JSWebGLRenderingContextBase. It used to rely on the one from its JSCanvasRenderingContext base. However, that base was dropped in r204839.
  • Update JSWebGLRenderingContextBase::visitAdditionalChildren() to add its canvas object as opaque root as well. This used to be taken care of by JSCanvasRenderingContext::visitAdditionalChildren() but it got dropped in r204839.

This also refactors the code a bit for clarity.

No new tests, unskipped existing test.

  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSCanvasRenderingContext.h: Removed.
  • bindings/js/JSDocumentCustom.cpp:

(WebCore::JSDocument::getCSSCanvasContext):

  • bindings/js/JSHTMLCanvasElementCustom.cpp:

(WebCore::JSHTMLCanvasElement::getContext):

  • bindings/js/JSWebGLRenderingContextBaseCustom.cpp:

(WebCore::toJSNewlyCreated):
(WebCore::toJS):
(WebCore::JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots):
(WebCore::JSWebGLRenderingContextBase::visitAdditionalChildren):

  • html/canvas/CanvasRenderingContext.h:

(WebCore::CanvasRenderingContext::is3d):

  • html/canvas/WebGLRenderingContextBase.h:
  • html/canvas/WebGLRenderingContextBase.idl:

LayoutTests:

Unskip test case now that it is no longer flaky.

  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r205359 r205360  
     12016-09-02  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION (r204839): [mac-wk1] LayoutTest webgl/max-active-contexts-webglcontextlost-prevent-default.html is a flaky timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=161205
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Unskip test case now that it is no longer flaky.
     9
     10        * platform/mac-wk1/TestExpectations:
     11
    1122016-09-02  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r205124 r205360  
    253253webkit.org/b/161191 imported/w3c/web-platform-tests/url/url-setters.html [ Skip ]
    254254
    255 webkit.org/b/161205 webgl/max-active-contexts-webglcontextlost-prevent-default.html [ Pass Timeout ]
  • trunk/Source/WebCore/ChangeLog

    r205359 r205360  
     12016-09-02  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION (r204839): [mac-wk1] LayoutTest webgl/max-active-contexts-webglcontextlost-prevent-default.html is a flaky timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=161205
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Fixes several issues:
     9        - Add missing isReachableFromOpaqueRoots() implementation for JSWebGLRenderingContextBase.
     10          It used to rely on the one from its JSCanvasRenderingContext base. However, that base
     11          was dropped in r204839.
     12        - Update JSWebGLRenderingContextBase::visitAdditionalChildren() to add its canvas
     13          object as opaque root as well. This used to be taken care of by
     14          JSCanvasRenderingContext::visitAdditionalChildren() but it got dropped in r204839.
     15
     16        This also refactors the code a bit for clarity.
     17
     18        No new tests, unskipped existing test.
     19
     20        * WebCore.xcodeproj/project.pbxproj:
     21        * bindings/js/JSCanvasRenderingContext.h: Removed.
     22        * bindings/js/JSDocumentCustom.cpp:
     23        (WebCore::JSDocument::getCSSCanvasContext):
     24        * bindings/js/JSHTMLCanvasElementCustom.cpp:
     25        (WebCore::JSHTMLCanvasElement::getContext):
     26        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
     27        (WebCore::toJSNewlyCreated):
     28        (WebCore::toJS):
     29        (WebCore::JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots):
     30        (WebCore::JSWebGLRenderingContextBase::visitAdditionalChildren):
     31        * html/canvas/CanvasRenderingContext.h:
     32        (WebCore::CanvasRenderingContext::is3d):
     33        * html/canvas/WebGLRenderingContextBase.h:
     34        * html/canvas/WebGLRenderingContextBase.idl:
     35
    1362016-09-02  Chris Dumez  <cdumez@apple.com>
    237
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r205348 r205360  
    17221722                463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; };
    17231723                463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; };
    1724                 4659D2711D6B90A50096FD86 /* JSCanvasRenderingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4659D2701D6B909F0096FD86 /* JSCanvasRenderingContext.h */; };
    17251724                465A8E791C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */; };
    17261725                4669B2871B852A0B000F905F /* JSDOMNamedFlowCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */; };
     
    18481847                49ECEB6F1499790D00CDD3A4 /* FilterOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49ECEB651499790D00CDD3A4 /* FilterOperations.cpp */; };
    18491848                49ECEB701499790D00CDD3A4 /* FilterOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 49ECEB661499790D00CDD3A4 /* FilterOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1850                 49EED1431051969400099FAB /* JSCanvasRenderingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EED13D1051969400099FAB /* JSCanvasRenderingContext.h */; };
    18511849                49EED1441051969400099FAB /* JSCanvasRenderingContext2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */; };
    18521850                49EED1451051969400099FAB /* JSCanvasRenderingContext2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EED13F1051969400099FAB /* JSCanvasRenderingContext2D.h */; };
     
    86768674                463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = "<group>"; };
    86778675                463EB6211B8789CB0096ED51 /* TagCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagCollection.h; sourceTree = "<group>"; };
    8678                 4659D2701D6B909F0096FD86 /* JSCanvasRenderingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCanvasRenderingContext.h; sourceTree = "<group>"; };
    86798676                465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeApplicationChecks.mm; sourceTree = "<group>"; };
    86808677                4671E0631D67A57B00C6B497 /* CanvasPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasPath.cpp; sourceTree = "<group>"; };
     
    88158812                49ECEB651499790D00CDD3A4 /* FilterOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilterOperations.cpp; sourceTree = "<group>"; };
    88168813                49ECEB661499790D00CDD3A4 /* FilterOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterOperations.h; sourceTree = "<group>"; };
    8817                 49EED13D1051969400099FAB /* JSCanvasRenderingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCanvasRenderingContext.h; sourceTree = "<group>"; };
    88188814                49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCanvasRenderingContext2D.cpp; sourceTree = "<group>"; };
    88198815                49EED13F1051969400099FAB /* JSCanvasRenderingContext2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCanvasRenderingContext2D.h; sourceTree = "<group>"; };
     
    1880118797                                65DF323609D1DE65000BE325 /* JSCanvasPattern.h */,
    1880218798                                65DF323609D1DE65001BE325 /* JSCanvasProxy.h */,
    18803                                 49EED13D1051969400099FAB /* JSCanvasRenderingContext.h */,
    1880418799                                49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */,
    1880518800                                49EED13F1051969400099FAB /* JSCanvasRenderingContext2D.h */,
     
    2103021025                                BE6DF710171CA2DA00DD52B8 /* JSAudioTrackListCustom.cpp */,
    2103121026                                8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */,
    21032                                 4659D2701D6B909F0096FD86 /* JSCanvasRenderingContext.h */,
    2103321027                                49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */,
    2103421028                                7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */,
     
    2484024834                                65DF323C09D1DE65000BE325 /* JSCanvasPattern.h in Headers */,
    2484124835                                65DF323C09D1DE65001BE325 /* JSCanvasProxy.h in Headers */,
    24842                                 49EED1431051969400099FAB /* JSCanvasRenderingContext.h in Headers */,
    24843                                 4659D2711D6B90A50096FD86 /* JSCanvasRenderingContext.h in Headers */,
    2484424836                                49EED1451051969400099FAB /* JSCanvasRenderingContext2D.h in Headers */,
    2484524837                                93F9B7A10BA6032600854064 /* JSCDATASection.h in Headers */,
  • trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp

    r205198 r205360  
    2525#include "FrameLoader.h"
    2626#include "HTMLDocument.h"
    27 #include "JSCanvasRenderingContext.h"
    2827#include "JSCanvasRenderingContext2D.h"
    2928#include "JSDOMConvert.h"
     
    166165    if (UNLIKELY(state.hadException()))
    167166        return jsUndefined();
    168     return toJS(&state, globalObject(), wrapped().getCSSCanvasContext(WTFMove(contextId), WTFMove(name), WTFMove(width), WTFMove(height)));
     167
     168    auto* context = wrapped().getCSSCanvasContext(WTFMove(contextId), WTFMove(name), WTFMove(width), WTFMove(height));
     169    if (!context)
     170        return jsNull();
     171
     172#if ENABLE(WEBGL)
     173    if (is<WebGLRenderingContextBase>(*context))
     174        return toJS(&state, globalObject(), downcast<WebGLRenderingContextBase>(*context));
     175#endif
     176
     177    return toJS(&state, globalObject(), downcast<CanvasRenderingContext2D>(*context));
    169178}
    170179
  • trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp

    r205198 r205360  
    3030#include "CanvasContextAttributes.h"
    3131#include "HTMLCanvasElement.h"
    32 #include "JSCanvasRenderingContext.h"
    3332#include "JSCanvasRenderingContext2D.h"
    3433#include <bindings/ScriptObject.h>
     
    9392    if (!context)
    9493        return jsNull();
    95     return toJS(&state, globalObject(), *context);
     94
     95#if ENABLE(WEBGL)
     96    if (is<WebGLRenderingContextBase>(*context))
     97        return toJS(&state, globalObject(), downcast<WebGLRenderingContextBase>(*context));
     98#endif
     99
     100    return toJS(&state, globalObject(), downcast<CanvasRenderingContext2D>(*context));
    96101}
    97102
  • trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp

    r205324 r205360  
    6666#include "JSWebGLProgram.h"
    6767#include "JSWebGLRenderbuffer.h"
     68#include "JSWebGLRenderingContext.h"
    6869#include "JSWebGLShader.h"
    6970#include "JSWebGLTexture.h"
     
    108109#endif
    109110
     111#if ENABLE(WEBGL2)
     112#include "JSWebGL2RenderingContext.h"
     113#endif
     114
    110115using namespace JSC;
    111116
    112117namespace WebCore {
     118
     119JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<WebGLRenderingContextBase>&& object)
     120{
     121#if ENABLE(WEBGL2)
     122    if (is<WebGL2RenderingContext>(object))
     123        return CREATE_DOM_WRAPPER(globalObject, WebGL2RenderingContext, WTFMove(object));
     124#endif
     125    return CREATE_DOM_WRAPPER(globalObject, WebGLRenderingContext, WTFMove(object));
     126}
     127
     128JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, WebGLRenderingContextBase& object)
     129{
     130    return wrap(state, globalObject, object);
     131}
    113132   
    114133static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebGLGetInfo& info)
     
    268287}
    269288
     289bool JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
     290{
     291    JSWebGLRenderingContextBase* jsWebGLRenderingContext = jsCast<JSWebGLRenderingContextBase*>(handle.slot()->asCell());
     292    void* root = WebCore::root(jsWebGLRenderingContext->wrapped().canvas());
     293    return visitor.containsOpaqueRoot(root);
     294}
     295
    270296void JSWebGLRenderingContextBase::visitAdditionalChildren(SlotVisitor& visitor)
    271297{
    272298    visitor.addOpaqueRoot(&wrapped());
     299    visitor.addOpaqueRoot(root(wrapped().canvas()));
    273300}
    274301
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h

    r195646 r205360  
    5555    virtual bool isWebGL1() const { return false; }
    5656    virtual bool isWebGL2() const { return false; }
    57     bool is3d() const { return isWebGL1() || isWebGL1(); }
     57    bool is3d() const { return isWebGL1() || isWebGL2(); }
    5858    virtual bool isAccelerated() const { return false; }
    5959
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h

    r200789 r205360  
    838838} // namespace WebCore
    839839
     840SPECIALIZE_TYPE_TRAITS_CANVASRENDERINGCONTEXT(WebCore::WebGLRenderingContextBase, is3d())
     841
    840842#endif
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl

    r204839 r205360  
    4040
    4141[
    42 Conditional=WEBGL,
    43 DoNotCheckConstants,
    44 JSCustomMarkFunction,
    45 NoInterfaceObject,
     42    Conditional=WEBGL,
     43    CustomIsReachable,
     44    CustomToJSObject,
     45    DoNotCheckConstants,
     46    JSCustomMarkFunction,
     47    NoInterfaceObject,
    4648] interface WebGLRenderingContextBase {
    4749
Note: See TracChangeset for help on using the changeset viewer.