Diff
Modified: trunk/LayoutTests/ChangeLog (205359 => 205360)
--- trunk/LayoutTests/ChangeLog 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/LayoutTests/ChangeLog 2016-09-02 19:14:46 UTC (rev 205360)
@@ -1,5 +1,16 @@
2016-09-02 Chris Dumez <[email protected]>
+ 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.
+
+ Unskip test case now that it is no longer flaky.
+
+ * platform/mac-wk1/TestExpectations:
+
+2016-09-02 Chris Dumez <[email protected]>
+
Object.preventExtensions() should throw cross-origin
https://bugs.webkit.org/show_bug.cgi?id=161486
Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (205359 => 205360)
--- trunk/LayoutTests/platform/mac-wk1/TestExpectations 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2016-09-02 19:14:46 UTC (rev 205360)
@@ -252,4 +252,3 @@
webkit.org/b/161191 imported/w3c/web-platform-tests/url/url-setters.html [ Skip ]
-webkit.org/b/161205 webgl/max-active-contexts-webglcontextlost-prevent-default.html [ Pass Timeout ]
Modified: trunk/Source/WebCore/ChangeLog (205359 => 205360)
--- trunk/Source/WebCore/ChangeLog 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/ChangeLog 2016-09-02 19:14:46 UTC (rev 205360)
@@ -1,5 +1,40 @@
2016-09-02 Chris Dumez <[email protected]>
+ 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.
+
+ 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:
+
+2016-09-02 Chris Dumez <[email protected]>
+
Object.preventExtensions() should throw cross-origin
https://bugs.webkit.org/show_bug.cgi?id=161486
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (205359 => 205360)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-09-02 19:14:46 UTC (rev 205360)
@@ -1721,7 +1721,6 @@
4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; };
463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; };
463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; };
- 4659D2711D6B90A50096FD86 /* JSCanvasRenderingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4659D2701D6B909F0096FD86 /* JSCanvasRenderingContext.h */; };
465A8E791C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */; };
4669B2871B852A0B000F905F /* JSDOMNamedFlowCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */; };
4671E0651D67A59600C6B497 /* CanvasPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4671E0631D67A57B00C6B497 /* CanvasPath.cpp */; };
@@ -1847,7 +1846,6 @@
49ECEB6E1499790D00CDD3A4 /* FilterOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49ECEB641499790D00CDD3A4 /* FilterOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
49ECEB6F1499790D00CDD3A4 /* FilterOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49ECEB651499790D00CDD3A4 /* FilterOperations.cpp */; };
49ECEB701499790D00CDD3A4 /* FilterOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 49ECEB661499790D00CDD3A4 /* FilterOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 49EED1431051969400099FAB /* JSCanvasRenderingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EED13D1051969400099FAB /* JSCanvasRenderingContext.h */; };
49EED1441051969400099FAB /* JSCanvasRenderingContext2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */; };
49EED1451051969400099FAB /* JSCanvasRenderingContext2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EED13F1051969400099FAB /* JSCanvasRenderingContext2D.h */; };
49EED1461051969400099FAB /* JSWebGLRenderingContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EED1401051969400099FAB /* JSWebGLRenderingContext.cpp */; };
@@ -8675,7 +8673,6 @@
4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PowerObserverMac.cpp; sourceTree = "<group>"; };
463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = "<group>"; };
463EB6211B8789CB0096ED51 /* TagCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagCollection.h; sourceTree = "<group>"; };
- 4659D2701D6B909F0096FD86 /* JSCanvasRenderingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCanvasRenderingContext.h; sourceTree = "<group>"; };
465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeApplicationChecks.mm; sourceTree = "<group>"; };
4671E0631D67A57B00C6B497 /* CanvasPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasPath.cpp; sourceTree = "<group>"; };
4671E0641D67A57B00C6B497 /* CanvasPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasPath.h; sourceTree = "<group>"; };
@@ -8814,7 +8811,6 @@
49ECEB641499790D00CDD3A4 /* FilterOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterOperation.h; sourceTree = "<group>"; };
49ECEB651499790D00CDD3A4 /* FilterOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilterOperations.cpp; sourceTree = "<group>"; };
49ECEB661499790D00CDD3A4 /* FilterOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterOperations.h; sourceTree = "<group>"; };
- 49EED13D1051969400099FAB /* JSCanvasRenderingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCanvasRenderingContext.h; sourceTree = "<group>"; };
49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCanvasRenderingContext2D.cpp; sourceTree = "<group>"; };
49EED13F1051969400099FAB /* JSCanvasRenderingContext2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCanvasRenderingContext2D.h; sourceTree = "<group>"; };
49EED1401051969400099FAB /* JSWebGLRenderingContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLRenderingContext.cpp; sourceTree = "<group>"; };
@@ -18800,7 +18796,6 @@
65DF323509D1DE65000BE325 /* JSCanvasPattern.cpp */,
65DF323609D1DE65000BE325 /* JSCanvasPattern.h */,
65DF323609D1DE65001BE325 /* JSCanvasProxy.h */,
- 49EED13D1051969400099FAB /* JSCanvasRenderingContext.h */,
49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */,
49EED13F1051969400099FAB /* JSCanvasRenderingContext2D.h */,
BE61039B18A9D61200DD50D7 /* JSDataCue.cpp */,
@@ -21029,7 +21024,6 @@
BE6DF70E171CA2DA00DD52B8 /* JSAudioTrackCustom.cpp */,
BE6DF710171CA2DA00DD52B8 /* JSAudioTrackListCustom.cpp */,
8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */,
- 4659D2701D6B909F0096FD86 /* JSCanvasRenderingContext.h */,
49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */,
7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */,
46A58AC41D46B3FA00432036 /* JSClientRectCustom.cpp */,
@@ -24839,8 +24833,6 @@
65DF323A09D1DE65000BE325 /* JSCanvasGradient.h in Headers */,
65DF323C09D1DE65000BE325 /* JSCanvasPattern.h in Headers */,
65DF323C09D1DE65001BE325 /* JSCanvasProxy.h in Headers */,
- 49EED1431051969400099FAB /* JSCanvasRenderingContext.h in Headers */,
- 4659D2711D6B90A50096FD86 /* JSCanvasRenderingContext.h in Headers */,
49EED1451051969400099FAB /* JSCanvasRenderingContext2D.h in Headers */,
93F9B7A10BA6032600854064 /* JSCDATASection.h in Headers */,
FDA15EA212B03EE1003A583A /* JSChannelMergerNode.h in Headers */,
Deleted: trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext.h (205359 => 205360)
--- trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext.h 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext.h 2016-09-02 19:14:46 UTC (rev 205360)
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "CanvasRenderingContext2D.h"
-#include "JSCanvasRenderingContext2D.h"
-
-#if ENABLE(WEBGL)
-#include "JSWebGL2RenderingContext.h"
-#include "JSWebGLRenderingContext.h"
-#include "WebGL2RenderingContext.h"
-#include "WebGLRenderingContext.h"
-#endif
-
-namespace WebCore {
-
-inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, CanvasRenderingContext& object)
-{
-#if ENABLE(WEBGL)
- if (is<WebGLRenderingContext>(object))
- return wrap(state, globalObject, downcast<WebGLRenderingContext>(object));
-#if ENABLE(WEBGL2)
- if (is<WebGL2RenderingContext>(object))
- return wrap(state, globalObject, downcast<WebGL2RenderingContext>(object));
-#endif
-#endif
- return wrap(state, globalObject, downcast<CanvasRenderingContext2D>(object));
-}
-
-inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, CanvasRenderingContext* object)
-{
- return object ? toJS(state, globalObject, *object) : JSC::jsNull();
-}
-
-} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp (205359 => 205360)
--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp 2016-09-02 19:14:46 UTC (rev 205360)
@@ -24,7 +24,6 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "HTMLDocument.h"
-#include "JSCanvasRenderingContext.h"
#include "JSCanvasRenderingContext2D.h"
#include "JSDOMConvert.h"
#include "JSDOMWindowCustom.h"
@@ -165,7 +164,17 @@
auto height = convert<int32_t>(state, state.uncheckedArgument(3), NormalConversion);
if (UNLIKELY(state.hadException()))
return jsUndefined();
- return toJS(&state, globalObject(), wrapped().getCSSCanvasContext(WTFMove(contextId), WTFMove(name), WTFMove(width), WTFMove(height)));
+
+ auto* context = wrapped().getCSSCanvasContext(WTFMove(contextId), WTFMove(name), WTFMove(width), WTFMove(height));
+ if (!context)
+ return jsNull();
+
+#if ENABLE(WEBGL)
+ if (is<WebGLRenderingContextBase>(*context))
+ return toJS(&state, globalObject(), downcast<WebGLRenderingContextBase>(*context));
+#endif
+
+ return toJS(&state, globalObject(), downcast<CanvasRenderingContext2D>(*context));
}
void JSDocument::visitAdditionalChildren(SlotVisitor& visitor)
Modified: trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp (205359 => 205360)
--- trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp 2016-09-02 19:14:46 UTC (rev 205360)
@@ -29,7 +29,6 @@
#include "CanvasContextAttributes.h"
#include "HTMLCanvasElement.h"
-#include "JSCanvasRenderingContext.h"
#include "JSCanvasRenderingContext2D.h"
#include <bindings/ScriptObject.h>
#include <wtf/GetPtr.h>
@@ -92,7 +91,13 @@
CanvasRenderingContext* context = canvas.getContext(contextId, attrs.get());
if (!context)
return jsNull();
- return toJS(&state, globalObject(), *context);
+
+#if ENABLE(WEBGL)
+ if (is<WebGLRenderingContextBase>(*context))
+ return toJS(&state, globalObject(), downcast<WebGLRenderingContextBase>(*context));
+#endif
+
+ return toJS(&state, globalObject(), downcast<CanvasRenderingContext2D>(*context));
}
JSValue JSHTMLCanvasElement::probablySupportsContext(ExecState& state)
Modified: trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp (205359 => 205360)
--- trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp 2016-09-02 19:14:46 UTC (rev 205360)
@@ -65,6 +65,7 @@
#include "JSWebGLLoseContext.h"
#include "JSWebGLProgram.h"
#include "JSWebGLRenderbuffer.h"
+#include "JSWebGLRenderingContext.h"
#include "JSWebGLShader.h"
#include "JSWebGLTexture.h"
#include "JSWebGLUniformLocation.h"
@@ -107,9 +108,27 @@
#include "JSHTMLVideoElement.h"
#endif
+#if ENABLE(WEBGL2)
+#include "JSWebGL2RenderingContext.h"
+#endif
+
using namespace JSC;
namespace WebCore {
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<WebGLRenderingContextBase>&& object)
+{
+#if ENABLE(WEBGL2)
+ if (is<WebGL2RenderingContext>(object))
+ return CREATE_DOM_WRAPPER(globalObject, WebGL2RenderingContext, WTFMove(object));
+#endif
+ return CREATE_DOM_WRAPPER(globalObject, WebGLRenderingContext, WTFMove(object));
+}
+
+JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, WebGLRenderingContextBase& object)
+{
+ return wrap(state, globalObject, object);
+}
static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebGLGetInfo& info)
{
@@ -267,9 +286,17 @@
return jsNull();
}
+bool JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+ JSWebGLRenderingContextBase* jsWebGLRenderingContext = jsCast<JSWebGLRenderingContextBase*>(handle.slot()->asCell());
+ void* root = WebCore::root(jsWebGLRenderingContext->wrapped().canvas());
+ return visitor.containsOpaqueRoot(root);
+}
+
void JSWebGLRenderingContextBase::visitAdditionalChildren(SlotVisitor& visitor)
{
visitor.addOpaqueRoot(&wrapped());
+ visitor.addOpaqueRoot(root(wrapped().canvas()));
}
JSValue JSWebGLRenderingContextBase::getAttachedShaders(ExecState& state)
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h (205359 => 205360)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h 2016-09-02 19:14:46 UTC (rev 205360)
@@ -54,7 +54,7 @@
virtual bool is2d() const { return false; }
virtual bool isWebGL1() const { return false; }
virtual bool isWebGL2() const { return false; }
- bool is3d() const { return isWebGL1() || isWebGL1(); }
+ bool is3d() const { return isWebGL1() || isWebGL2(); }
virtual bool isAccelerated() const { return false; }
virtual void paintRenderingResultsToCanvas() {}
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (205359 => 205360)
--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h 2016-09-02 19:14:46 UTC (rev 205360)
@@ -837,4 +837,6 @@
} // namespace WebCore
+SPECIALIZE_TYPE_TRAITS_CANVASRENDERINGCONTEXT(WebCore::WebGLRenderingContextBase, is3d())
+
#endif
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl (205359 => 205360)
--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl 2016-09-02 19:10:12 UTC (rev 205359)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl 2016-09-02 19:14:46 UTC (rev 205360)
@@ -39,10 +39,12 @@
typedef unrestricted float GLclampf;
[
-Conditional=WEBGL,
-DoNotCheckConstants,
-JSCustomMarkFunction,
-NoInterfaceObject,
+ Conditional=WEBGL,
+ CustomIsReachable,
+ CustomToJSObject,
+ DoNotCheckConstants,
+ JSCustomMarkFunction,
+ NoInterfaceObject,
] interface WebGLRenderingContextBase {
// back-reference to the canvas