Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (0) Make non-modal dialogs not center automatically.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=20418
Affected topics: CSS, DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@8457 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 4, 2014
1 parent 36b079a commit df69e87
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 97 deletions.
67 changes: 35 additions & 32 deletions complete.html
Expand Up @@ -298,7 +298,7 @@

<header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 3 February 2014</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 4 February 2014</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -52092,18 +52092,17 @@ <h4 id=the-dialog-element><span class=secno>4.11.7 </span>The <dfn><code>dialog<

<li><p>If the <code title=dom-dialog-show><a href=#dom-dialog-show>show()</a></code> method was invoked with an argument,
<a href=#set-up-the-position>set up the position</a> of the <code><a href=#the-dialog-element>dialog</a></code> element, using that argument as the
anchor. Otherwise, <a href=#set-up-the-default-static-position>set up the default static position</a> of the dialog
element.</li>
anchor. Otherwise, set the <code><a href=#the-dialog-element>dialog</a></code> to the <a href=#normal-alignment>normal alignment</a> mode.</li>

</ol><hr><p>Each <code><a href=#document>Document</a></code> has a stack of <code><a href=#the-dialog-element>dialog</a></code> elements known as the
<dfn id=pending-dialog-stack>pending dialog stack</dfn>. When a <code><a href=#document>Document</a></code> is created, this stack must be
initialized to be empty.</p>

<!--CLEANUP-->
<p>When an element is added to the <a href=#pending-dialog-stack>pending dialog stack</a>, it must also be added to the
<a href=#top-layer>top layer</a> layer and its containing block must be the initial containing block. When
<a href=#top-layer>top layer</a> layer. When
an element is removed from the <a href=#pending-dialog-stack>pending dialog stack</a>, it must be removed from the
<a href=#top-layer>top layer</a>, and its containing block must revert to that given by the regular
containing block rules as defined by CSS. <a href=#refsFULLSCREEN>[FULLSCREEN]</a> <a href=#refsCSS>[CSS]</a></p>
<a href=#top-layer>top layer</a>. <a href=#refsFULLSCREEN>[FULLSCREEN]</a></p>

<p>When the <dfn id=dom-dialog-showmodal title=dom-dialog-showModal><code>showModal()</code></dfn> method is invoked,
the user agent must run the following steps:</p>
Expand All @@ -52119,10 +52118,10 @@ <h4 id=the-dialog-element><span class=secno>4.11.7 </span>The <dfn><code>dialog<

<li><p>Add an <code title=attr-dialog-open><a href=#attr-dialog-open>open</a></code> attribute to <var title="">subject</var>, whose value is the empty string.</li>

<!--CLEANUP-->
<li><p>If the <code title=dom-dialog-showModal><a href=#dom-dialog-showmodal>showModal()</a></code> method was invoked with an
argument, <a href=#set-up-the-position>set up the position</a> of <var title="">subject</var>, using that argument as
the anchor. Otherwise, <a href=#set-up-the-default-static-position>set up the default static position</a> of the dialog
element.</li>
the anchor. Otherwise, set the <code><a href=#the-dialog-element>dialog</a></code> to the <a href=#centered-alignment>centered alignment</a> mode.</li>

<li><p>Let <var title="">subject</var>'s <code><a href=#document>Document</a></code> be <a href=#blocked-by-a-modal-dialog title="blocked by a modal
dialog">blocked by the modal dialog</a> <var title="">subject</var>.</li>
Expand Down Expand Up @@ -52210,30 +52209,31 @@ <h4 id=the-dialog-element><span class=secno>4.11.7 </span>The <dfn><code>dialog<

<p class=note>An example of such a UI mechanism would be the user pressing the "Escape" key.</p>

<hr><p>All <code><a href=#the-dialog-element>dialog</a></code> elements are always in one of two modes: <dfn id=mundanely-aligned>mundanely aligned</dfn>,
or <dfn id=magically-aligned>magically aligned</dfn>. When a <code><a href=#the-dialog-element>dialog</a></code> element is created, it must be placed
in the <a href=#mundanely-aligned>mundanely aligned</a> mode and the user agent must <a href=#set-up-the-default-static-position>set up the default static
position</a> for that element, without an anchor.</p>
<hr><!--CLEANUP--><p>All <code><a href=#the-dialog-element>dialog</a></code> elements are always in one of three modes: <dfn id=normal-alignment>normal alignment</dfn>,
<dfn id=centered-alignment>centered alignment</dfn>, and <dfn id=magic-alignment>magic alignment</dfn>.
When a <code><a href=#the-dialog-element>dialog</a></code> element is created, it must be placed
in the <a href=#normal-alignment>normal alignment</a> mode. In this mode, normal CSS requirements apply to the element. The
<a href=#centered-alignment>centered alignment</a> mode is only used for <code><a href=#the-dialog-element>dialog</a></code> elements that are in the <a href=#top-layer>top layer</a>.
<a href=#refsFULLSCREEN>[FULLSCREEN]</a> <a href=#refsCSS>[CSS]</a></p>

<p>When a user agent is to <dfn id=set-up-the-default-static-position>set up the default static position</dfn> of an element <var title="">subject</var> without an anchor, if that element is <a href=#being-rendered>being rendered</a>, it must
<!--CLEANUP-->
<p>When an element <var title="">subject</var> is placed in <a href=#centered-alignment>centered alignment</a> mode, and when it is in that mode
and has new rendering boxes created, the user agent must
set up the element such that its top static position, for the purposes of calculating the used
value of the 'top' property, is the value that would place the element's top margin edge as far
from the top of the viewport as the element's bottom margin edge from the bottom of the viewport,
if the element's height is less than the height of the viewport, and otherwise is the value that
would place the element's top margin edge at the top of the viewport.</p>

<p>If there is a <code><a href=#the-dialog-element>dialog</a></code> element that is <a href=#mundanely-aligned>mundanely aligned</a> and that is
<!--CLEANUP-->
<p>If there is a <code><a href=#the-dialog-element>dialog</a></code> element with <a href=#centered-alignment>centered alignment</a> and that is
<a href=#being-rendered>being rendered</a> when its <a href=#browsing-context>browsing context</a> changes viewport width (as
measured in CSS pixels), then the user agent must <a href=#set-up-the-default-static-position>set up the default static position</a>
of all such elements in that <a href=#browsing-context>browsing context</a> again, still without anchors.</p>
measured in CSS pixels), then the user agent must recreate the element's boxes, recalculating its top static position
as in the previous paragraph.</p>

<p>When a <code><a href=#the-dialog-element>dialog</a></code> element that is <a href=#mundanely-aligned>mundanely aligned</a> starts <a href=#being-rendered>being
rendered</a>, the user agent must <a href=#set-up-the-default-static-position>set up the default static position</a> of that
element, without an anchor.</p>

<p>This top static position of a <a href=#mundanely-aligned>mundanely aligned</a> <code><a href=#the-dialog-element>dialog</a></code> element must
remain the element's top static position until the <a href=#set-up-the-default-static-position>set up the default static position</a>
algorithm is once again invoked for that element. (The element's static position is only used in
<!--CLEANUP-->
<p>This top static position of a <code><a href=#the-dialog-element>dialog</a></code> element with <a href=#centered-alignment>centered alignment</a> must
remain the element's top static position until its boxes are recreated. (The element's static position is only used in
calculating the used value of the 'top' property in certain situations; it's not used, for
instance, to position the element if its 'position' property is set to 'static'.)</p>

Expand All @@ -52245,9 +52245,9 @@ <h4 id=the-dialog-element><span class=secno>4.11.7 </span>The <dfn><code>dialog<
<p>If <var title="">anchor</var> is a <code><a href=#mouseevent>MouseEvent</a></code> object, then run these
substeps:</p>

<ol><li><p>If <var title="">anchor</var>'s target element does not have a rendered box, or is in a
different document than <var title="">subject</var>, then let <var title="">subject</var> be
<a href=#mundanely-aligned>mundanely aligned</a>, <a href=#set-up-the-default-static-position>set up the default static position</a> of <var title="">subject</var> without an anchor, and abort the <a href=#set-up-the-position>set up the position</a>
<ol><!--CLEANUP--><li><p>If <var title="">anchor</var>'s target element does not have a rendered box, or is in a
different document than <var title="">subject</var>, then let <var title="">subject</var> be in the
<a href=#centered-alignment>centered alignment</a> mode, and abort the <a href=#set-up-the-position>set up the position</a>
steps.</li>

<li><p>Let <var title="">anchor element</var> be an anonymous element rendered as a box with
Expand All @@ -52259,19 +52259,21 @@ <h4 id=the-dialog-element><span class=secno>4.11.7 </span>The <dfn><code>dialog<

</li>

<li><p>Let <var title="">subject</var> be <a href=#magically-aligned>magically aligned</a> to <var title="">anchor
<!--CLEANUP-->
<li><p>Put <var title="">subject</var> in the <a href=#magic-alignment>magic alignment</a> mode, aligned to <var title="">anchor
element</var>.</li>

</ol><p>While an element <var title="">A</var> is <a href=#magically-aligned>magically aligned</a> to an element <var title="">B</var>, the following requirements apply:</p>
</ol><!--CLEANUP--><p>While an element <var title="">A</var> has <a href=#magic-alignment>magic alignment</a>, aligned to an element <var title="">B</var>, the following requirements apply:</p>

<ul><li>

<!--CLEANUP-->
<p>If at any time either <var title="">A</var> or <var title="">B</var> cease having rendered
boxes, <var title="">A</var> and <var title="">B</var> cease being in the same
<code><a href=#document>Document</a></code>, or <var title="">B</var> ceases being earlier than <var title="">A</var>
in <a href=#tree-order>tree order</a>, let <var title="">subject</var> be <a href=#mundanely-aligned>mundanely aligned</a>,
and <a href=#set-up-the-default-static-position>set up the default static position</a> of <var title="">subject</var> without an
anchor.</p>
in <a href=#tree-order>tree order</a>, then, if <var title="">subject</var> is in the <a href=#pending-dialog-stack>pending dialog
stack</a>, let <var title="">subject</var>'s mode become <a href=#centered-alignment>centered alignment</a>,
otherwise, let <var title="">subject</var>'s mode become <a href=#normal-alignment>normal alignment</a>.</p>

</li>

Expand Down Expand Up @@ -52389,13 +52391,14 @@ <h4 id=the-dialog-element><span class=secno>4.11.7 </span>The <dfn><code>dialog<

<li>

<!--CLEANUP-->
<p>When an element's 'position' property computes to '<dfn id=css-position-absolute-anchored title=css-position-absolute-anchored>absolute-anchored</dfn>', the 'float' property does not
apply and must compute to 'none', the 'display' property must compute to a value as described by
the table in <a href=http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo>the section of CSS
2.1 describing the <cite>relationships between 'display', 'position', and 'float'</cite></a>,
and the element's box must be positioned using the rules for absolute positioning but with its
static position set such that if the box is positioned in its static position, its anchor point
is exactly aligned over the anchor point of the element to which it is <a href=#magically-aligned>magically
is exactly aligned over the anchor point of the element to which it is <a href=#magic-alignment title="magic alignment">magically
aligned</a>. Elements aligned in this way are <i>absolutely positioned</i>. For the purposes
of determining the containing block of other elements, the '<a href=#css-position-absolute-anchored title=css-position-absolute-anchored>absolute-anchored</a>' keyword must be treated like
the 'absolute' keyword.</p>
Expand Down

0 comments on commit df69e87

Please sign in to comment.