@@ -836,7 +836,7 @@ index 777a54166ed6664561b3f8249a6abb4ac59d0480..e738f34f65fa8137a16bf7b66bc237b8
836
836
"name": "webSocketWillSendHandshakeRequest",
837
837
"description": "Fired when WebSocket is about to initiate handshake.",
838
838
diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json
839
- index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4818c82fff8b19e060e129275ef5f95f1db2fcb0 100644
839
+ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..074e0e53b03f3453972c11e39d021baaff44131e 100644
840
840
--- a/Source/JavaScriptCore/inspector/protocol/Page.json
841
841
+++ b/Source/JavaScriptCore/inspector/protocol/Page.json
842
842
@@ -109,6 +109,41 @@
@@ -925,7 +925,7 @@ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4818c82fff8b19e060e129275ef5f95f
925
925
{
926
926
"name": "snapshotNode",
927
927
"description": "Capture a snapshot of the specified node that does not include unrelated layers.",
928
- @@ -282,19 +341,85 @@
928
+ @@ -282,19 +341,92 @@
929
929
"returns": [
930
930
{ "name": "data", "type": "string", "description": "Base64-encoded web archive." }
931
931
]
@@ -992,6 +992,13 @@ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4818c82fff8b19e060e129275ef5f95f
992
992
+ "description": "Overrides window.orientation with provided value.",
993
993
+ "parameters": [
994
994
+ { "name": "angle", "type": "integer", "optional": true }
995
+ + ]
996
+ + },
997
+ + {
998
+ + "name": "setActivityPaused",
999
+ + "description": "Pauses page activity (active objects, animations).",
1000
+ + "parameters": [
1001
+ + { "name": "paused", "type": "boolean" }
995
1002
+ ]
996
1003
}
997
1004
],
@@ -1013,7 +1020,7 @@ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4818c82fff8b19e060e129275ef5f95f
1013
1020
]
1014
1021
},
1015
1022
{
1016
- @@ -304,6 +429 ,14 @@
1023
+ @@ -304,6 +436 ,14 @@
1017
1024
{ "name": "frame", "$ref": "Frame", "description": "Frame object." }
1018
1025
]
1019
1026
},
@@ -1028,7 +1035,7 @@ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4818c82fff8b19e060e129275ef5f95f
1028
1035
{
1029
1036
"name": "frameDetached",
1030
1037
"description": "Fired when frame has been detached from its parent.",
1031
- @@ -340,12 +473 ,50 @@
1038
+ @@ -340,12 +480 ,50 @@
1032
1039
{ "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." }
1033
1040
]
1034
1041
},
@@ -3073,10 +3080,10 @@ index b038a1879c043aa17dae97425693f29be42e3258..d60716b837663004675ffd90bceede4c
3073
3080
3074
3081
} // namespace WebCore
3075
3082
diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
3076
- index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c670a0c1a2 100644
3083
+ index 3e8680e1df15245df250aa8e52c3126935832037..6265563481ad523f4cac4d05142667698b797231 100644
3077
3084
--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
3078
3085
+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
3079
- @@ -32,6 +32,8 @@
3086
+ @@ -32,20 +32,27 @@
3080
3087
#include "config.h"
3081
3088
#include "InspectorPageAgent.h"
3082
3089
@@ -3085,9 +3092,12 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3085
3092
#include "CachedResource.h"
3086
3093
#include "CachedResourceLoader.h"
3087
3094
#include "Cookie.h"
3088
- @@ -40,12 +42,15 @@
3095
+ #include "CookieJar.h"
3096
+ #include "CustomHeaderFields.h"
3097
+ +#include "CSSAnimationController.h"
3089
3098
#include "DOMWrapperWorld.h"
3090
3099
#include "Document.h"
3100
+ +#include "DocumentTimeline.h"
3091
3101
#include "DocumentLoader.h"
3092
3102
+#include "FocusController.h"
3093
3103
#include "Frame.h"
@@ -3101,7 +3111,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3101
3111
#include "HTMLNames.h"
3102
3112
#include "ImageBuffer.h"
3103
3113
#include "InspectorClient.h"
3104
- @@ -56,19 +61,28 @@
3114
+ @@ -56,19 +63,30 @@
3105
3115
#include "MIMETypeRegistry.h"
3106
3116
#include "MemoryCache.h"
3107
3117
#include "Page.h"
@@ -3115,6 +3125,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3115
3125
#include "SecurityOrigin.h"
3116
3126
#include "Settings.h"
3117
3127
#include "StyleScope.h"
3128
+ +#include "SVGDocumentExtensions.h"
3118
3129
#include "TextEncoding.h"
3119
3130
+#include "TypingCommand.h"
3120
3131
#include "UserGestureIndicator.h"
@@ -3124,21 +3135,22 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3124
3135
#include <JavaScriptCore/RegularExpression.h>
3125
3136
+#include <wtf/DateMath.h>
3126
3137
#include <wtf/ListHashSet.h>
3138
+ +#include <wtf/MainThread.h>
3127
3139
+#include <wtf/NeverDestroyed.h>
3128
3140
+#include <wtf/Ref.h>
3129
3141
+#include <wtf/RefPtr.h>
3130
3142
#include <wtf/Stopwatch.h>
3131
3143
#include <wtf/text/Base64.h>
3132
3144
#include <wtf/text/StringBuilder.h>
3133
- @@ -81,7 +95 ,6 @@
3145
+ @@ -81,7 +99 ,6 @@
3134
3146
#include "LegacyWebArchive.h"
3135
3147
#endif
3136
3148
3137
3149
-
3138
3150
namespace WebCore {
3139
3151
3140
3152
using namespace Inspector;
3141
- @@ -100,6 +113 ,11 @@ using namespace Inspector;
3153
+ @@ -100,6 +117 ,11 @@ using namespace Inspector;
3142
3154
macro(WebRTCEncryptionEnabled) \
3143
3155
macro(WebSecurityEnabled)
3144
3156
@@ -3150,15 +3162,15 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3150
3162
static bool decodeBuffer(const char* buffer, unsigned size, const String& textEncodingName, String* result)
3151
3163
{
3152
3164
if (buffer) {
3153
- @@ -340,6 +358 ,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien
3165
+ @@ -340,6 +362 ,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien
3154
3166
, m_frontendDispatcher(makeUnique<Inspector::PageFrontendDispatcher>(context.frontendRouter))
3155
3167
, m_backendDispatcher(Inspector::PageBackendDispatcher::create(context.backendDispatcher, this))
3156
3168
, m_inspectedPage(context.inspectedPage)
3157
3169
+ , m_injectedScriptManager(context.injectedScriptManager)
3158
3170
, m_client(client)
3159
3171
, m_overlay(overlay)
3160
3172
{
3161
- @@ -373,11 +392 ,20 @@ void InspectorPageAgent::enable(ErrorString& errorString)
3173
+ @@ -373,11 +396 ,20 @@ void InspectorPageAgent::enable(ErrorString& errorString)
3162
3174
#if HAVE(OS_DARK_MODE_SUPPORT)
3163
3175
defaultAppearanceDidChange(m_inspectedPage.defaultUseDarkAppearance());
3164
3176
#endif
@@ -3179,7 +3191,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3179
3191
3180
3192
ErrorString unused;
3181
3193
setShowPaintRects(unused, false);
3182
- @@ -415,12 +443 ,34 @@ void InspectorPageAgent::reload(ErrorString&, const bool* optionalReloadFromOrig
3194
+ @@ -415,12 +447 ,34 @@ void InspectorPageAgent::reload(ErrorString&, const bool* optionalReloadFromOrig
3183
3195
m_inspectedPage.mainFrame().loader().reload(reloadOptions);
3184
3196
}
3185
3197
@@ -3216,7 +3228,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3216
3228
FrameLoadRequest frameLoadRequest { *frame.document(), frame.document()->securityOrigin(), WTFMove(resourceRequest), "_self"_s, InitiatedByMainFrame::Unknown };
3217
3229
frameLoadRequest.disableNavigationToInvalidURL();
3218
3230
frame.loader().changeLocation(WTFMove(frameLoadRequest));
3219
- @@ -748,15 +798 ,16 @@ void InspectorPageAgent::setShowPaintRects(ErrorString&, bool show)
3231
+ @@ -748,15 +802 ,16 @@ void InspectorPageAgent::setShowPaintRects(ErrorString&, bool show)
3220
3232
m_overlay->setShowPaintRects(show);
3221
3233
}
3222
3234
@@ -3238,7 +3250,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3238
3250
}
3239
3251
3240
3252
void InspectorPageAgent::frameNavigated(Frame& frame)
3241
- @@ -764,13 +815 ,23 @@ void InspectorPageAgent::frameNavigated(Frame& frame)
3253
+ @@ -764,13 +819 ,23 @@ void InspectorPageAgent::frameNavigated(Frame& frame)
3242
3254
m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame));
3243
3255
}
3244
3256
@@ -3265,7 +3277,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3265
3277
}
3266
3278
3267
3279
Frame* InspectorPageAgent::frameForId(const String& frameId)
3268
- @@ -782,20 +843 ,18 @@ String InspectorPageAgent::frameId(Frame* frame)
3280
+ @@ -782,20 +847 ,18 @@ String InspectorPageAgent::frameId(Frame* frame)
3269
3281
{
3270
3282
if (!frame)
3271
3283
return emptyString();
@@ -3292,7 +3304,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3292
3304
}
3293
3305
3294
3306
Frame* InspectorPageAgent::assertFrame(ErrorString& errorString, const String& frameId)
3295
- @@ -806,11 +865 ,6 @@ Frame* InspectorPageAgent::assertFrame(ErrorString& errorString, const String& f
3307
+ @@ -806,11 +869 ,6 @@ Frame* InspectorPageAgent::assertFrame(ErrorString& errorString, const String& f
3296
3308
return frame;
3297
3309
}
3298
3310
@@ -3304,7 +3316,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3304
3316
void InspectorPageAgent::frameStartedLoading(Frame& frame)
3305
3317
{
3306
3318
m_frontendDispatcher->frameStartedLoading(frameId(&frame));
3307
- @@ -831,6 +885 ,12 @@ void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame)
3319
+ @@ -831,6 +889 ,12 @@ void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame)
3308
3320
m_frontendDispatcher->frameClearedScheduledNavigation(frameId(&frame));
3309
3321
}
3310
3322
@@ -3317,7 +3329,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3317
3329
void InspectorPageAgent::defaultAppearanceDidChange(bool useDarkAppearance)
3318
3330
{
3319
3331
m_frontendDispatcher->defaultAppearanceDidChange(useDarkAppearance ? Inspector::Protocol::Page::Appearance::Dark : Inspector::Protocol::Page::Appearance::Light);
3320
- @@ -888,6 +948 ,48 @@ void InspectorPageAgent::didRecalculateStyle()
3332
+ @@ -888,6 +952 ,48 @@ void InspectorPageAgent::didRecalculateStyle()
3321
3333
m_overlay->update();
3322
3334
}
3323
3335
@@ -3366,7 +3378,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3366
3378
Ref<Inspector::Protocol::Page::Frame> InspectorPageAgent::buildObjectForFrame(Frame* frame)
3367
3379
{
3368
3380
ASSERT_ARG(frame, frame);
3369
- @@ -1031,6 +1133 ,29 @@ void InspectorPageAgent::snapshotRect(ErrorString& errorString, int x, int y, in
3381
+ @@ -1031,6 +1137 ,29 @@ void InspectorPageAgent::snapshotRect(ErrorString& errorString, int x, int y, in
3370
3382
*outDataURL = snapshot->toDataURL("image/png"_s, WTF::nullopt, PreserveResolution::Yes);
3371
3383
}
3372
3384
@@ -3396,7 +3408,7 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3396
3408
void InspectorPageAgent::archive(ErrorString& errorString, String* data)
3397
3409
{
3398
3410
#if ENABLE(WEB_ARCHIVE) && USE(CF)
3399
- @@ -1048,4 +1173,543 @@ void InspectorPageAgent::archive(ErrorString& errorString, String* data)
3411
+ @@ -1048,4 +1177,578 @@ void InspectorPageAgent::archive(ErrorString& errorString, String* data)
3400
3412
#endif
3401
3413
}
3402
3414
@@ -3938,10 +3950,45 @@ index 3e8680e1df15245df250aa8e52c3126935832037..aa712305c6eeb786445b4953a55005c6
3938
3950
+ errorString = "Orientation events are disabled in this build";
3939
3951
+#endif
3940
3952
+}
3953
+ +
3954
+ +void InspectorPageAgent::setActivityPaused(Inspector::ErrorString& errorString, bool paused)
3955
+ +{
3956
+ + setMainThreadCallbacksPaused(paused);
3957
+ + bool webAnimationsCSSIntegrationEnabled = RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled();
3958
+ + for (Frame* frame = &m_inspectedPage.mainFrame(); frame; frame = frame->tree().traverseNext()) {
3959
+ + ASSERT(frame->document());
3960
+ + auto& document = *frame->document();
3961
+ + if (paused) {
3962
+ + document.suspendScriptedAnimationControllerCallbacks();
3963
+ + document.suspendActiveDOMObjects(ReasonForSuspension::JavaScriptDebuggerPaused);
3964
+ + if (webAnimationsCSSIntegrationEnabled) {
3965
+ + if (auto* timeline = document.existingTimeline())
3966
+ + timeline->suspendAnimations();
3967
+ + }
3968
+ + if (document.svgExtensions())
3969
+ + document.accessSVGExtensions().pauseAnimations();
3970
+ + } else {
3971
+ + document.resumeActiveDOMObjects(ReasonForSuspension::JavaScriptDebuggerPaused);
3972
+ + document.resumeScriptedAnimationControllerCallbacks();
3973
+ + if (webAnimationsCSSIntegrationEnabled) {
3974
+ + if (auto* timeline = document.existingTimeline())
3975
+ + timeline->resumeAnimations();
3976
+ + }
3977
+ + if (document.svgExtensions())
3978
+ + document.accessSVGExtensions().unpauseAnimations();
3979
+ + }
3980
+ + }
3981
+ + if (!webAnimationsCSSIntegrationEnabled) {
3982
+ + if (paused)
3983
+ + m_inspectedPage.mainFrame().animation().suspendAnimations();
3984
+ + else
3985
+ + m_inspectedPage.mainFrame().animation().resumeAnimations();
3986
+ + }
3987
+ +}
3941
3988
+
3942
3989
} // namespace WebCore
3943
3990
diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h
3944
- index 6c75829502336b0806db2531e78186d2c559e44c..a2f8734a41a3a7d6ba489ea65fe8ca18e91c92d9 100644
3991
+ index 6c75829502336b0806db2531e78186d2c559e44c..1ad6b8e863c56fd572910db6c6fb524d367f2ad8 100644
3945
3992
--- a/Source/WebCore/inspector/agents/InspectorPageAgent.h
3946
3993
+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h
3947
3994
@@ -34,17 +34,23 @@
@@ -3987,7 +4034,7 @@ index 6c75829502336b0806db2531e78186d2c559e44c..a2f8734a41a3a7d6ba489ea65fe8ca18
3987
4034
void overrideUserAgent(ErrorString&, const String* value) override;
3988
4035
void overrideSetting(ErrorString&, const String& setting, const bool* value) override;
3989
4036
void getCookies(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::Cookie>>& cookies) override;
3990
- @@ -112,20 +121,31 @@ public:
4037
+ @@ -112,20 +121,32 @@ public:
3991
4038
void setShowPaintRects(ErrorString&, bool show) override;
3992
4039
void setEmulatedMedia(ErrorString&, const String&) override;
3993
4040
void setForcedAppearance(ErrorString&, const String&) override;
@@ -4006,6 +4053,7 @@ index 6c75829502336b0806db2531e78186d2c559e44c..a2f8734a41a3a7d6ba489ea65fe8ca18
4006
4053
+ void crash(ErrorString&) override;
4007
4054
+ void setScreenSizeOverride(ErrorString&, int width, int height) override;
4008
4055
+ void setOrientationOverride(Inspector::ErrorString&, const int* angle) override;
4056
+ + void setActivityPaused(Inspector::ErrorString&, bool) override;
4009
4057
4010
4058
// InspectorInstrumentation
4011
4059
- void domContentEventFired();
@@ -4023,7 +4071,7 @@ index 6c75829502336b0806db2531e78186d2c559e44c..a2f8734a41a3a7d6ba489ea65fe8ca18
4023
4071
void defaultAppearanceDidChange(bool useDarkAppearance);
4024
4072
void applyUserAgentOverride(String&);
4025
4073
void applyEmulatedMedia(String&);
4026
- @@ -134,6 +154 ,12 @@ public:
4074
+ @@ -134,6 +155 ,12 @@ public:
4027
4075
void didLayout();
4028
4076
void didScroll();
4029
4077
void didRecalculateStyle();
@@ -4036,15 +4084,15 @@ index 6c75829502336b0806db2531e78186d2c559e44c..a2f8734a41a3a7d6ba489ea65fe8ca18
4036
4084
4037
4085
Frame* frameForId(const String& frameId);
4038
4086
WEBCORE_EXPORT String frameId(Frame*);
4039
- @@ -142,6 +168 ,7 @@ public:
4087
+ @@ -142,6 +169 ,7 @@ public:
4040
4088
4041
4089
private:
4042
4090
double timestamp();
4043
4091
+ void ensureUserWorldsExistInAllFrames(const Vector<DOMWrapperWorld*>&);
4044
4092
4045
4093
static bool mainResourceContent(Frame*, bool withBase64Encode, String* result);
4046
4094
static bool dataContent(const char* data, unsigned size, const String& textEncodingName, bool withBase64Encode, String* result);
4047
- @@ -153,18 +180 ,20 @@ private:
4095
+ @@ -153,18 +181 ,20 @@ private:
4048
4096
RefPtr<Inspector::PageBackendDispatcher> m_backendDispatcher;
4049
4097
4050
4098
Page& m_inspectedPage;
0 commit comments