@@ -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..4b25429daecf6743e2a52966e64a23e0257d505a 100644
839
+ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4818c82fff8b19e060e129275ef5f95f1db2fcb0 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..4b25429daecf6743e2a52966e64a23e0
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,78 @@
928
+ @@ -282,19 +341,85 @@
929
929
"returns": [
930
930
{ "name": "data", "type": "string", "description": "Base64-encoded web archive." }
931
931
]
@@ -985,6 +985,13 @@ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4b25429daecf6743e2a52966e64a23e0
985
985
+ "parameters": [
986
986
+ { "name": "width", "type": "integer" },
987
987
+ { "name": "height", "type": "integer" }
988
+ + ]
989
+ + },
990
+ + {
991
+ + "name": "setOrientationOverride",
992
+ + "description": "Overrides window.orientation with provided value.",
993
+ + "parameters": [
994
+ + { "name": "angle", "type": "integer", "optional": true }
988
995
+ ]
989
996
}
990
997
],
@@ -1006,7 +1013,7 @@ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4b25429daecf6743e2a52966e64a23e0
1006
1013
]
1007
1014
},
1008
1015
{
1009
- @@ -304,6 +422 ,14 @@
1016
+ @@ -304,6 +429 ,14 @@
1010
1017
{ "name": "frame", "$ref": "Frame", "description": "Frame object." }
1011
1018
]
1012
1019
},
@@ -1021,7 +1028,7 @@ index 78980810141a9e9b65b93e6cebe80daff9a52dc1..4b25429daecf6743e2a52966e64a23e0
1021
1028
{
1022
1029
"name": "frameDetached",
1023
1030
"description": "Fired when frame has been detached from its parent.",
1024
- @@ -340,12 +466 ,50 @@
1031
+ @@ -340,12 +473 ,50 @@
1025
1032
{ "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." }
1026
1033
]
1027
1034
},
@@ -3052,7 +3059,7 @@ index b038a1879c043aa17dae97425693f29be42e3258..d60716b837663004675ffd90bceede4c
3052
3059
3053
3060
} // namespace WebCore
3054
3061
diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
3055
- index 0e2e3c2bcc2fe167c246a5f55c4de3b52282a516..2e7900ccbb92566b4c5e33e0e7ec7c0c8e440832 100644
3062
+ index 0e2e3c2bcc2fe167c246a5f55c4de3b52282a516..848df344e9a3b4b00883db8010be0de39844f3cc 100644
3056
3063
--- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
3057
3064
+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
3058
3065
@@ -32,6 +32,8 @@
@@ -3375,7 +3382,7 @@ index 0e2e3c2bcc2fe167c246a5f55c4de3b52282a516..2e7900ccbb92566b4c5e33e0e7ec7c0c
3375
3382
void InspectorPageAgent::archive(ErrorString& errorString, String* data)
3376
3383
{
3377
3384
#if ENABLE(WEB_ARCHIVE) && USE(CF)
3378
- @@ -1047,4 +1167,531 @@ void InspectorPageAgent::archive(ErrorString& errorString, String* data)
3385
+ @@ -1047,4 +1167,538 @@ void InspectorPageAgent::archive(ErrorString& errorString, String* data)
3379
3386
#endif
3380
3387
}
3381
3388
@@ -3905,10 +3912,17 @@ index 0e2e3c2bcc2fe167c246a5f55c4de3b52282a516..2e7900ccbb92566b4c5e33e0e7ec7c0c
3905
3912
+ m_inspectedPage.setOverrideScreenSize(size);
3906
3913
+}
3907
3914
+
3915
+ +void InspectorPageAgent::setOrientationOverride(Inspector::ErrorString&, const int* angle)
3916
+ +{
3917
+ + Optional<int> orientation;
3918
+ + if (angle)
3919
+ + orientation = *angle;
3920
+ + m_inspectedPage.setOverrideOrientation(orientation);
3921
+ +}
3908
3922
+
3909
3923
} // namespace WebCore
3910
3924
diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h
3911
- index 6c75829502336b0806db2531e78186d2c559e44c..b2965f34e7ec1297b855ce0304adc2481baf2dc7 100644
3925
+ index 6c75829502336b0806db2531e78186d2c559e44c..7b3c952fb5c8e60620d605bd2b9b4989554ae91c 100644
3912
3926
--- a/Source/WebCore/inspector/agents/InspectorPageAgent.h
3913
3927
+++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h
3914
3928
@@ -40,11 +40,16 @@
@@ -3939,7 +3953,7 @@ index 6c75829502336b0806db2531e78186d2c559e44c..b2965f34e7ec1297b855ce0304adc248
3939
3953
void overrideUserAgent(ErrorString&, const String* value) override;
3940
3954
void overrideSetting(ErrorString&, const String& setting, const bool* value) override;
3941
3955
void getCookies(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::Cookie>>& cookies) override;
3942
- @@ -112,20 +119,30 @@ public:
3956
+ @@ -112,20 +119,31 @@ public:
3943
3957
void setShowPaintRects(ErrorString&, bool show) override;
3944
3958
void setEmulatedMedia(ErrorString&, const String&) override;
3945
3959
void setForcedAppearance(ErrorString&, const String&) override;
@@ -3957,6 +3971,7 @@ index 6c75829502336b0806db2531e78186d2c559e44c..b2965f34e7ec1297b855ce0304adc248
3957
3971
+ void setBypassCSP(ErrorString&, bool) override;
3958
3972
+ void crash(ErrorString&) override;
3959
3973
+ void setScreenSizeOverride(ErrorString&, int width, int height) override;
3974
+ + void setOrientationOverride(Inspector::ErrorString&, const int* angle) override;
3960
3975
3961
3976
// InspectorInstrumentation
3962
3977
- void domContentEventFired();
@@ -3974,7 +3989,7 @@ index 6c75829502336b0806db2531e78186d2c559e44c..b2965f34e7ec1297b855ce0304adc248
3974
3989
void defaultAppearanceDidChange(bool useDarkAppearance);
3975
3990
void applyUserAgentOverride(String&);
3976
3991
void applyEmulatedMedia(String&);
3977
- @@ -134,6 +151 ,12 @@ public:
3992
+ @@ -134,6 +152 ,12 @@ public:
3978
3993
void didLayout();
3979
3994
void didScroll();
3980
3995
void didRecalculateStyle();
@@ -3987,15 +4002,15 @@ index 6c75829502336b0806db2531e78186d2c559e44c..b2965f34e7ec1297b855ce0304adc248
3987
4002
3988
4003
Frame* frameForId(const String& frameId);
3989
4004
WEBCORE_EXPORT String frameId(Frame*);
3990
- @@ -142,6 +165 ,7 @@ public:
4005
+ @@ -142,6 +166 ,7 @@ public:
3991
4006
3992
4007
private:
3993
4008
double timestamp();
3994
4009
+ void ensureUserWorldsExistInAllFrames(const Vector<DOMWrapperWorld*>&);
3995
4010
3996
4011
static bool mainResourceContent(Frame*, bool withBase64Encode, String* result);
3997
4012
static bool dataContent(const char* data, unsigned size, const String& textEncodingName, bool withBase64Encode, String* result);
3998
- @@ -153,18 +177 ,20 @@ private:
4013
+ @@ -153,18 +178 ,20 @@ private:
3999
4014
RefPtr<Inspector::PageBackendDispatcher> m_backendDispatcher;
4000
4015
4001
4016
Page& m_inspectedPage;
@@ -4512,7 +4527,7 @@ index adb15dbb4c53f8d1c4957a646eff30fe8c9cc659..a596843b0779b912688c2c029cc073e6
4512
4527
Timer m_cursorUpdateTimer;
4513
4528
4514
4529
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
4515
- index e6271d7e86023bce03193752805f21ee96d235fa..675ed534b6a692cd34563cac00a4e5e3d431d245 100644
4530
+ index e6271d7e86023bce03193752805f21ee96d235fa..37841e631f6837bb49dc82cc4213598cb2a862c2 100644
4516
4531
--- a/Source/WebCore/page/Frame.cpp
4517
4532
+++ b/Source/WebCore/page/Frame.cpp
4518
4533
@@ -184,6 +184,7 @@ Frame::Frame(Page& page, HTMLFrameOwnerElement* ownerElement, UniqueRef<FrameLoa
@@ -4523,6 +4538,15 @@ index e6271d7e86023bce03193752805f21ee96d235fa..675ed534b6a692cd34563cac00a4e5e3
4523
4538
}
4524
4539
4525
4540
Ref<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, UniqueRef<FrameLoaderClient>&& client)
4541
+ @@ -322,7 +323,7 @@ void Frame::orientationChanged()
4542
+ int Frame::orientation() const
4543
+ {
4544
+ if (m_page)
4545
+ - return m_page->chrome().client().deviceOrientation();
4546
+ + return m_page->orientation();
4547
+ return 0;
4548
+ }
4549
+ #endif // ENABLE(ORIENTATION_EVENTS)
4526
4550
diff --git a/Source/WebCore/page/FrameSnapshotting.cpp b/Source/WebCore/page/FrameSnapshotting.cpp
4527
4551
index 73587787f88a6ad4e4baffb0beb0b87e7782916f..88492f501e6ec9e38455dbe6fd27537bf0ee6970 100644
4528
4552
--- a/Source/WebCore/page/FrameSnapshotting.cpp
@@ -4578,7 +4602,7 @@ index 9c58b06f4c471130ce4815f11d14cb78f81b49a0..3d624733c36f09518b12095d91e67a2a
4578
4602
if (stateObjectType == StateObjectType::Push) {
4579
4603
frame->loader().history().pushState(WTFMove(data), title, fullURL.string());
4580
4604
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
4581
- index 232fd43079726422402ae646c4fa803eb5604568..21224e5e132b1f78c40d225db24426507b4b2819 100644
4605
+ index 232fd43079726422402ae646c4fa803eb5604568..2d06753c2c85c245e6a3a38385ca2efdd1f6097f 100644
4582
4606
--- a/Source/WebCore/page/Page.cpp
4583
4607
+++ b/Source/WebCore/page/Page.cpp
4584
4608
@@ -87,6 +87,7 @@
@@ -4589,7 +4613,7 @@ index 232fd43079726422402ae646c4fa803eb5604568..21224e5e132b1f78c40d225db2442650
4589
4613
#include "PlatformStrategies.h"
4590
4614
#include "PlugInClient.h"
4591
4615
#include "PluginData.h"
4592
- @@ -428,6 +429,21 @@ void Page::setOverrideViewportArguments(const Optional<ViewportArguments>& viewp
4616
+ @@ -428,6 +429,37 @@ void Page::setOverrideViewportArguments(const Optional<ViewportArguments>& viewp
4593
4617
document->updateViewportArguments();
4594
4618
}
4595
4619
@@ -4607,29 +4631,61 @@ index 232fd43079726422402ae646c4fa803eb5604568..21224e5e132b1f78c40d225db2442650
4607
4631
+ if (auto* document = mainFrame().document())
4608
4632
+ document->updateViewportArguments();
4609
4633
+}
4634
+ +
4635
+ +#if ENABLE(ORIENTATION_EVENTS)
4636
+ +int Page::orientation() const
4637
+ +{
4638
+ + return m_overrideOrientation.valueOr(chrome().client().deviceOrientation());
4639
+ +}
4640
+ +
4641
+ +void Page::setOverrideOrientation(Optional<int> orientation)
4642
+ +{
4643
+ + if (orientation == m_overrideOrientation)
4644
+ + return;
4645
+ +
4646
+ + m_overrideOrientation = orientation;
4647
+ + mainFrame().orientationChanged();
4648
+ +}
4649
+ +#endif
4610
4650
+
4611
4651
ScrollingCoordinator* Page::scrollingCoordinator()
4612
4652
{
4613
4653
if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) {
4614
4654
diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h
4615
- index 0c2244aa22e4742b1b57b9f47d1649519735226d..a51827796ee3272188617cefff1d426dd3fd9131 100644
4655
+ index 0c2244aa22e4742b1b57b9f47d1649519735226d..5f090a00532862204dd1bb203965424807e292af 100644
4616
4656
--- a/Source/WebCore/page/Page.h
4617
4657
+++ b/Source/WebCore/page/Page.h
4618
4658
@@ -187,6 +187,9 @@ public:
4619
4659
const Optional<ViewportArguments>& overrideViewportArguments() const { return m_overrideViewportArguments; }
4620
4660
WEBCORE_EXPORT void setOverrideViewportArguments(const Optional<ViewportArguments>&);
4621
4661
4622
4662
+ WEBCORE_EXPORT FloatSize screenSize();
4623
- + WEBCORE_EXPORT void setOverrideScreenSize(Optional<FloatSize> size);
4663
+ + void setOverrideScreenSize(Optional<FloatSize> size);
4624
4664
+
4625
4665
static void refreshPlugins(bool reload);
4626
4666
WEBCORE_EXPORT PluginData& pluginData();
4627
4667
void clearPluginData();
4628
- @@ -1010,6 +1013,7 @@ private:
4668
+ @@ -720,6 +723,11 @@ public:
4669
+
4670
+ WEBCORE_EXPORT Vector<Ref<Element>> editableElementsInRect(const FloatRect&) const;
4671
+
4672
+ +#if ENABLE(ORIENTATION_EVENTS)
4673
+ + int orientation() const;
4674
+ + void setOverrideOrientation(Optional<int>);
4675
+ +#endif
4676
+ +
4677
+ #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY)
4678
+ DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); }
4679
+ #endif
4680
+ @@ -1010,6 +1018,11 @@ private:
4629
4681
#endif
4630
4682
4631
4683
Optional<ViewportArguments> m_overrideViewportArguments;
4632
4684
+ Optional<FloatSize> m_overrideScreenSize;
4685
+ +
4686
+ +#if ENABLE(ORIENTATION_EVENTS)
4687
+ + Optional<int> m_overrideOrientation;
4688
+ +#endif
4633
4689
4634
4690
#if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY)
4635
4691
RefPtr<DeviceOrientationUpdateProvider> m_deviceOrientationUpdateProvider;
@@ -12736,7 +12792,7 @@ index 22f644fd7f450d32ea45f97e27488ef5f34c153a..9ac93959568cb4561c039cc0ce7b28c4
12736
12792
};
12737
12793
12738
12794
diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
12739
- index 543de23da89e1b74dba97aa1a3953f2cf69a4d1c..1f3483bd5d466b7a776efa5b5e1e0d3675ad5638 100644
12795
+ index 543de23da89e1b74dba97aa1a3953f2cf69a4d1c..25029c335bd13396b1bc6e14fbc4e6fbc9009fb3 100644
12740
12796
--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
12741
12797
+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
12742
12798
@@ -409,6 +409,8 @@ void WebChromeClient::setResizable(bool resizable)
@@ -12748,6 +12804,20 @@ index 543de23da89e1b74dba97aa1a3953f2cf69a4d1c..1f3483bd5d466b7a776efa5b5e1e0d36
12748
12804
// Notify the bundle client.
12749
12805
m_page.injectedBundleUIClient().willAddMessageToConsole(&m_page, source, level, message, lineNumber, columnNumber, sourceID);
12750
12806
}
12807
+ @@ -807,6 +809,13 @@ bool WebChromeClient::canShowDataListSuggestionLabels() const
12808
+
12809
+ #endif
12810
+
12811
+ +#if ENABLE(ORIENTATION_EVENTS) && !PLATFORM(IOS_FAMILY)
12812
+ +int WebChromeClient::deviceOrientation() const {
12813
+ + // Only overrides are supported for non-iOS platforms.
12814
+ + return 0;
12815
+ +}
12816
+ +#endif
12817
+ +
12818
+ void WebChromeClient::runOpenPanel(Frame& frame, FileChooser& fileChooser)
12819
+ {
12820
+ if (m_page.activeOpenPanelResultListener())
12751
12821
diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
12752
12822
index ef1c8cdbbad2ef5ada3212c851c62a149f9fea0e..142e2ffdc95646eea469c3a51e3c329be10bd57c 100644
12753
12823
--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
0 commit comments