diff --git a/browser_patches/webkit/patches/0001-chore-bootstrap.patch b/browser_patches/webkit/patches/0001-chore-bootstrap.patch index 172c25fd7f..9b6e6e3f4f 100644 --- a/browser_patches/webkit/patches/0001-chore-bootstrap.patch +++ b/browser_patches/webkit/patches/0001-chore-bootstrap.patch @@ -1,7 +1,7 @@ -From 5ca970f3de98c8c1b94a54e4f357426bfa0bd82f Mon Sep 17 00:00:00 2001 +From 48a72a80f1e602ff1f0b86a759cf7da5405cdee9 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov -Date: Tue, 10 Dec 2019 00:25:58 -0800 -Subject: [PATCH] chore: bootstrap +Date: Tue, 10 Dec 2019 10:36:03 -0800 +Subject: [PATCH xserver] chore: bootstrap --- Source/JavaScriptCore/CMakeLists.txt | 4 + @@ -19,14 +19,14 @@ Subject: [PATCH] chore: bootstrap .../inspector/protocol/Page.json | 111 +++- .../inspector/protocol/Target.json | 22 +- Source/WebCore/html/FileInputType.cpp | 6 + - .../inspector/InspectorInstrumentation.cpp | 26 +- + .../inspector/InspectorInstrumentation.cpp | 23 +- .../inspector/InspectorInstrumentation.h | 21 + .../inspector/agents/InspectorDOMAgent.cpp | 161 ++++- .../inspector/agents/InspectorDOMAgent.h | 9 +- .../agents/InspectorDOMStorageAgent.h | 1 + - .../inspector/agents/InspectorPageAgent.cpp | 560 +++++++++++++++++- - .../inspector/agents/InspectorPageAgent.h | 28 +- - .../agents/page/PageRuntimeAgent.cpp | 61 +- + .../inspector/agents/InspectorPageAgent.cpp | 554 +++++++++++++++++- + .../inspector/agents/InspectorPageAgent.h | 26 +- + .../agents/page/PageRuntimeAgent.cpp | 53 +- .../inspector/agents/page/PageRuntimeAgent.h | 5 +- Source/WebCore/loader/FrameLoader.cpp | 1 + Source/WebCore/page/History.cpp | 1 + @@ -124,7 +124,7 @@ Subject: [PATCH] chore: bootstrap .../mac/WK2BrowserWindowController.h | 3 + .../mac/WK2BrowserWindowController.m | 38 +- Tools/MiniBrowser/wpe/main.cpp | 37 ++ - 120 files changed, 5073 insertions(+), 138 deletions(-) + 120 files changed, 5065 insertions(+), 127 deletions(-) create mode 100644 Source/JavaScriptCore/inspector/protocol/Browser.json create mode 100644 Source/JavaScriptCore/inspector/protocol/Dialog.json create mode 100644 Source/JavaScriptCore/inspector/protocol/Emulation.json @@ -1138,7 +1138,7 @@ index 4e41fd3f807..1f7be602cb2 100644 return; diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp -index cb6ed9f6c84..cac3f7682fa 100644 +index cb6ed9f6c84..4402d67463d 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.cpp +++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp @@ -121,7 +121,7 @@ static Frame* frameForScriptExecutionContext(ScriptExecutionContext& context) @@ -1150,17 +1150,7 @@ index cb6ed9f6c84..cac3f7682fa 100644 return; if (auto* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent()) -@@ -129,9 +129,6 @@ void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgen - - if (auto* pageRuntimeAgent = instrumentingAgents.pageRuntimeAgent()) - pageRuntimeAgent->didClearWindowObjectInWorld(frame); -- -- if (auto* pageAgent = instrumentingAgents.inspectorPageAgent()) -- pageAgent->didClearWindowObjectInWorld(frame); - } - - bool InspectorInstrumentation::isDebuggerPausedImpl(InstrumentingAgents& instrumentingAgents) -@@ -656,20 +653,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& +@@ -656,20 +656,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgents& instrumentingAgents, Frame& frame) { @@ -1184,7 +1174,7 @@ index cb6ed9f6c84..cac3f7682fa 100644 } void InspectorInstrumentation::frameDetachedFromParentImpl(InstrumentingAgents& instrumentingAgents, Frame& frame) -@@ -783,6 +777,12 @@ void InspectorInstrumentation::frameClearedScheduledNavigationImpl(Instrumenting +@@ -783,6 +780,12 @@ void InspectorInstrumentation::frameClearedScheduledNavigationImpl(Instrumenting inspectorPageAgent->frameClearedScheduledNavigation(frame); } @@ -1197,7 +1187,7 @@ index cb6ed9f6c84..cac3f7682fa 100644 void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents, bool useDarkAppearance) { if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent()) -@@ -1251,6 +1251,12 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins +@@ -1251,6 +1254,12 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins layerTreeAgent->renderLayerDestroyed(renderLayer); } @@ -1605,7 +1595,7 @@ index b578660fbb3..a7c968bc9f8 100644 class Page; class SecurityOrigin; diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp -index f2e228b7f74..40834d85fd7 100644 +index f2e228b7f74..52995f8fb0b 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp @@ -32,6 +32,8 @@ @@ -1731,30 +1721,20 @@ index f2e228b7f74..40834d85fd7 100644 m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame)); } -@@ -761,17 +787,15 @@ void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame) +@@ -761,6 +787,12 @@ void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame) m_frontendDispatcher->frameClearedScheduledNavigation(frameId(&frame)); } --void InspectorPageAgent::defaultAppearanceDidChange(bool useDarkAppearance) +void InspectorPageAgent::didNavigateWithinPage(Frame& frame) - { -- m_frontendDispatcher->defaultAppearanceDidChange(useDarkAppearance ? Inspector::Protocol::Page::Appearance::Dark : Inspector::Protocol::Page::Appearance::Light); ++{ + String url = frame.document()->url().string(); + m_frontendDispatcher->navigatedWithinDocument(frameId(&frame), url); - } - --void InspectorPageAgent::didClearWindowObjectInWorld(Frame& frame) -+void InspectorPageAgent::defaultAppearanceDidChange(bool useDarkAppearance) ++} ++ + void InspectorPageAgent::defaultAppearanceDidChange(bool useDarkAppearance) { -- if (m_bootstrapScript.isEmpty()) -- return; -- -- frame.script().evaluate(ScriptSourceCode(m_bootstrapScript, URL { URL(), "web-inspector://bootstrap.js"_s })); -+ m_frontendDispatcher->defaultAppearanceDidChange(useDarkAppearance ? Inspector::Protocol::Page::Appearance::Dark : Inspector::Protocol::Page::Appearance::Light); - } - - void InspectorPageAgent::didPaint(RenderObject& renderer, const LayoutRect& rect) -@@ -815,6 +839,25 @@ void InspectorPageAgent::didRecalculateStyle() + m_frontendDispatcher->defaultAppearanceDidChange(useDarkAppearance ? Inspector::Protocol::Page::Appearance::Dark : Inspector::Protocol::Page::Appearance::Light); +@@ -815,6 +847,25 @@ void InspectorPageAgent::didRecalculateStyle() m_overlay->update(); } @@ -1780,7 +1760,7 @@ index f2e228b7f74..40834d85fd7 100644 Ref InspectorPageAgent::buildObjectForFrame(Frame* frame) { ASSERT_ARG(frame, frame); -@@ -986,4 +1029,487 @@ void InspectorPageAgent::archive(ErrorString& errorString, String* data) +@@ -986,4 +1037,487 @@ void InspectorPageAgent::archive(ErrorString& errorString, String* data) #endif } @@ -2269,7 +2249,7 @@ index f2e228b7f74..40834d85fd7 100644 + } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h -index 4fd8c0b1016..c4b6a7c3e66 100644 +index 4fd8c0b1016..b2d547cee84 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.h +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h @@ -40,10 +40,15 @@ @@ -2320,7 +2300,7 @@ index 4fd8c0b1016..c4b6a7c3e66 100644 void frameNavigated(Frame&); void frameDetached(Frame&); void loaderDetachedFromFrame(DocumentLoader&); -@@ -126,19 +138,22 @@ public: +@@ -126,6 +138,7 @@ public: void frameStoppedLoading(Frame&); void frameScheduledNavigation(Frame&, Seconds delay); void frameClearedScheduledNavigation(Frame&); @@ -2328,8 +2308,7 @@ index 4fd8c0b1016..c4b6a7c3e66 100644 void defaultAppearanceDidChange(bool useDarkAppearance); void applyUserAgentOverride(String&); void applyEmulatedMedia(String&); -- void didClearWindowObjectInWorld(Frame&); - void didPaint(RenderObject&, const LayoutRect&); +@@ -134,11 +147,13 @@ public: void didLayout(); void didScroll(); void didRecalculateStyle(); @@ -2340,7 +2319,6 @@ index 4fd8c0b1016..c4b6a7c3e66 100644 String loaderId(DocumentLoader*); Frame* assertFrame(ErrorString&, const String& frameId); + HashMap isolatedWorldScripts() { return m_isolatedWorldScripts; }; -+ String bootstrapScript() { return m_bootstrapScript; } private: double timestamp(); @@ -2364,7 +2342,7 @@ index 4fd8c0b1016..c4b6a7c3e66 100644 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp -index 8c4a104da04..a0cac51247f 100644 +index 8c4a104da04..be7c4c35b70 100644 --- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp +++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp @@ -40,6 +40,7 @@ @@ -2393,7 +2371,7 @@ index 8c4a104da04..a0cac51247f 100644 } void PageRuntimeAgent::disable(ErrorString& errorString) -@@ -93,9 +92,18 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(Frame& frame) +@@ -93,9 +92,15 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(Frame& frame) if (!pageAgent) return; @@ -2404,9 +2382,6 @@ index 8c4a104da04..a0cac51247f 100644 + Document* document = frame.document(); + String worldName = document ? document->securityOrigin().toRawString() : String(); + notifyContextCreated(frame, scriptState, worldName, true); -+ String bootstrapScript = pageAgent->bootstrapScript(); -+ if (!bootstrapScript.isEmpty()) -+ frame.script().evaluateInWorld(ScriptSourceCode(bootstrapScript, URL { URL(), "web-inspector://bootstrap.js"_s }), mainThreadNormalWorld()); + + // Create user worlds. + for (auto pair : pageAgent->isolatedWorldScripts()) @@ -2414,7 +2389,7 @@ index 8c4a104da04..a0cac51247f 100644 } InjectedScript PageRuntimeAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId) -@@ -135,33 +143,38 @@ void PageRuntimeAgent::reportExecutionContextCreation() +@@ -135,33 +140,38 @@ void PageRuntimeAgent::reportExecutionContextCreation() if (!frame->script().canExecuteScripts(NotAboutToExecuteScript)) continue; @@ -2463,7 +2438,7 @@ index 8c4a104da04..a0cac51247f 100644 .setFrameId(frameId) .release()); } -@@ -178,4 +191,18 @@ void PageRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& ob +@@ -178,4 +188,13 @@ void PageRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& ob InspectorRuntimeAgent::callFunctionOn(errorString, objectId, expression, optionalArguments, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, emulateUserGesture, result, wasThrown); } @@ -2474,11 +2449,6 @@ index 8c4a104da04..a0cac51247f 100644 + frame.script().evaluateInWorld(ScriptSourceCode(source, URL { URL(), "web-inspector://isolate_world.js"_s }), world); + auto* scriptState = frame.windowProxy().jsWindowProxy(world)->window(); + notifyContextCreated(frame, scriptState, name, false); -+ -+ auto* pageAgent = m_instrumentingAgents.inspectorPageAgent(); -+ String bootstrapScript = pageAgent->bootstrapScript(); -+ if (!bootstrapScript.isEmpty()) -+ frame.script().evaluateInWorld(ScriptSourceCode(bootstrapScript, URL { URL(), "web-inspector://bootstrap.js"_s }), world); +} + } // namespace WebCore @@ -6457,7 +6427,7 @@ index 00000000000..e8a29bebe24 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp new file mode 100644 -index 00000000000..4cf8860cf76 +index 00000000000..e9af79dad57 --- /dev/null +++ b/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp @@ -0,0 +1,85 @@ @@ -6504,7 +6474,7 @@ index 00000000000..4cf8860cf76 + return state; +} + -+void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebKeyboardEvent::Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& mac_commands, WallTime timestamp) ++void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebKeyboardEvent::Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& macCommands, WallTime timestamp) +{ + Vector commands; + const guint keyVal = WebCore::PlatformKeyboardEvent::gdkKeyCodeForWindowsKeyCode(windowsVirtualKeyCode); @@ -6791,7 +6761,7 @@ index 00000000000..d364ca6d955 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm new file mode 100644 -index 00000000000..9064d41f4d5 +index 00000000000..08394ef65f3 --- /dev/null +++ b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm @@ -0,0 +1,91 @@ @@ -6862,11 +6832,11 @@ index 00000000000..9064d41f4d5 +void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebKeyboardEvent::Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& commands, WallTime timestamp) +{ + String keyIdentifier = key.length() == 1 ? makeString("U+", hex(toASCIIUpper(key.characterAt(0)), 4)) : key; -+ Vector mac_commands; ++ Vector macCommands; + for (const String& command : commands) -+ mac_commands.append(WebCore::KeypressCommand(command.utf8().data())); -+ if (text.length() > 0 && mac_commands.size() == 0) -+ mac_commands.append(WebCore::KeypressCommand("insertText:", text)); ++ macCommands.append(WebCore::KeypressCommand(command.utf8().data())); ++ if (text.length() > 0 && macCommands.size() == 0) ++ macCommands.append(WebCore::KeypressCommand("insertText:", text)); + NativeWebKeyboardEvent event( + type, + text, @@ -6881,7 +6851,7 @@ index 00000000000..9064d41f4d5 + isSystemKey, + modifiers, + timestamp, -+ WTFMove(mac_commands)); ++ WTFMove(macCommands)); + m_page.handleKeyboardEvent(event); +} + @@ -6938,7 +6908,7 @@ index 00000000000..2fef19fd5ee +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp new file mode 100644 -index 00000000000..4ae3eb95dff +index 00000000000..bbcba6f0a65 --- /dev/null +++ b/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp @@ -0,0 +1,76 @@ @@ -6987,7 +6957,7 @@ index 00000000000..4ae3eb95dff + return result; +} + -+void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebKeyboardEvent::Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, WallTime timestamp) ++void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebKeyboardEvent::Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& macCommands, WallTime timestamp) +{ + unsigned keyCode = WebCore::PlatformKeyboardEvent::WPEKeyCodeForWindowsKeyCode(windowsVirtualKeyCode); + struct wpe_input_xkb_keymap_entry* entries; @@ -7891,5 +7861,5 @@ index 2d183d39412..d94d4f06fc5 100644 webkit_web_context_set_tls_errors_policy(webContext, WEBKIT_TLS_ERRORS_POLICY_IGNORE); -- -2.22.1 +2.17.1