diff --git a/index.bs b/index.bs index 7d37d2e8..aeaa1c1f 100644 --- a/index.bs +++ b/index.bs @@ -285,6 +285,7 @@ spec: CSSOM-VIEW; urlPrefix: https://drafts.csswg.org/cssom-view/ text: visual viewport page left; url: #dom-visualviewport-pageleft text: visual viewport page top; url: #dom-visualviewport-pagetop text: visual viewport; url: #visual-viewport + text: web-exposed available screen area; url: #web-exposed-available-screen-area text: web-exposed screen area; url: #web-exposed-screen-area spec: DOM; urlPrefix: https://dom.spec.whatwg.org/ type: dfn @@ -3210,6 +3211,18 @@ A [=remote end=] has a viewport overrides map which is a weak map bet A [=remote end=] has a locale overrides map which is a weak map between [=navigables=] or [=user contexts=] and string. +A screen settings is a [=struct=] with an [=struct/item=] named +height which is an integer, +an [=struct/item=] named width which is an integer, +an [=struct/item=] named x which is an integer, +an [=struct/item=] named y which is an integer. + +A [=remote end=] has a screen settings overrides which is a [=struct=] with +an [=struct/item=] named user context screen settings, +which is a weak map between [=user contexts=] and [=screen settings=], +and an [=struct/item=] named navigable screen settings, +which is a weak map between [=navigables=] and [=screen settings=]. + A [=remote end=] has a timezone overrides map which is a weak map between [=navigables=] or [=user contexts=] and string. @@ -6445,6 +6458,136 @@ The [=remote end steps=] with |command parameters| and |session| are: +#### The emulation.setScreenSettingsOverride Command #### {#command-emulation-setScreenSettingsOverride} + +The emulation.setScreenSettingsOverride command +emulates [=web-exposed screen area=] and [=web-exposed available screen area=] of the given top-level traversables or user contexts. + +
+ emulation.SetScreenSettingsOverride = (
+ method: "emulation.setScreenSettingsOverride",
+ params: emulation.SetScreenSettingsOverrideParameters
+ )
+
+ emulation.ScreenArea = {
+ width: js-uint,
+ height: js-uint
+ }
+
+ emulation.SetScreenSettingsOverrideParameters = {
+ screenArea: emulation.ScreenArea / null,
+ ? contexts: [+browsingContext.BrowsingContext],
+ ? userContexts: [+browser.UserContext],
+ }
+
+ + emulation.SetScreenSettingsOverrideResult = EmptyResult ++
userContexts"
+ and |command parameters| [=map/contains=] "contexts",
+ return [=error=] with [=error code=] [=invalid argument=].
+
+1. If |command parameters| doesn't [=map/contain=] "userContexts"
+ and |command parameters| doesn't [=map/contain=] "contexts",
+ return [=error=] with [=error code=] [=invalid argument=].
+
+1. Let |emulated screen area| be |command parameters|["screenArea"].
+
+1. If |emulated screen area| is not null:
+
+ 1. [=map/Set=] |emulated screen area|["x"] to 0.
+
+ 1. [=map/Set=] |emulated screen area|["y"] to 0.
+
+1. Let |navigables| be a [=/set=].
+
+1. If the contexts field of |command parameters| is present:
+
+ 1. Let |navigables| be the result of [=trying=] to
+ [=get valid top-level traversables by ids=] with
+ |command parameters|["contexts"].
+
+ 1. Let |target| be [=screen settings overrides/navigable screen settings=].
+
+ 1. For each |navigable| of |navigables|:
+
+ 1. If |emulated screen area| is null, [=map/remove=] |navigable|
+ from |target|.
+
+ 1. Otherwise, [=map/set=] |target|[|navigable|]
+ to |emulated screen area|.
+
+ 1. Return [=success=] with data null.
+
+1. Otherwise:
+
+ 1. Assert the userContexts field of |command parameters| is present.
+
+ 1. Let |user contexts| be the result of [=trying=] to [=get valid user contexts=]
+ with |command parameters|["userContexts"].
+
+ 1. Let |target| be [=screen settings overrides/user context screen settings=].
+
+ 1. For each |user context| of |user contexts|:
+
+ 1. If |emulated screen area| is null, [=map/remove=] |user context| from
+ |target|.
+
+ 1. Otherwise, [=map/set=] |target|[|user context|] to |emulated screen area|.
+
+ 1. Return [=success=] with data null.
+
+