Skip to content

Commit dc8c13b

Browse files
author
Simon Pieters
committed
[cssom-view] Specify window.open()'s features argument. http://lists.w3.org/Archives/Public/www-style/2013Sep/0192.html
1 parent 3435292 commit dc8c13b

2 files changed

Lines changed: 165 additions & 12 deletions

File tree

cssom-view/Overview.html

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ <h2 class="no-num no-toc" id="toc">Table of Contents</h2>
123123
<li><a href="#scrolling"><span class="secno">4.1 </span>Scrolling</a></ul></li>
124124
<li><a href="#extensions-to-the-window-interface"><span class="secno">5 </span>Extensions to the <code title="">Window</code> Interface</a>
125125
<ul class="toc">
126-
<li><a href="#the-mediaquerylist-interface"><span class="secno">5.1 </span>The <code title="">MediaQueryList</code> Interface</a></li>
127-
<li><a href="#the-screen-interface"><span class="secno">5.2 </span>The <code title="">Screen</code> Interface</a></ul></li>
126+
<li><a href="#the-features-argument-to-the-open()-method"><span class="secno">5.1 </span>The <var>features</var> argument to the <code title="">open()</code> method</a></li>
127+
<li><a href="#the-mediaquerylist-interface"><span class="secno">5.2 </span>The <code title="">MediaQueryList</code> Interface</a></li>
128+
<li><a href="#the-screen-interface"><span class="secno">5.3 </span>The <code title="">Screen</code> Interface</a></ul></li>
128129
<li><a href="#extensions-to-the-document-interface"><span class="secno">6 </span>Extensions to the <code title="">Document</code> Interface</a>
129130
<ul class="toc">
130131
<li><a href="#the-caretposition-interface"><span class="secno">6.1 </span>The <code title="">CaretPosition</code> Interface</a></ul></li>
@@ -543,7 +544,7 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
543544
<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
544545
results when the <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> is navigated.</p>
545546

546-
<p>The <dfn id="dom-window-moveto" title="dom-Window-moveTo">moveTo</dfn> method must follow these steps:
547+
<p>The <dfn id="dom-window-moveto" title="dom-Window-moveTo">moveTo(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
547548

548549
<ol>
549550
<li><p>Optionally, terminate these steps.
@@ -556,7 +557,7 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
556557
the output device, measured in CSS pixels of <var>target</var>. The positive axes are rightward and downward.
557558
</ol>
558559

559-
<p>The <dfn id="dom-window-moveby" title="dom-Window-moveBy">moveBy</dfn> method must follow these steps:
560+
<p>The <dfn id="dom-window-moveby" title="dom-Window-moveBy">moveBy(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
560561

561562
<ol>
562563
<li><p>Optionally, terminate these steps.
@@ -569,7 +570,7 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
569570
</ol>
570571

571572

572-
<p>The <dfn id="dom-window-resizeto" title="dom-Window-resizeTo">resizeTo</dfn> method must follow these steps:
573+
<p>The <dfn id="dom-window-resizeto" title="dom-Window-resizeTo">resizeTo(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
573574

574575
<ol>
575576
<li><p>Optionally, terminate these steps.
@@ -585,7 +586,7 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
585586
<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.
586587
</ol>
587588

588-
<p>The <dfn id="dom-window-resizeby" title="dom-Window-resizeBy">resizeBy</dfn> method must follow these steps:
589+
<p>The <dfn id="dom-window-resizeby" title="dom-Window-resizeBy">resizeBy(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
589590

590591
<ol>
591592
<li><p>Optionally, terminate these steps.
@@ -701,7 +702,83 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
701702
attribute must return zero. <!--fingerprint--></p>
702703

703704

704-
<h3 id="the-mediaquerylist-interface"><span class="secno">5.1 </span>The <code title="">MediaQueryList</code> Interface</h3>
705+
<h4 id="the-features-argument-to-the-open()-method"><span class="secno">5.1 </span>The <var>features</var> argument to the <code title="">open()</code> method</h4>
706+
707+
<p>HTML defines the <code class="external" data-anolis-spec="html" title="dom-open"><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#dom-open">open()</a></code> method but has no defined effect for the third argument, <var>features</var>.
708+
<a href="#refsHTML">[HTML]</a>
709+
710+
<p>This specification defines the effect of the <var>features</var> argument for user agents that do not opt to ignore it, as follows:
711+
712+
<ol>
713+
<li><p>If the method does not result in a new <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> being created, terminate these steps.
714+
<li><p>Let <var>target</var> be the new <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>.
715+
<li><p>Let <var>tokens</var> be the result of <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#split-a-string-on-commas" title="split a string on commas">splitting <var>features</var> on commas</a>.
716+
<li><p>Let <var>parsed features</var> be a new empty dictionary.
717+
<li><p><i>Token loop</i>: For each token <var>token</var> in <var>tokens</var>, follow these substeps:
718+
<ol>
719+
<li><p>Let <var>input</var> be <var>token</var>.
720+
<li><p>Let <var>position</var> point at the first character of <var>input</var>.
721+
<li><p><a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#skip-whitespace">Skip whitespace</a>.
722+
<li><p><a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#collect-a-sequence-of-characters">Collect a sequence of characters</a> that are not <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#space-character" title="space character">space
723+
characters</a> nor "<code title="">=</code>" (U+003D). Let <var>name</var> be the collected characters.
724+
<li><p>If <var>name</var> is in <var>parsed features</var> or if <var>name</var> is not a <a href="#supported-open()-feature-name">supported <code title="">open()</code> feature name</a>,
725+
continue <i>token loop</i>.
726+
<li><p><a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#skip-whitespace">Skip whitespace</a>.
727+
<li><p>If the character at <var>position</var> is not "<code title="">=</code>" (U+003D), continue <i>token loop</i>.
728+
<li><p>Advance <var>position</var> by one.
729+
<li><p>If <var>position</var> is past the end of <var>input</var>, continue <i>token loop</i>.
730+
<li><p><a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#collect-a-sequence-of-characters">Collect a sequence of characters</a> that are any characters. Let <var>raw value</var> be the collected characters.
731+
<li><p>Let <var>value</var> be the result of invoking the <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#rules-for-parsing-integers">rules for parsing integers</a> on <var>raw value</var>.
732+
<li><p>If <var>value</var> is an error, continue <i>token loop</i>.
733+
<li><p>Set <var>name</var> in <var>parsed features</var> to <var>value</var>.
734+
</ol>
735+
<li><p>If <code title="dom-open-features-left"><a href="#dom-open-features-left">left</a></code> is present in <var>parsed features</var>, follow these substeps:
736+
<ol>
737+
<li><p>Let <var>x</var> be the value of <code title="dom-open-features-left"><a href="#dom-open-features-left">left</a></code>.
738+
<li><p>Optionally, clamp <var>x</var> in a user-agent-defined manner so that the window does not move outside the available space.
739+
<li><p>Optionally, move <var>target</var>'s window such that the window's left edge is at the horizontal coordinate <var>x</var> relative to the left edge of
740+
the output device, measured in CSS pixels of <var>target</var>. The positive axis is rightward.
741+
</ol>
742+
<li><p>If <code title="dom-open-features-top"><a href="#dom-open-features-top">top</a></code> is present in <var>parsed features</var>, follow these substeps:
743+
<ol>
744+
<li><p>Let <var>y</var> be the value of <code title="dom-open-features-top"><a href="#dom-open-features-top">top</a></code>.
745+
<li><p>Optionally, clamp <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.
746+
<li><p>Optionally, move <var>target</var>'s window such that the window's top edge is at the vertical coordinate <var>y</var> relative to the top edge of
747+
the output device, measured in CSS pixels of <var>target</var>. The positive axis is downward.
748+
</ol>
749+
<li><p>If <code title="dom-open-features-width"><a href="#dom-open-features-width">width</a></code> is present in <var>parsed features</var>, follow these substeps:
750+
<ol>
751+
<li><p>Let <var>x</var> be the value of <code title="dom-open-features-width"><a href="#dom-open-features-width">width</a></code>.
752+
<li><p>Optionally, clamp <var>x</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available space.
753+
<li><p>Optionally, size <var>target</var>'s window by moving its right edge such that the distance between the left and right edges of the viewport are
754+
<var>x</var> CSS pixels of <var>target</var>.
755+
<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.
756+
</ol>
757+
<li><p>If <code title="dom-open-features-height"><a href="#dom-open-features-height">height</a></code> is present in <var>parsed features</var>, follow these substeps:
758+
<ol>
759+
<li><p>Let <var>y</var> be the value of <code title="dom-open-features-height"><a href="#dom-open-features-height">height</a></code>.
760+
<li><p>Optionally, clamp <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available space.
761+
<li><p>Optionally, size <var>target</var>'s window by moving its bottom edge such that the distance between the top and bottom edges of the viewport are
762+
<var>x</var> CSS pixels of <var>target</var>.
763+
<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.
764+
</ol>
765+
</ol>
766+
767+
<p>A <dfn id="supported-open()-feature-name">supported <code title="">open()</code> feature name</dfn> is one of the following:
768+
769+
<dl>
770+
<dt><dfn id="dom-open-features-width" title="dom-open-features-width">width</dfn>
771+
<dd><p>The width of the viewport.
772+
<dt><dfn id="dom-open-features-height" title="dom-open-features-height">height</dfn>
773+
<dd><p>The height of the viewport.
774+
<dt><dfn id="dom-open-features-left" title="dom-open-features-left">left</dfn>
775+
<dd><p>The left position of the window.
776+
<dt><dfn id="dom-open-features-top" title="dom-open-features-top">top</dfn>
777+
<dd><p>The top position of the window.
778+
</dl>
779+
780+
781+
<h3 id="the-mediaquerylist-interface"><span class="secno">5.2 </span>The <code title="">MediaQueryList</code> Interface</h3>
705782

706783
<p>A <code><a href="#mediaquerylist">MediaQueryList</a></code> object has an associated media query list set on creation and an associated
707784
<dfn id="list-of-media-query-list-listeners">list of media query list listeners</dfn>, which is initially empty.</p>
@@ -743,7 +820,7 @@ <h3 id="the-mediaquerylist-interface"><span class="secno">5.1 </span>The <code t
743820
<p>When the <dfn id="dom-mediaquerylist-removelistener" title="dom-MediaQueryList-removeListener"><code>removeListener(<var>listener</var>)</code></dfn> method is invoked
744821
<var>listener</var> must be removed from the <a href="#list-of-media-query-list-listeners">list of media query list listeners</a>.</p>
745822

746-
<h3 id="the-screen-interface"><span class="secno">5.2 </span>The <code title="">Screen</code> Interface</h3>
823+
<h3 id="the-screen-interface"><span class="secno">5.3 </span>The <code title="">Screen</code> Interface</h3>
747824

748825
<p>As its name suggests, the <code><a href="#screen">Screen</a></code> interface represents information about the screen of the output device.</p>
749826

0 commit comments

Comments
 (0)