Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[geometry] Editorial: Use separate entry points instead of ignore3D #218

Merged
merged 1 commit into from Nov 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 35 additions & 19 deletions geometry/Overview.bs
Expand Up @@ -870,13 +870,12 @@ interface from SVG. [[SVG11]]

<h3 id=dommatrixinit-dictionary>DOMMatrix2DInit and DOMMatrixInit dictionaries</h3>

<p>To <dfn dfn-for=matrix>validate and fixup</dfn> a {{DOMMatrix2DInit}} or {{DOMMatrixInit}}
dictionary <var>dict</var>, given a boolean <var>ignore3D</var> (<code>false</code> if not
provided), run the following steps:
<p>To <dfn dfn-for=matrix>validate and fixup (2D)</dfn> a {{DOMMatrix2DInit}} or {{DOMMatrixInit}}
dictionary <var>dict</var>, run the following steps:

<ol>
<li>
<p>If if at least one of the following conditions are true for <var>dict</var>, throw a
<p>If if at least one of the following conditions are true for <var>dict</var>, then throw a
{{TypeError}} exception and abort these steps.

<ul>
Expand All @@ -897,12 +896,6 @@ provided), run the following steps:

<li><p>{{DOMMatrix2DInit/f}} and {{DOMMatrix2DInit/m42}} are both present and
[=SameValueZero=]({{DOMMatrix2DInit/f}}, {{DOMMatrix2DInit/m42}}) is <code>false</code>.

<li><p><var>ignore3D</var> is <code>false</code> and {{DOMMatrixInit/is2D}} is <code>true</code>
and: at least one of {{DOMMatrixInit/m13}}, {{DOMMatrixInit/m14}}, {{DOMMatrixInit/m23}},
{{DOMMatrixInit/m24}}, {{DOMMatrixInit/m31}}, {{DOMMatrixInit/m32}}, {{DOMMatrixInit/m34}},
{{DOMMatrixInit/m43}} are present with a value other than ''0'' or ''-0'', or at least one of
{{DOMMatrixInit/m33}}, {{DOMMatrixInit/m44}} are present with a value other than ''1''.
</ul>

<li><p>If {{DOMMatrix2DInit/m11}} is not present then set it to the value of member
Expand All @@ -922,8 +915,22 @@ provided), run the following steps:

<li><p>If {{DOMMatrix2DInit/m42}} is not present then set it to the value of member
{{DOMMatrix2DInit/f}}, or value ''0'' if {{DOMMatrix2DInit/f}} is also not present.
</ol>

<p class=note>The [=SameValueZero=] comparison algorithm returns <code>true</code> for two ''NaN''
values, and also for ''0'' and ''-0''. [[!ECMA-262]]

<li><p>If <var>ignore3D</var> is <code>true</code>, then return.
<p>To <dfn dfn-for=matrix>validate and fixup</dfn> a {{DOMMatrixInit}} dictionary <var>dict</var>,
run the following steps:

<ol>
<li><p><a for=matrix>Validate and fixup (2D)</a> <var>dict</var>.</p>

<li><p>If {{DOMMatrixInit/is2D}} is <code>true</code> and: at least one of {{DOMMatrixInit/m13}},
{{DOMMatrixInit/m14}}, {{DOMMatrixInit/m23}}, {{DOMMatrixInit/m24}}, {{DOMMatrixInit/m31}},
{{DOMMatrixInit/m32}}, {{DOMMatrixInit/m34}}, {{DOMMatrixInit/m43}} are present with a value other
than ''0'' or ''-0'', or at least one of {{DOMMatrixInit/m33}}, {{DOMMatrixInit/m44}} are present
with a value other than ''1'', then throw a {{TypeError}} exception and abort these steps.

<li><p>If {{DOMMatrixInit/is2D}} is not present and at least one of {{DOMMatrixInit/m13}},
{{DOMMatrixInit/m14}}, {{DOMMatrixInit/m23}}, {{DOMMatrixInit/m24}}, {{DOMMatrixInit/m31}},
Expand All @@ -934,9 +941,6 @@ provided), run the following steps:
<li><p>If {{DOMMatrixInit/is2D}} is still not present, set it to <code>true</code>.
</ol>

<p class=note>The [=SameValueZero=] comparison algorithm returns <code>true</code> for two ''NaN''
values, and also for ''0'' and ''-0''. [[!ECMA-262]]


<h3 id=dommatrix-parse algorithm>Parsing a string into an abstract matrix</h3>

Expand Down Expand Up @@ -1077,19 +1081,31 @@ id=dom-dommatrixreadonly-frommatrix><code>fromMatrix(<var>other</var>)</code></d
id=dom-dommatrix-frommatrix><code>fromMatrix(<var>other</var>)</code></dfn> static method on
{{DOMMatrix}} must <a>create a <code>DOMMatrix</code> from the dictionary</a> <var>other</var>.

<p>To <dfn lt="create a DOMMatrixReadOnly from the 2D dictionary">create a
<code>DOMMatrixReadOnly</code> from a 2D dictionary</dfn> <var>other</var> or to <dfn lt="create a
DOMMatrix from the 2D dictionary">create a <code>DOMMatrix</code> from a 2D dictionary</dfn>
<var>other</var>, follow these steps:

<ol>
<li><a for=matrix>Validate and fixup (2D)</a> <var>other</var>.

<li><p>Return the result of invoking <a>create a 2d matrix</a> of type {{DOMMatrixReadOnly}} or
{{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the 6 elements
{{DOMMatrix2DInit/m11}}, {{DOMMatrix2DInit/m12}}, {{DOMMatrix2DInit/m21}}, {{DOMMatrix2DInit/m22}},
{{DOMMatrix2DInit/m41}} and {{DOMMatrix2DInit/m42}} of <var>other</var> in the given order.
</ol>

<p>To <dfn lt="create a DOMMatrixReadOnly from the dictionary">create a
<code>DOMMatrixReadOnly</code> from a dictionary</dfn> <var>other</var> or to <dfn lt="create a
DOMMatrix from the dictionary">create a <code>DOMMatrix</code> from a dictionary</dfn>
<var>other</var>, given a boolean <var>ignore3D</var> (<code>false</code> if not provided), follow
these steps:
<var>other</var>, follow these steps:

<ol>
<li><a for=matrix>Validate and fixup</a> <var>other</var>, given <var>ignore3D</var>.
<li><a for=matrix>Validate and fixup</a> <var>other</var>.

<li>
<dl class=switch>
<dt>If <var>ignore3D</var> is <code>true</code> or if the {{DOMMatrixInit/is2D}} dictionary
member of <var>other</var> is <code>true</code>
<dt>If the {{DOMMatrixInit/is2D}} dictionary member of <var>other</var> is <code>true</code>
<dd><p>Return the result of invoking <a>create a 2d matrix</a> of type {{DOMMatrixReadOnly}} or
{{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the 6 elements
{{DOMMatrix2DInit/m11}}, {{DOMMatrix2DInit/m12}}, {{DOMMatrix2DInit/m21}}, {{DOMMatrix2DInit/m22}},
Expand Down