Skip to content

Commit

Permalink
[geometry] Editorial: simplify 'validate and fixup' algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
zcorpan committed Sep 14, 2016
1 parent 3c2dd06 commit 9d828ce
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions geometry/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Abstract: This specification provides basic geometric interfaces to represent po
!Issues list: <a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=FXTF&amp;component=Geometry&amp;resolution=---">Bugzilla</a> (<a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=FXTF&amp;component=Geometry">file a bug</a>)
Test Suite: http://test.csswg.org/suites/geometry-1_dev/nightly-unstable/
Use <i> Autolinks: yes
Ignored Vars: f, Point object, m44, e, m42, quad1, m41, stringifier, point object, m12, c, transformPoint, m21, d, m22, quad2, sz
Ignored Vars: a, b, f, Point object, m44, e, m42, quad1, m41, stringifier, point object, m12, c, transformPoint, m21, d, m22, quad2, sz
</pre>

<pre class=anchors>
Expand Down Expand Up @@ -636,12 +636,12 @@ To <dfn>validate and fixup</dfn> a {{DOMMatrixInit}} dictionary <var>dict</var>,
or at least one of {{DOMMatrixInit/m33}}, {{DOMMatrixInit/m44}}
are present with a value other than ''1''.
</ul>
<li><a>Set the dictionary members</a> {{DOMMatrixInit/a}} and {{DOMMatrixInit/m11}} with fallback value ''1''.
<li><a>Set the dictionary members</a> {{DOMMatrixInit/b}} and {{DOMMatrixInit/m12}} with fallback value ''0''.
<li><a>Set the dictionary members</a> {{DOMMatrixInit/c}} and {{DOMMatrixInit/m21}} with fallback value ''0''.
<li><a>Set the dictionary members</a> {{DOMMatrixInit/d}} and {{DOMMatrixInit/m22}} with fallback value ''1''.
<li><a>Set the dictionary members</a> {{DOMMatrixInit/e}} and {{DOMMatrixInit/m41}} with fallback value ''0''.
<li><a>Set the dictionary members</a> {{DOMMatrixInit/f}} and {{DOMMatrixInit/m42}} with fallback value ''0''.
<li>If {{DOMMatrixInit/m11}} is not present then set it to the value of member {{DOMMatrixInit/a}}, or value ''1'' if {{DOMMatrixInit/a}} is also not present.
<li>If {{DOMMatrixInit/m12}} is not present then set it to the value of member {{DOMMatrixInit/b}}, or value ''0'' if {{DOMMatrixInit/b}} is also not present.
<li>If {{DOMMatrixInit/m21}} is not present then set it to the value of member {{DOMMatrixInit/c}}, or value ''0'' if {{DOMMatrixInit/c}} is also not present.
<li>If {{DOMMatrixInit/m22}} is not present then set it to the value of member {{DOMMatrixInit/d}}, or value ''1'' if {{DOMMatrixInit/d}} is also not present.
<li>If {{DOMMatrixInit/m41}} is not present then set it to the value of member {{DOMMatrixInit/e}}, or value ''0'' if {{DOMMatrixInit/e}} is also not present.
<li>If {{DOMMatrixInit/m42}} is not present then set it to the value of member {{DOMMatrixInit/f}}, or value ''0'' if {{DOMMatrixInit/f}} is also not present.
<li>If {{DOMMatrixInit/is2D}} is not present and at least one of
{{DOMMatrixInit/m31}}, {{DOMMatrixInit/m32}}, {{DOMMatrixInit/m13}}, {{DOMMatrixInit/m23}},
{{DOMMatrixInit/m43}}, {{DOMMatrixInit/m14}}, {{DOMMatrixInit/m24}}, {{DOMMatrixInit/m34}}
Expand All @@ -657,14 +657,6 @@ are the same if they have identical IEEE 754 double-precision bit patterns.

Note: This means that two ''NaN'' values are the same.

To <dfn>set the dictionary members</dfn> <var>a</var> and <var>b</var> of a {{DOMMatrixInit}} dictionary, with a fallback value <var>fallback</var>, run the following steps:

<ol>
<li>If <var>a</var> is present and <var>b</var> is not present, set the <var>b</var> dictionary member to the value of <var>a</var>.
<li>Otherwise, if <var>b</var> is present and <var>a</var> is not present, set the <var>a</var> dictionary member to the value of <var>b</var>.
<li>Otherwise, if neither <var>a</var> or <var>b</var> are present, set <var>a</var> and <var>b</var> dictionary members to <var>fallback</var>.
</ol>

<h3 id='dommatrix-create'>Creating DOMMatrixReadOnly and DOMMatrix objects</h3>

To <dfn>create a 2d matrix</dfn> of type <var>type</var> being either {{DOMMatrixReadOnly}} or {{DOMMatrix}},
Expand Down

0 comments on commit 9d828ce

Please sign in to comment.