Skip to content

Commit ae9e2ab

Browse files
author
Simon Pieters
committed
[cssom-view] Specify moveBy moveTo resizeBy resizeTo. https://www.w3.org/Bugs/Public/show_bug.cgi?id=23127
1 parent 1fb7bfb commit ae9e2ab

2 files changed

Lines changed: 142 additions & 2 deletions

File tree

cssom-view/Overview.html

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<h1>CSSOM View Module</h1>
1818

19-
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 27 August 2013</h2>
19+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 3 September 2013</h2>
2020

2121
<dl>
2222

@@ -83,7 +83,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2>
8383
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
8484
index at http://www.w3.org/TR/.</a></em>
8585

86-
<p>This is the 27 August 2013 Editor's Draft of CSSOM View. Please send
86+
<p>This is the 3 September 2013 Editor's Draft of CSSOM View. Please send
8787
comments to
8888
<a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20">www-style@w3.org</a>
8989
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
@@ -501,6 +501,12 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
501501
<a href="#mediaquerylist">MediaQueryList</a> <a href="#dom-window-matchmedia" title="dom-Window-matchMedia">matchMedia</a>(DOMString query);
502502
[SameObject] readonly attribute <a href="#screen">Screen</a> <a href="#dom-window-screen" title="dom-Window-screen">screen</a>;
503503

504+
// browsing context
505+
void <a href="#dom-window-moveto" title="dom-Window-moveTo">moveTo</a>(double x, double y);
506+
void <a href="#dom-window-moveby" title="dom-Window-moveBy">moveBy</a>(double x, double y);
507+
void <a href="#dom-window-resizeto" title="dom-Window-resizeTo">resizeTo</a>(double x, double y);
508+
void <a href="#dom-window-resizeby" title="dom-Window-resizeBy">resizeBy</a>(double x, double y);
509+
504510
// viewport
505511
readonly attribute double <a href="#dom-window-innerwidth" title="dom-Window-innerWidth">innerWidth</a>;
506512
readonly attribute double <a href="#dom-window-innerheight" title="dom-Window-innerHeight">innerHeight</a>;
@@ -537,6 +543,69 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
537543
<p class="note">Accessing <code title="dom-Window-screen"><a href="#dom-window-screen">screen</a></code> through a <code class="external" data-anolis-spec="html"><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#windowproxy">WindowProxy</a></code> object might yield different
538544
results when the <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> is navigated.</p>
539545

546+
<p>The <dfn id="dom-window-moveto" title="dom-Window-moveTo">moveTo</dfn> method must follow these steps:
547+
548+
<ol>
549+
<li><p>Optionally, terminate these steps.
550+
<li><p>Let <var>target</var> be the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> of the <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#context-object">context
551+
object</a>.
552+
<li><p>Let <var>source</var> be the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> of the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#incumbent-script">incumbent script</a>.
553+
<li><p>If <var>source</var> is not <a href="#allowed-to-resize-and-move">allowed to resize and move</a> <var>target</var>, terminate these steps.
554+
<li><p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.
555+
<li><p>Move <var>target</var>'s window such that the window's top left corner is at coordinates (<var>x</var>, <var>y</var>) relative to the top left corner of
556+
the output device, measured in CSS pixels. The positive axes are rightward and downward.
557+
</ol>
558+
559+
<p>The <dfn id="dom-window-moveby" title="dom-Window-moveBy">moveBy</dfn> method must follow these steps:
560+
561+
<ol>
562+
<li><p>Optionally, terminate these steps.
563+
<li><p>Let <var>target</var> be the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> of the <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#context-object">context
564+
object</a>.
565+
<li><p>Let <var>source</var> be the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> of the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#incumbent-script">incumbent script</a>.
566+
<li><p>If <var>source</var> is not <a href="#allowed-to-resize-and-move">allowed to resize and move</a> <var>target</var>, terminate these steps.
567+
<li><p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.
568+
<li><p>Move <var>target</var>'s window <var>x</var> CSS pixels righward and <var>y</var> CSS pixels downward.
569+
</ol>
570+
571+
572+
<p>The <dfn id="dom-window-resizeto" title="dom-Window-resizeTo">resizeTo</dfn> method must follow these steps:
573+
574+
<ol>
575+
<li><p>Optionally, terminate these steps.
576+
<li><p>Let <var>target</var> be the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> of the <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#context-object">context
577+
object</a>.
578+
<li><p>Let <var>source</var> be the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> of the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#incumbent-script">incumbent script</a>.
579+
<li><p>If <var>source</var> is not <a href="#allowed-to-resize-and-move">allowed to resize and move</a> <var>target</var>, terminate these steps.
580+
<li><p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available
581+
space.
582+
<li><p>Resize <var>target</var>'s window by moving its right and bottom edges such that the distance between the left and right edges are <var>x</var> CSS
583+
pixels and the distance between the top and bottom edges are <var>y</var> CSS pixels.
584+
<li><p>Optionally, move <var>target</var>'s window in a user-agent-defined manner so that it does not grow outside the available space.
585+
</ol>
586+
587+
<p>The <dfn id="dom-window-resizeby" title="dom-Window-resizeBy">resizeBy</dfn> method must follow these steps:
588+
589+
<ol>
590+
<li><p>Optionally, terminate these steps.
591+
<li><p>Let <var>target</var> be the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> of the <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#context-object">context
592+
object</a>.
593+
<li><p>Let <var>source</var> be the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> of the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#incumbent-script">incumbent script</a>.
594+
<li><p>If <var>source</var> is not <a href="#allowed-to-resize-and-move">allowed to resize and move</a> <var>target</var>, terminate these steps.
595+
<li><p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available
596+
space.
597+
<li><p>Resize <var>target</var>'s window by moving its right edge <var>x</var> CSS pixels righward and its bottom edge <var>y</var> CSS pixels downward.
598+
<li><p>Optionally, move <var>target</var>'s window in a user-agent-defined manner so that it does not grow outside the available space.
599+
</ol>
600+
601+
<p>A <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> <var>A</var> is <dfn id="allowed-to-resize-and-move">allowed to resize and move</dfn> a <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing
602+
context</a> <var>B</var> if all the following conditions are met:
603+
604+
<ul>
605+
<li><p><var>B</var> is an <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#auxiliary-browsing-context">auxiliary browsing context</a> that was created by a script (as opposed to by an action of the user).
606+
<li><p><var>A</var> is <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#familiar-with">familiar with</a> <var>B</var>.
607+
</ul>
608+
540609
<p>The <dfn id="dom-window-innerwidth" title="dom-Window-innerWidth"><code>innerWidth</code></dfn> attribute must return the <a href="#viewport">viewport</a> width including the size of a rendered
541610
scroll bar (if any), or zero if there is no <a href="#viewport">viewport</a>. <!--fingerprint--></p>
542611
<div class="example">
@@ -1585,6 +1654,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
15851654
Michael Dyck,
15861655
Mike Wilson,
15871656
Morten Stenshorne,
1657+
Olli Pettay,
15881658
Pavel Curtis,
15891659
Peter-Paul Koch,
15901660
Rachel Kmetz,

cssom-view/Overview.src.html

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,12 @@ <h2>Extensions to the <code title>Window</code> Interface</h2>
463463
<span>MediaQueryList</span> <span title=dom-Window-matchMedia>matchMedia</span>(DOMString query);
464464
[SameObject] readonly attribute <span>Screen</span> <span title=dom-Window-screen>screen</span>;
465465

466+
// browsing context
467+
void <span title=dom-Window-moveTo>moveTo</span>(double x, double y);
468+
void <span title=dom-Window-moveBy>moveBy</span>(double x, double y);
469+
void <span title=dom-Window-resizeTo>resizeTo</span>(double x, double y);
470+
void <span title=dom-Window-resizeBy>resizeBy</span>(double x, double y);
471+
466472
// viewport
467473
readonly attribute double <span title=dom-Window-innerWidth>innerWidth</span>;
468474
readonly attribute double <span title=dom-Window-innerHeight>innerHeight</span>;
@@ -499,6 +505,69 @@ <h2>Extensions to the <code title>Window</code> Interface</h2>
499505
<p class='note'>Accessing <code title=dom-Window-screen>screen</code> through a <code data-anolis-spec=html>WindowProxy</code> object might yield different
500506
results when the <code data-anolis-spec=dom>Document</code> is navigated.</p>
501507

508+
<p>The <dfn title=dom-Window-moveTo>moveTo</dfn> method must follow these steps:
509+
510+
<ol>
511+
<li><p>Optionally, terminate these steps.
512+
<li><p>Let <var>target</var> be the <span data-anolis-spec=html>browsing context</span> of the <span data-anolis-spec=dom>context
513+
object</span>.
514+
<li><p>Let <var>source</var> be the <span data-anolis-spec=html>browsing context</span> of the <span data-anolis-spec=html>incumbent script</span>.
515+
<li><p>If <var>source</var> is not <span>allowed to resize and move</span> <var>target</var>, terminate these steps.
516+
<li><p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.
517+
<li><p>Move <var>target</var>'s window such that the window's top left corner is at coordinates (<var>x</var>, <var>y</var>) relative to the top left corner of
518+
the output device, measured in CSS pixels. The positive axes are rightward and downward.
519+
</ol>
520+
521+
<p>The <dfn title=dom-Window-moveBy>moveBy</dfn> method must follow these steps:
522+
523+
<ol>
524+
<li><p>Optionally, terminate these steps.
525+
<li><p>Let <var>target</var> be the <span data-anolis-spec=html>browsing context</span> of the <span data-anolis-spec=dom>context
526+
object</span>.
527+
<li><p>Let <var>source</var> be the <span data-anolis-spec=html>browsing context</span> of the <span data-anolis-spec=html>incumbent script</span>.
528+
<li><p>If <var>source</var> is not <span>allowed to resize and move</span> <var>target</var>, terminate these steps.
529+
<li><p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.
530+
<li><p>Move <var>target</var>'s window <var>x</var> CSS pixels righward and <var>y</var> CSS pixels downward.
531+
</ol>
532+
533+
534+
<p>The <dfn title=dom-Window-resizeTo>resizeTo</dfn> method must follow these steps:
535+
536+
<ol>
537+
<li><p>Optionally, terminate these steps.
538+
<li><p>Let <var>target</var> be the <span data-anolis-spec=html>browsing context</span> of the <span data-anolis-spec=dom>context
539+
object</span>.
540+
<li><p>Let <var>source</var> be the <span data-anolis-spec=html>browsing context</span> of the <span data-anolis-spec=html>incumbent script</span>.
541+
<li><p>If <var>source</var> is not <span>allowed to resize and move</span> <var>target</var>, terminate these steps.
542+
<li><p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available
543+
space.
544+
<li><p>Resize <var>target</var>'s window by moving its right and bottom edges such that the distance between the left and right edges are <var>x</var> CSS
545+
pixels and the distance between the top and bottom edges are <var>y</var> CSS pixels.
546+
<li><p>Optionally, move <var>target</var>'s window in a user-agent-defined manner so that it does not grow outside the available space.
547+
</ol>
548+
549+
<p>The <dfn title=dom-Window-resizeBy>resizeBy</dfn> method must follow these steps:
550+
551+
<ol>
552+
<li><p>Optionally, terminate these steps.
553+
<li><p>Let <var>target</var> be the <span data-anolis-spec=html>browsing context</span> of the <span data-anolis-spec=dom>context
554+
object</span>.
555+
<li><p>Let <var>source</var> be the <span data-anolis-spec=html>browsing context</span> of the <span data-anolis-spec=html>incumbent script</span>.
556+
<li><p>If <var>source</var> is not <span>allowed to resize and move</span> <var>target</var>, terminate these steps.
557+
<li><p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available
558+
space.
559+
<li><p>Resize <var>target</var>'s window by moving its right edge <var>x</var> CSS pixels righward and its bottom edge <var>y</var> CSS pixels downward.
560+
<li><p>Optionally, move <var>target</var>'s window in a user-agent-defined manner so that it does not grow outside the available space.
561+
</ol>
562+
563+
<p>A <span data-anolis-spec=html>browsing context</span> <var>A</var> is <dfn>allowed to resize and move</dfn> a <span data-anolis-spec=html>browsing
564+
context</span> <var>B</var> if all the following conditions are met:
565+
566+
<ul>
567+
<li><p><var>B</var> is an <span data-anolis-spec=html>auxiliary browsing context</span> that was created by a script (as opposed to by an action of the user).
568+
<li><p><var>A</var> is <span data-anolis-spec=html>familiar with</span> <var>B</var>.
569+
</ul>
570+
502571
<p>The <dfn title=dom-Window-innerWidth><code>innerWidth</code></dfn> attribute must return the <span>viewport</span> width including the size of a rendered
503572
scroll bar (if any), or zero if there is no <span>viewport</span>. <!--fingerprint--></p>
504573
<div class='example'>
@@ -1527,6 +1596,7 @@ <h2 class="no-num">Acknowledgments</h2>
15271596
Michael Dyck,
15281597
Mike Wilson,
15291598
Morten Stenshorne,
1599+
Olli Pettay,
15301600
Pavel Curtis,
15311601
Peter-Paul Koch,
15321602
Rachel Kmetz,

0 commit comments

Comments
 (0)