Skip to content

Commit 5e7e452

Browse files
arun-josephGuru Hbbhaweshkc
committed
8245284: Update to 610.1 version of WebKit
Co-authored-by: Guru Hb <ghb@openjdk.org> Co-authored-by: Bhawesh Choudhary <bchoudhary@openjdk.org> Reviewed-by: kcr, bchoudhary, sykora
1 parent 281f5c2 commit 5e7e452

File tree

5,234 files changed

+195912
-143453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,234 files changed

+195912
-143453
lines changed

modules/javafx.web/src/main/java/com/sun/javafx/webkit/drt/DumpRenderTree.java

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
import java.util.Date;
4646
import java.util.Map;
4747
import java.util.List;
48+
import java.util.Timer;
49+
import java.util.TimerTask;
4850
import java.util.concurrent.CountDownLatch;
4951
import javafx.scene.web.WebEngine;
5052

@@ -70,11 +72,27 @@ public final class DumpRenderTree {
7072
private EventSender eventSender;
7173

7274
private CountDownLatch latch;
75+
private Timer timer;
7376
private String testPath;
7477
private boolean loaded;
7578
private boolean waiting;
7679
private boolean complete;
7780

81+
static class RenderUpdateHelper extends TimerTask {
82+
private WebPage webPage;
83+
84+
public RenderUpdateHelper(WebPage webPage) {
85+
this.webPage = webPage;
86+
}
87+
88+
@Override
89+
public void run() {
90+
Invoker.getInvoker().invokeOnEventThread(() -> {
91+
webPage.forceRepaint();
92+
});
93+
}
94+
};
95+
7896
static class ThemeClientImplStub extends ThemeClient {
7997
@Override
8098
protected RenderTheme createRenderTheme() {
@@ -153,7 +171,7 @@ private String getTestPath(String testString) {
153171
testString = testString.substring(0, t);
154172
}
155173
this.testPath = testString;
156-
init(testString, pixelsHash);
174+
initTest(testString, pixelsHash);
157175
return testString;
158176
}
159177

@@ -181,8 +199,15 @@ private static void initPlatform() throws Exception {
181199
// initialize default toolkit
182200
final CountDownLatch latch = new CountDownLatch(1);
183201
PlatformImpl.startup(() -> {
184-
new WebEngine(); // initialize Webkit classes
202+
// initialize Webkit classes
203+
try {
204+
Class.forName(WebEngine.class.getName());
205+
Class.forName(WebPage.class.getName());
206+
} catch (Exception e) {}
207+
185208
System.loadLibrary("DumpRenderTreeJava");
209+
initDRT();
210+
new WebEngine();
186211
drt = new DumpRenderTree();
187212
PageCache.setCapacity(1);
188213
latch.countDown();
@@ -194,6 +219,9 @@ private static void initPlatform() throws Exception {
194219
boolean complete() { return this.complete; }
195220

196221
private void resetToConsistentStateBeforeTesting(final TestOptions options) {
222+
// Reset native objects associated with WebPage
223+
webPage.resetToConsistentStateBeforeTesting();
224+
197225
// Assign default values for all supported TestOptions
198226
webPage.overridePreference("experimental:CSSCustomPropertiesAndValuesEnabled", "false");
199227
webPage.overridePreference("enableColorFilter", "false");
@@ -202,8 +230,6 @@ private void resetToConsistentStateBeforeTesting(final TestOptions options) {
202230
for (Map.Entry<String, String> option : options.getOptions().entrySet()) {
203231
webPage.overridePreference(option.getKey(), option.getValue());
204232
}
205-
// Reset native objects associated with WebPage
206-
webPage.resetToConsistentStateBeforeTesting();
207233
}
208234

209235
private void reset(final TestOptions options) {
@@ -245,13 +271,22 @@ private void runTest(final String testString) throws Exception {
245271
Invoker.getInvoker().invokeOnEventThread(() -> {
246272
run(testString, l);
247273
});
274+
275+
timer = new Timer();
276+
TimerTask task = new RenderUpdateHelper(webPage);
277+
timer.schedule(task, 1000/60, 1000/60);
248278
// wait until test is finished
249279
l.await();
280+
task.cancel();
281+
timer.cancel();
282+
final CountDownLatch latchForEvents = new CountDownLatch(1);
250283
Invoker.getInvoker().invokeOnEventThread(() -> {
251284
mlog("dispose");
252285
webPage.stop();
253286
dispose();
287+
latchForEvents.countDown();
254288
});
289+
latchForEvents.await();
255290
}
256291

257292
// called from native
@@ -334,7 +369,8 @@ private synchronized void done() {
334369
this.latch.countDown();
335370
}
336371

337-
private static native void init(String testPath, String pixelsHash);
372+
private static native void initDRT();
373+
private static native void initTest(String testPath, String pixelsHash);
338374
private static native void didClearWindowObject(long pContext,
339375
long pWindowObject, EventSender eventSender);
340376
private static native void dispose();

modules/javafx.web/src/main/java/com/sun/javafx/webkit/drt/UIClientImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public void dispatchResourceLoadEvent(long frame, int state, String url, String
7979
}
8080
});
8181

82+
page.resetToConsistentStateBeforeTesting();
83+
8284
// This call is needed to add the main frame to WebPage.frames list.
8385
// TODO: investigate why it's not added automatically (via WebPage.fwkFrameCreated) and fix.
8486
page.getMainFrame();

modules/javafx.web/src/main/java/com/sun/webkit/WebPage.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,16 @@ public void updateContent(WCRectangle toPaint) {
633633
return;
634634
}
635635
updateDirty(toPaint);
636-
636+
updateRendering();
637637
} finally {
638638
unlockPage();
639639
}
640640
}
641641

642+
public void updateRendering() {
643+
twkUpdateRendering(getPage());
644+
}
645+
642646
public int getUpdateContentCycleID() {
643647
return updateContentCycleID;
644648
}
@@ -1155,6 +1159,12 @@ public int getUnloadEventListenersCount(long frameID) {
11551159
}
11561160
}
11571161

1162+
// DRT support
1163+
public void forceRepaint() {
1164+
repaintAll();
1165+
updateContent(new WCRectangle(0, 0, width, height));
1166+
}
1167+
11581168
public String getContentType(long frameID) {
11591169
lockPage();
11601170
try {
@@ -2597,6 +2607,7 @@ private native boolean twkFindInFrame(long pFrame,
25972607
private native void twkSetBounds(long pPage, int x, int y, int w, int h);
25982608
private native void twkPrePaint(long pPage);
25992609
private native void twkUpdateContent(long pPage, WCRenderQueue rq, int x, int y, int w, int h);
2610+
private native void twkUpdateRendering(long pPage);
26002611
private native void twkPostPaint(long pPage, WCRenderQueue rq,
26012612
int x, int y, int w, int h);
26022613

modules/javafx.web/src/main/legal/webkit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## WebKit Open Source Project: WebKit v609.1
1+
## WebKit Open Source Project: WebKit v610.1
22

33
### WebKit Notice
44
```

modules/javafx.web/src/main/native/Source/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,14 @@ endif ()
1313

1414
add_subdirectory(JavaScriptCore)
1515

16-
if (ENABLE_GRAPHICS_CONTEXT_3D)
16+
if (ENABLE_GRAPHICS_CONTEXT_GL)
1717
add_subdirectory(ThirdParty/ANGLE)
1818
endif ()
1919

2020
if (ENABLE_API_TESTS)
2121
add_subdirectory(ThirdParty/gtest)
2222
endif ()
2323

24-
if (USE_OPENVR)
25-
# OpenVR is compiled with -stdlib=libc++ as default if Clang is used.
26-
# Disable USE_LIBCXX not to use -stdlib=libc++.
27-
option(USE_LIBCXX "Uses libc++ instead of libstdc++" OFF)
28-
add_subdirectory(ThirdParty/openvr)
29-
endif ()
30-
3124
if (USE_XDGMIME)
3225
add_subdirectory(ThirdParty/xdgmime)
3326
endif ()

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/APICallbackFunction.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,72 +36,72 @@ namespace JSC {
3636

3737
struct APICallbackFunction {
3838

39-
template <typename T> static EncodedJSValue JSC_HOST_CALL call(ExecState*);
40-
template <typename T> static EncodedJSValue JSC_HOST_CALL construct(ExecState*);
39+
template <typename T> static EncodedJSValue JSC_HOST_CALL call(JSGlobalObject*, CallFrame*);
40+
template <typename T> static EncodedJSValue JSC_HOST_CALL construct(JSGlobalObject*, CallFrame*);
4141

4242
};
4343

4444
template <typename T>
45-
EncodedJSValue JSC_HOST_CALL APICallbackFunction::call(ExecState* exec)
45+
EncodedJSValue JSC_HOST_CALL APICallbackFunction::call(JSGlobalObject* globalObject, CallFrame* callFrame)
4646
{
47-
VM& vm = exec->vm();
47+
VM& vm = getVM(globalObject);
4848
auto scope = DECLARE_THROW_SCOPE(vm);
49-
JSContextRef execRef = toRef(exec);
50-
JSObjectRef functionRef = toRef(exec->jsCallee());
51-
JSObjectRef thisObjRef = toRef(jsCast<JSObject*>(exec->thisValue().toThis(exec, NotStrictMode)));
49+
JSContextRef execRef = toRef(globalObject);
50+
JSObjectRef functionRef = toRef(callFrame->jsCallee());
51+
JSObjectRef thisObjRef = toRef(jsCast<JSObject*>(callFrame->thisValue().toThis(globalObject, NotStrictMode)));
5252

53-
int argumentCount = static_cast<int>(exec->argumentCount());
53+
int argumentCount = static_cast<int>(callFrame->argumentCount());
5454
Vector<JSValueRef, 16> arguments;
5555
arguments.reserveInitialCapacity(argumentCount);
5656
for (int i = 0; i < argumentCount; i++)
57-
arguments.uncheckedAppend(toRef(exec, exec->uncheckedArgument(i)));
57+
arguments.uncheckedAppend(toRef(globalObject, callFrame->uncheckedArgument(i)));
5858

5959
JSValueRef exception = 0;
6060
JSValueRef result;
6161
{
62-
JSLock::DropAllLocks dropAllLocks(exec);
62+
JSLock::DropAllLocks dropAllLocks(globalObject);
6363
result = jsCast<T*>(toJS(functionRef))->functionCallback()(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception);
6464
}
6565
if (exception)
66-
throwException(exec, scope, toJS(exec, exception));
66+
throwException(globalObject, scope, toJS(globalObject, exception));
6767

6868
// result must be a valid JSValue.
6969
if (!result)
7070
return JSValue::encode(jsUndefined());
7171

72-
return JSValue::encode(toJS(exec, result));
72+
return JSValue::encode(toJS(globalObject, result));
7373
}
7474

7575
template <typename T>
76-
EncodedJSValue JSC_HOST_CALL APICallbackFunction::construct(ExecState* exec)
76+
EncodedJSValue JSC_HOST_CALL APICallbackFunction::construct(JSGlobalObject* globalObject, CallFrame* callFrame)
7777
{
78-
VM& vm = exec->vm();
78+
VM& vm = getVM(globalObject);
7979
auto scope = DECLARE_THROW_SCOPE(vm);
80-
JSObject* constructor = exec->jsCallee();
81-
JSContextRef ctx = toRef(exec);
80+
JSObject* constructor = callFrame->jsCallee();
81+
JSContextRef ctx = toRef(globalObject);
8282
JSObjectRef constructorRef = toRef(constructor);
8383

8484
JSObjectCallAsConstructorCallback callback = jsCast<T*>(constructor)->constructCallback();
8585
if (callback) {
86-
size_t argumentCount = exec->argumentCount();
86+
size_t argumentCount = callFrame->argumentCount();
8787
Vector<JSValueRef, 16> arguments;
8888
arguments.reserveInitialCapacity(argumentCount);
8989
for (size_t i = 0; i < argumentCount; ++i)
90-
arguments.uncheckedAppend(toRef(exec, exec->uncheckedArgument(i)));
90+
arguments.uncheckedAppend(toRef(globalObject, callFrame->uncheckedArgument(i)));
9191

9292
JSValueRef exception = 0;
9393
JSObjectRef result;
9494
{
95-
JSLock::DropAllLocks dropAllLocks(exec);
95+
JSLock::DropAllLocks dropAllLocks(globalObject);
9696
result = callback(ctx, constructorRef, argumentCount, arguments.data(), &exception);
9797
}
9898
if (exception) {
99-
throwException(exec, scope, toJS(exec, exception));
100-
return JSValue::encode(toJS(exec, exception));
99+
throwException(globalObject, scope, toJS(globalObject, exception));
100+
return JSValue::encode(toJS(globalObject, exception));
101101
}
102102
// result must be a valid JSValue.
103103
if (!result)
104-
return throwVMTypeError(exec, scope);
104+
return throwVMTypeError(globalObject, scope);
105105
return JSValue::encode(toJS(result));
106106
}
107107

modules/javafx.web/src/main/native/Source/JavaScriptCore/API/APICast.h

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "HeapCellInlines.h"
3434

3535
namespace JSC {
36-
class ExecState;
36+
class CallFrame;
3737
class PropertyNameArray;
3838
class VM;
3939
class JSObject;
@@ -49,26 +49,26 @@ typedef struct OpaqueJSValue* JSObjectRef;
4949

5050
/* Opaque typing convenience methods */
5151

52-
inline JSC::ExecState* toJS(JSContextRef c)
52+
inline JSC::JSGlobalObject* toJS(JSContextRef context)
5353
{
54-
ASSERT(c);
55-
return reinterpret_cast<JSC::ExecState*>(const_cast<OpaqueJSContext*>(c));
54+
ASSERT(context);
55+
return reinterpret_cast<JSC::JSGlobalObject*>(const_cast<OpaqueJSContext*>(context));
5656
}
5757

58-
inline JSC::ExecState* toJS(JSGlobalContextRef c)
58+
inline JSC::JSGlobalObject* toJS(JSGlobalContextRef context)
5959
{
60-
ASSERT(c);
61-
return reinterpret_cast<JSC::ExecState*>(c);
60+
ASSERT(context);
61+
return reinterpret_cast<JSC::JSGlobalObject*>(context);
6262
}
6363

6464
inline JSC::JSGlobalObject* toJSGlobalObject(JSGlobalContextRef context)
6565
{
66-
return toJS(context)->lexicalGlobalObject();
66+
return toJS(context);
6767
}
6868

69-
inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v)
69+
inline JSC::JSValue toJS(JSC::JSGlobalObject* globalObject, JSValueRef v)
7070
{
71-
ASSERT_UNUSED(exec, exec);
71+
ASSERT_UNUSED(globalObject, globalObject);
7272
#if !CPU(ADDRESS64)
7373
JSC::JSCell* jsCell = reinterpret_cast<JSC::JSCell*>(const_cast<OpaqueJSValue*>(v));
7474
if (!jsCell)
@@ -84,13 +84,13 @@ inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v)
8484
if (!result)
8585
return JSC::jsNull();
8686
if (result.isCell())
87-
RELEASE_ASSERT(result.asCell()->methodTable(exec->vm()));
87+
RELEASE_ASSERT(result.asCell()->methodTable(getVM(globalObject)));
8888
return result;
8989
}
9090

91-
inline JSC::JSValue toJSForGC(JSC::ExecState* exec, JSValueRef v)
91+
inline JSC::JSValue toJSForGC(JSC::JSGlobalObject* globalObject, JSValueRef v)
9292
{
93-
ASSERT_UNUSED(exec, exec);
93+
ASSERT_UNUSED(globalObject, globalObject);
9494
#if !CPU(ADDRESS64)
9595
JSC::JSCell* jsCell = reinterpret_cast<JSC::JSCell*>(const_cast<OpaqueJSValue*>(v));
9696
if (!jsCell)
@@ -100,7 +100,7 @@ inline JSC::JSValue toJSForGC(JSC::ExecState* exec, JSValueRef v)
100100
JSC::JSValue result = bitwise_cast<JSC::JSValue>(v);
101101
#endif
102102
if (result && result.isCell())
103-
RELEASE_ASSERT(result.asCell()->methodTable(exec->vm()));
103+
RELEASE_ASSERT(result.asCell()->methodTable(getVM(globalObject)));
104104
return result;
105105
}
106106

@@ -143,9 +143,9 @@ inline JSValueRef toRef(JSC::VM& vm, JSC::JSValue v)
143143
#endif
144144
}
145145

146-
inline JSValueRef toRef(JSC::ExecState* exec, JSC::JSValue v)
146+
inline JSValueRef toRef(JSC::JSGlobalObject* globalObject, JSC::JSValue v)
147147
{
148-
return toRef(exec->vm(), v);
148+
return toRef(getVM(globalObject), v);
149149
}
150150

151151
inline JSObjectRef toRef(JSC::JSObject* o)
@@ -158,15 +158,14 @@ inline JSObjectRef toRef(const JSC::JSObject* o)
158158
return reinterpret_cast<JSObjectRef>(const_cast<JSC::JSObject*>(o));
159159
}
160160

161-
inline JSContextRef toRef(JSC::ExecState* e)
161+
inline JSContextRef toRef(JSC::JSGlobalObject* globalObject)
162162
{
163-
return reinterpret_cast<JSContextRef>(e);
163+
return reinterpret_cast<JSContextRef>(globalObject);
164164
}
165165

166-
inline JSGlobalContextRef toGlobalRef(JSC::ExecState* e)
166+
inline JSGlobalContextRef toGlobalRef(JSC::JSGlobalObject* globalObject)
167167
{
168-
ASSERT(e == e->lexicalGlobalObject()->globalExec());
169-
return reinterpret_cast<JSGlobalContextRef>(e);
168+
return reinterpret_cast<JSGlobalContextRef>(globalObject);
170169
}
171170

172171
inline JSPropertyNameAccumulatorRef toRef(JSC::PropertyNameArray* l)

0 commit comments

Comments
 (0)