@@ -414,6 +414,18 @@ dictionary DOMQuadInit {
414414};
415415</pre>
416416
417+ <p> The following algorithms assume that {{DOMQuad}} objects have the internal member variables <dfn
418+ dfn-for=quadrilateral id=quadrilateral-point-1> point 1</dfn> , <dfn dfn-for=quadrilateral
419+ id=quadrilateral-point-2> point 2</dfn> , <dfn dfn-for=quadrilateral id=quadrilateral-point-3>point
420+ 3</dfn> , and <dfn dfn-for=quadrilateral id=quadrilateral-point-4>point 4</dfn> , which are
421+ {{DOMPoint}} objects. {{DOMQuad}} must be able to access and set the value of these variables. The
422+ author can modify these {{DOMPoint}} objects, which directly affects the quadrilateral.
423+
424+ <p> An interface returning a {{DOMQuad}} object by an attribute or function may be able to modify
425+ internal member variable values. Such an interface must specify this ability explicitly in prose.
426+
427+ <p> Internal member variables must not be exposed in any way.
428+
417429<p> The <dfn dfn-type=constructor dfn-for=DOMQuad><code>DOMQuad(<var>p1</var>, <var>p2</var>,
418430<var>p3</var>, <var>p4</var>)</code></dfn> constructor, when invoked, must run the following steps:
419431
@@ -430,9 +442,9 @@ dictionary DOMQuadInit {
430442 <li><p> Let <var> point4</var> be a new {{DOMPoint}} object with its attributes set to the values of
431443 the namesake dictionary members in <var> p4</var> .
432444
433- <li><p> Return a new {{DOMQuad}} with {{DOMQuad/p1}} set to <var> point1</var> , {{DOMQuad/p2}} set to
434- <var> point2 </var> , {{DOMQuad/p3}} set to <var> point3 </var> and {{DOMQuad/p4}} set to
435- <var> point4</var> .
445+ <li><p> Return a new {{DOMQuad}} with <a for=quadrilateral>point 1</a> set to <var> point1</var> , <a
446+ for=quadrilateral> point 2 </a> set to <var> point2 </var> , <a for=quadrilateral>point 3</a> set to
447+ <var> point3 </var> and <a for=quadrilateral>point 4</a> set to <var> point4</var> .
436448</ol>
437449
438450<p class=note> It is possible to pass {{DOMPoint}} /{{DOMPointReadOnly}} arguments as well. The passed
@@ -448,27 +460,29 @@ a <code>DOMRectInit</code> dictionary</dfn> <var>other</var>, follow these steps
448460
449461<ol>
450462 <li><p> Let <var> x</var> , <var> y</var> , <var> width</var> and <var> height</var> be the value of
451- <var> other</var> 's {{DOMRectReadOnly /x}} , {{DOMRectReadOnly /y}} , {{DOMRectReadOnly /width}} and
452- {{DOMRectReadOnly /height}} attributes , respectively.
463+ <var> other</var> 's {{DOMRectInit /x}} , {{DOMRectInit /y}} , {{DOMRectInit /width}} and
464+ {{DOMRectInit /height}} dictionary members , respectively.
453465
454- <li><p> Let <var> point1</var> be a new {{DOMPoint}} object with {{DOMPoint/x}} set to <var> x</var> ,
455- {{DOMPoint/y}} set to <var> y</var> , {{DOMPoint/z}} set to zero and {{DOMPoint/w}} set to one.
466+ <li><p> Let <var> point1</var> be a new {{DOMPoint}} object with <a for=point>x coordinate</a> set to
467+ <var> x</var> , <a for=point>y coordinate</a> set to <var> y</var> , <a for=point>z coordinate</a> set
468+ to zero and <a for=point>w perspective</a> set to one.
456469
457- <li><p> Let <var> point2</var> be a new {{DOMPoint}} object with {{DOMPoint/x}} set to <var> x </var> +
458- <var> width</var> , {{DOMPoint/y}} set to <var> y</var> , {{DOMPoint/z}} set to zero and {{DOMPoint/w}}
459- set to one.
470+ <li><p> Let <var> point2</var> be a new {{DOMPoint}} object with <a for=point>x coordinate</a> set to
471+ <var> x </var> + <var> width</var> , <a for=point>y coordinate</a> set to <var> y</var> , <a for=point>z
472+ coordinate</a> set to zero and <a for=point>w perspective</a> set to one.
460473
461- <li><p> Let <var> point3</var> be a new {{DOMPoint}} object with {{DOMPoint/x}} set to <var> x</var> +
462- <var> width</var> , {{DOMPoint/y}} set to <var> y</var> + <var> height</var> , {{DOMPoint/z}} set to
463- zero and {{DOMPoint/w}} set to one.
474+ <li><p> Let <var> point3</var> be a new {{DOMPoint}} object with <a for=point>x coordinate</a> set to
475+ <var> x</var> + <var> width</var> , <a for=point>y coordinate</a> set to <var> y</var> +
476+ <var> height</var> , <a for=point>z coordinate</a> set to zero and <a for=point>w perspective</a> set
477+ to one.
464478
465- <li><p> Let <var> point4</var> be a new {{DOMPoint}} object with {{DOMPoint/x}} set to <var> x </var> ,
466- {{DOMPoint/y}} set to <var> y</var> + <var> height</var> , {{DOMPoint/z}} set to zero and
467- {{DOMPoint/w}} set to one.
479+ <li><p> Let <var> point4</var> be a new {{DOMPoint}} object with <a for=point>x coordinate</a> set to
480+ <var> x </var> , <a for=point>y coordinate</a> set to <var> y</var> + <var> height</var> , <a for=point>z
481+ coordinate</a> set to zero and <a for=point>w perspective</a> set to one.
468482
469- <li><p> Return a new {{DOMQuad}} with {{DOMQuad/p1}} set to <var> point1</var> , {{DOMQuad/p2}} set to
470- <var> point2 </var> , {{DOMQuad/p3}} set to <var> point3 </var> and {{DOMQuad/p4}} set to
471- <var> point4</var> .
483+ <li><p> Return a new {{DOMQuad}} with <a for=quadrilateral>point 1</a> set to <var> point1</var> , <a
484+ for=quadrilateral> point 2 </a> set to <var> point2 </var> , <a for=quadrilateral>point 3</a> set to
485+ <var> point3 </var> and <a for=quadrilateral>point 4</a> set to <var> point4</var> .
472486</ol>
473487
474488<p> The <dfn method lt=fromQuad() dfn-for=DOMQuad><code>fromQuad(<var>other</var>)</code></dfn>
@@ -491,27 +505,19 @@ a <code>DOMQuadInit</code> dictionary</dfn> <var>other</var>, follow these steps
491505 <li><p> Let <var> point4</var> be the result of invoking <a>create a <code>DOMPoint</code> from the
492506 dictionary</a> {{DOMQuadInit/p4}} dictionary member of <var> other</var> , if it exists.
493507
494- <li><p> Return a new {{DOMQuad}} with {{DOMQuad/p1}} set to <var> point1</var> , {{DOMQuad/p2}} set to
495- <var> point2 </var> , {{DOMQuad/p3}} set to <var> point3 </var> and {{DOMQuad/p4}} set to
496- <var> point4</var> .
508+ <li><p> Return a new {{DOMQuad}} with <a for=quadrilateral>point 1</a> set to <var> point1</var> , <a
509+ for=quadrilateral> point 2 </a> set to <var> point2 </var> , <a for=quadrilateral>point 3</a> set to
510+ <var> point3 </var> and <a for=quadrilateral>point 4</a> set to <var> point4</var> .
497511</ol>
498512
499513<div dfn-type=attribute dfn-for=DOMQuad>
500- <p> The <dfn><code>p1</code></dfn> attribute must return a {{DOMPoint}} that represents <a
501- attribute> p1</a> of the quadrilateral it was invoked on. The author can modify the returned
502- {{DOMPoint}} object, which directly affects the quadrilateral.
514+ <p> The <dfn><code>p1</code></dfn> attribute must return <a for=quadrilateral>point 1</a> .
503515
504- <p> The <dfn><code>p2</code></dfn> attribute must return a {{DOMPoint}} that represents <a
505- attribute> p2</a> of the quadrilateral it was invoked on. The author can modify the returned
506- {{DOMPoint}} object, which directly affects the quadrilateral.
516+ <p> The <dfn><code>p2</code></dfn> attribute must return <a for=quadrilateral>point 2</a> .
507517
508- <p> The <dfn><code>p3</code></dfn> attribute must return a {{DOMPoint}} that represents <a
509- attribute> p3</a> of the quadrilateral it was invoked on. The author can modify the returned
510- {{DOMPoint}} object, which directly affects the quadrilateral.
518+ <p> The <dfn><code>p3</code></dfn> attribute must return <a for=quadrilateral>point 3</a> .
511519
512- <p> The <dfn><code>p4</code></dfn> attribute must return a {{DOMPoint}} that represents <a
513- attribute> p4</a> of the quadrilateral it was invoked on. The author can modify the returned
514- {{DOMPoint}} object, which directly affects the quadrilateral.
520+ <p> The <dfn><code>p4</code></dfn> attribute must return <a for=quadrilateral>point 4</a> .
515521</div>
516522
517523<p> The <dfn method for=DOMQuad>getBounds()</dfn> method, when invoked, must run the following
@@ -520,22 +526,30 @@ algorithm:
520526<ol>
521527 <li><p> Let <var> bounds</var> be a {{DOMRect}} object.
522528
523- <li><p> Let <var> left</var> be the minimum of <a attribute>p1</a> .x, <a attribute>p2</a> .x, <a
524- attribute> p3</a> .x and <a attribute>p4</a> .x.
529+ <li><p> Let <var> left</var> be the minimum of <a for=quadrilateral>point 1</a> 's <a for=point>x
530+ coordinate</a> , <a for=quadrilateral>point 2</a> 's <a for=point>x coordinate</a> , <a
531+ for=quadrilateral> point 3</a> 's <a for=point>x coordinate</a> and <a for=quadrilateral>point
532+ 4</a> 's <a for=point>x coordinate</a> .
525533
526- <li><p> Let <var> top</var> be the minimum of <a attribute>p1</a> .y, <a attribute>p2</a> .y, <a
527- attribute> p3</a> .y and <a attribute>p4</a> .y.
534+ <li><p> Let <var> top</var> be the minimum of <a for=quadrilateral>point 1</a> 's <a for=point>y
535+ coordinate</a> , <a for=quadrilateral>point 2</a> 's <a for=point>y coordinate</a> , <a
536+ for=quadrilateral> point 3</a> 's <a for=point>y coordinate</a> and <a for=quadrilateral>point
537+ 4</a> 's <a for=point>y coordinate</a> .
528538
529- <li><p> Let <var> right</var> be the maximum of <a attribute>p1</a> .x, <a attribute>p2</a> .x, <a
530- attribute> p3</a> .x and <a attribute>p4</a> .x.
539+ <li><p> Let <var> right</var> be the maximum of <a for=quadrilateral>point 1</a> 's <a for=point>x
540+ coordinate</a> , <a for=quadrilateral>point 2</a> 's <a for=point>x coordinate</a> , <a
541+ for=quadrilateral> point 3</a> 's <a for=point>x coordinate</a> and <a for=quadrilateral>point
542+ 4</a> 's <a for=point>x coordinate</a> .
531543
532- <li><p> Let <var> bottom</var> be the maximum of <a attribute>p1</a> .y, <a attribute>p2</a> .y, <a
533- attribute> p3</a> .y and <a attribute>p4</a> .y.
544+ <li><p> Let <var> bottom</var> be the maximum of <a for=quadrilateral>point 1</a> 's <a for=point>y
545+ coordinate</a> , <a for=quadrilateral>point 2</a> 's <a for=point>y coordinate</a> , <a
546+ for=quadrilateral> point 3</a> 's <a for=point>y coordinate</a> and <a for=quadrilateral>point
547+ 4</a> 's <a for=point>y coordinate</a> .
534548
535- <li><p> Let <a for=rectangle>x coordinate</a> of <var> bounds</var> be <var> left</var> , <a
536- for=rectangle> y coordinate</a> of <var> bounds</var> be <var> top</var> , <a for=rectangle>width
537- dimension</a> of <var> bounds</var> be <var> right</var> - <var> left</var> and <a
538- for=rectangle> height dimension</a> of <var> bounds</var> be <var> bottom</var> - <var> top</var> .
549+ <li><p> Set <a for=rectangle>x coordinate</a> of <var> bounds</var> to <var> left</var> , <a
550+ for=rectangle> y coordinate</a> of <var> bounds</var> to <var> top</var> , <a for=rectangle>width
551+ dimension</a> of <var> bounds</var> to <var> right</var> - <var> left</var> and <a
552+ for=rectangle> height dimension</a> of <var> bounds</var> to <var> bottom</var> - <var> top</var> .
539553
540554 <li><p> Return <var> bounds</var> .
541555</ol>
@@ -578,9 +592,9 @@ algorithm:
578592 <circle cx="10" cy="180" r="3" fill="rgb(204, 51, 51)"/>
579593 </svg>
580594 <p class="capture"> An irregular quadrilateral represented by a {{DOMQuad}} . The four red colored
581- circles represent the {{DOMPoint}} attributes <a attribute>p1</a> to <a attribute>p4</a> . The
582- dashed rectangle represents the bounding rectangle returned by the {{DOMQuad/getBounds()}} method
583- of the {{DOMQuad}} .
595+ circles represent the {{DOMPoint}} attributes {{DOMQuad/p1}} to {{DOMQuad/p4}} . The dashed
596+ rectangle represents the bounding rectangle returned by the {{DOMQuad/getBounds()}} method of the
597+ {{DOMQuad}} .
584598 </div>
585599</div>
586600
0 commit comments