@@ -4044,25 +4044,23 @@ <h4><dfn>Set Window Rect</dfn></h4>
40444044< ol >
40454045 < li > < p > Let < var > width</ var > be the result of
40464046 < a > getting a property</ a > named "< code > width</ code > "
4047- from < var > parameters</ var > , else let it be < a > < code > null </ code > </ a > .
4047+ from < var > parameters</ var > </ a > .
40484048
40494049 < li > < p > Let < var > height</ var > be the result of
40504050 < a > getting a property</ a > named "< code > height</ code > "
4051- from < var > parameters</ var > , else let it be < a > < code > null </ code > </ a > .
4051+ from < var > parameters</ var > .
40524052
40534053 < li > < p > Let < var > x</ var > be the result of < a > getting a property</ a >
4054- named "< code > x</ code > " from < var > parameters</ var > ,
4055- else let it be < a > < code > null</ code > </ a > .
4054+ named "< code > x</ code > " from < var > parameters</ var > .
40564055
40574056 < li > < p > Let < var > y</ var > be the result of < a > getting a property</ a >
4058- named "< code > y</ code > " from < var > parameters</ var > ,
4059- else let it be < a > < code > null</ code > </ a > .
4057+ named "< code > y</ code > " from < var > parameters</ var > .
40604058
4061- < li > < p > If < var > width</ var > or < var > height</ var > is neither < a > < code > null </ code > </ a >
4059+ < li > < p > If < var > width</ var > or < var > height</ var > is neither < a > undefined </ a >
40624060 nor a < a > Number</ a > from 0 to 2< sup > 31</ sup > − 1,
40634061 return < a > error</ a > with < a > error code</ a > < a > invalid argument</ a > .
40644062
4065- < li > < p > If < var > x</ var > or < var > y</ var > is neither < a > < code > null </ code > </ a >
4063+ < li > < p > If < var > x</ var > or < var > y</ var > is neither < a > undefined </ a >
40664064 nor a < a > Number</ a > from −(2< sup > 31</ sup > ) to 2< sup > 31</ sup > − 1,
40674065 return < a > error</ a > with < a > error code</ a > < a > invalid argument</ a > .
40684066
@@ -4071,6 +4069,11 @@ <h4><dfn>Set Window Rect</dfn></h4>
40714069 < var > session</ var > 's < a > current top-level browsing context</ a > for any reason,
40724070 return < a > error</ a > with < a > error code</ a > < a > unsupported operation</ a > .
40734071
4072+ < p class ="note "> In case the < a > Set Window Rect</ a > command is
4073+ partially supported (i.e. some combinations of arguments are
4074+ supported but not others), the implmentation is expected to continue
4075+ with the remaining steps.
4076+
40744077 < li > < p > If < var > session</ var > 's < a > current top-level browsing
40754078 context</ a > is < a > no longer open</ a > , return < a > error</ a >
40764079 with < a > error code</ a > < a > no such window</ a > .
@@ -4082,21 +4085,25 @@ <h4><dfn>Set Window Rect</dfn></h4>
40824085
40834086 < li > < p > < a > Restore the window</ a > .
40844087
4085- < li > < p > If < var > width</ var > and < var > height</ var > are not < a > < code > null</ code > </ a > :
4088+ < li > < p > Let < var > window</ var > be the operating system window containing
4089+ < var > session</ var > 's < a > current top-level browsing context</ a >
4090+
4091+ < li > < p > If the implementation is able to set the dimensions
4092+ of < var > window</ var > :
40864093
40874094 < ol >
4088- < li > < p > Set the width, in < a > CSS pixels</ a > ,
4089- of the operating system window containing
4090- < var > session</ var > 's < a > current top-level browsing context</ a > ,
4091- including any < a > browser chrome</ a > and externally drawn window decorations
4095+ < li > < p > If < var > width</ var > is not < a > undefined</ a > , set the width,
4096+ in < a > CSS pixels</ a > , of < var > window</ var > , including
4097+ any < a > browser chrome</ a > and externally drawn window decorations,
40924098 to a value that is as close as possible to < var > width</ var > .
40934099
4094- < li > < p > Set the height, in < a > CSS pixels</ a > ,
4095- of the operating system window containing
4096- < var > session</ var > 's < a > current top-level browsing context</ a > ,
4097- including any < a > browser chrome</ a > and externally drawn window decorations
4100+ < li > < p > If < var > height</ var > is not < a > undefined</ a > , set the height,
4101+ in < a > CSS pixels</ a > , of < var > window</ var > , including
4102+ any < a > browser chrome</ a > and externally drawn window decorations,
40984103 to a value that is as close as possible to < var > height</ var > .
40994104
4105+ </ ol >
4106+
41004107 < aside class =note >
41014108 < p > The specification does not guarantee
41024109 that the resulting window size will exactly match that which was requested.
@@ -4116,35 +4123,37 @@ <h4><dfn>Set Window Rect</dfn></h4>
41164123 of < a > outerHeight</ a > should be as close as possible
41174124 to < var > height</ var > .
41184125 </ aside >
4119- </ ol >
41204126
4121- < li > < p > If < var > x </ var > and < var > y </ var > are not < a > < code > null </ code > </ a > :
4127+ < li > < p > If the implementation is able to set the position of < var > window </ var > :
41224128
41234129 < ol >
4124- < li > < p > Run the implementation-specific steps to set the position of
4125- the operating system level window
4126- containing < var > session</ var > 's < a > current top-level browsing
4127- context</ a > to the position given by the < var > x</ var >
4128- and < var > y</ var > coordinates.
4129-
4130- < aside class =note >
4131- < p > Note that this step is similar to calling the < a > moveTo(x,
4132- y)</ a > method on the < a > < code > WindowProxy</ code > </ a > object
4133- associated with < var > session</ var > 's < a > current top-level browsing
4134- context</ a > , but without the
4135- < a href =https://developer.mozilla.org/en-US/docs/Web/API/Window/moveTo > security
4136- restrictions</ a > that you
4137-
4138- < ol type =a >
4139- < li > cannot move a window or tab
4140- that was not created by < code > window.open</ code > .
4141-
4142- < li > cannot move a window or tab
4143- when it is in a window with more than one tab.
4144- </ ol >
4145- </ aside >
4130+ < li > < p > If < var > x</ var > is not < a > undefined</ a > , run specific
4131+ steps set the x-coordinate of the left edge of < var > window</ var >
4132+ to a value that is as close as possible to < var > x</ var > .
4133+
4134+ < li > < p > If < var > y</ var > is not < a > undefined</ a > , run specific
4135+ steps set the y-coordinate of the top edge of < var > window</ var > to
4136+ a value that is as close as possible to < var > y</ var > .
41464137 </ ol >
41474138
4139+ < aside class =note >
4140+ < p > The specification does not guarantee
4141+ that the resulting window position will match that which was requested.
4142+
4143+ < p > This step is similar to calling the < a > moveTo(x,
4144+ y)</ a > method on the < a > < code > WindowProxy</ code > </ a > object
4145+ associated with < var > session</ var > 's < a > current top-level browsing
4146+ context</ a > , but without the
4147+ < a href =https://developer.mozilla.org/en-US/docs/Web/API/Window/moveTo > security
4148+ restrictions</ a > that you
4149+
4150+ < ol type =a >
4151+ < li > cannot move a window or tab that was not created by < code > window.open</ code > .
4152+
4153+ < li > cannot move a window or tab when it is in a window with more than one tab.
4154+ </ ol >
4155+ </ aside >
4156+
41484157 < li > < p > Return < a > success</ a > with data set to the < a > WindowRect
41494158 object</ a > for the < var > session</ var > 's < a > current top-level browsing
41504159 context</ a > .
0 commit comments