Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 27 additions & 43 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -60026,12 +60026,18 @@ interface <dfn>CanvasImageData</dfn> {
void <span data-x="dom-context-2d-putImageData">putImageData</span>(<span>ImageData</span> imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight);
};

enum <dfn>CanvasLineCap</dfn> { "butt", "round", "square" };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think enums shouldn't say what the default is, since in principle different features could reuse the same enum but have different defaults. So remove the comments from enum lines.

enum <dfn>CanvasLineJoin</dfn> { "round", "bevel", "miter"};
enum <dfn>CanvasTextAlign</dfn> { "<span data-x="dom-context-2d-textalign-start">start</span>", "<span data-x="dom-context-2d-textalign-end">end</span>", "<span data-x="dom-context-2d-textalign-left">left</span>", "<span data-x="dom-context-2d-textalign-right">right</span>", "<span data-x="dom-context-2d-textalign-center">center</span>" };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't apply the 100-col linebreaking rule in IDL blocks because it makes the output look messy. :-) Either don't have linebreaks at all, or have each item on a separate line as in https://html.spec.whatwg.org/multipage/forms.html#selectionmode if the line becomes way too long.

enum <dfn>CanvasTextBaseline</dfn> { "<span data-x="dom-context-2d-textbaseline-top">top</span>", "<span data-x="dom-context-2d-textbaseline-hanging">hanging</span>", "<span data-x="dom-context-2d-textbaseline-middle">middle</span>", "<span data-x="dom-context-2d-textbaseline-alphabetic">alphabetic</span>", "<span data-x="dom-context-2d-textbaseline-ideographic">ideographic</span>", "<span data-x="dom-context-2d-textbaseline-bottom">bottom</span>" };
enum <dfn>CanvasDirection</dfn> { "<span data-x="dom-context-2d-direction-ltr">ltr</span>", "<span data-x="dom-context-2d-direction-rtl">rtl</span>", "<span data-x="dom-context-2d-direction-inherit">inherit</span>" };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't remove this, just change DOMString to CanvasLineCap, and keep the comment about the default here. Similarly for the other removed lines below.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the <pre class="idl">, remove the comment at the end, and move the enum so that it's above interface CanvasPathDrawingStyles, like other enum declarations.


[NoInterfaceObject, Exposed=(Window,Worker)]
interface <dfn>CanvasPathDrawingStyles</dfn> {
// line caps/joins
attribute unrestricted double <span data-x="dom-context-2d-lineWidth">lineWidth</span>; // (default 1)
attribute DOMString <span data-x="dom-context-2d-lineCap">lineCap</span>; // "butt", "round", "square" (default "butt")
attribute DOMString <span data-x="dom-context-2d-lineJoin">lineJoin</span>; // "round", "bevel", "miter" (default "miter")
attribute <dfn>CanvasLineCap</dfn> <span data-x="dom-context-2d-lineCap">lineCap</span>; // (default "butt")
attribute <dfn>CanvasLineJoin</dfn> <span data-x="dom-context-2d-lineJoin">lineJoin</span>; // (default "miter")
attribute unrestricted double <span data-x="dom-context-2d-miterLimit">miterLimit</span>; // (default 10)

// dashed lines
Expand All @@ -60044,9 +60050,9 @@ interface <dfn>CanvasPathDrawingStyles</dfn> {
interface <dfn>CanvasTextDrawingStyles</dfn> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing <span data-x="dom-context-2d-lineCap">lineCap</span> (before the ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am getting confused here, i should add lineCap to this line and do not remove the first line too by changing DOMString to CanvasLineCap "attribute CanvasLineCap lineCap;"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should say "attribute CanvasLineCap lineCap;". CanvasLineCap is the type, lineCap is the name of the attribute.

// text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing <span data-x="dom-context-2d-lineJoin">lineJoin</span>

attribute DOMString <span data-x="dom-context-2d-font">font</span>; // (default 10px sans-serif)
attribute DOMString <span data-x="dom-context-2d-textAlign">textAlign</span>; // "start", "end", "left", "right", "center" (default: "start")
attribute DOMString <span data-x="dom-context-2d-textBaseline">textBaseline</span>; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
attribute DOMString <span data-x="dom-context-2d-direction">direction</span>; // "ltr", "rtl"<!--, "auto"-->, "inherit" (default: "inherit")
attribute <dfn>CanvasTextAlign</dfn> <span data-x="dom-context-2d-textAlign">textAlign</span>; // (default: "start")
attribute <dfn>CanvasTextBaseline</dfn> <span data-x="dom-context-2d-textBaseline">textBaseline</span>; // (default: "alphabetic")
attribute <dfn>CanvasDirection</dfn> <span data-x="dom-context-2d-direction">direction</span>; // (default: "inherit")
};

[NoInterfaceObject, Exposed=(Window,Worker)]
Expand Down Expand Up @@ -60923,10 +60929,8 @@ idea from Mihai:
data-x="">butt</code>", "<code data-x="">round</code>", and "<code
data-x="">square</code>".</p>

<p>On getting, it must return the current value. On setting, if the new value is one of the
literal strings "<code data-x="">butt</code>", "<code data-x="">round</code>", and "<code
data-x="">square</code>", then the current value must be changed to the new value; other values
must ignored, leaving the value unchanged.</p>
<p>On getting, it must return the current value. On setting, the current value must be changed
to the new value.</p>

<p>When the object implementing the <code>CanvasPathDrawingStyles</code> interface is created, the
<code data-x="dom-context-2d-lineCap">lineCap</code> attribute must initially have the value
Expand All @@ -60938,10 +60942,8 @@ idea from Mihai:
of corners that UAs will place where two lines meet. The three valid values are
"<code data-x="">bevel</code>", "<code data-x="">round</code>", and "<code data-x="">miter</code>".</p>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove everything after "to the new value".

<p>On getting, it must return the current value. On setting, if the new value is one of the
literal strings "<code data-x="">bevel</code>", "<code data-x="">round</code>", and "<code
data-x="">miter</code>", then the current value must be changed to the new value; other values
must be ignored, leaving the value unchanged.</p>
<p>On getting, it must return the current value. On setting, the current value must be changed
to the new value.</p>

<p>When the object implementing the <code>CanvasPathDrawingStyles</code> interface is created, the
<code data-x="dom-context-2d-lineJoin">lineJoin</code> attribute must initially have the value
Expand Down Expand Up @@ -61384,40 +61386,22 @@ transform. ack Shaun Morris. -->
interpreted relative to the normal-weight 10px sans-serif default.</p>

<p>The <dfn><code data-x="dom-context-2d-textAlign">textAlign</code></dfn> IDL attribute, on
getting, must return the current value. On setting, if the value is one of <code
data-x="dom-context-2d-textAlign-start">start</code>, <code
data-x="dom-context-2d-textAlign-end">end</code>, <code
data-x="dom-context-2d-textAlign-left">left</code>, <code
data-x="dom-context-2d-textAlign-right">right</code>, or <code
data-x="dom-context-2d-textAlign-center">center</code>, then the value must be changed to the new
value. Otherwise, the new value must be ignored. When the object implementing the
<code>CanvasTextDrawingStyles</code> interface is created, the <code
data-x="dom-context-2d-textAlign">textAlign</code> attribute must initially have the value <code
data-x="dom-context-2d-textAlign-start">start</code>.</p>
getting, must return the current value. On setting, the current value must be changed to the new
value. When the object implementing the <code>CanvasTextDrawingStyles</code> interface is
created, the <code data-x="dom-context-2d-textAlign">textAlign</code> attribute must initially
have the value <code data-x="dom-context-2d-textAlign-start">start</code>.</p>

<p>The <dfn><code data-x="dom-context-2d-textBaseline">textBaseline</code></dfn> IDL attribute, on
getting, must return the current value. On setting, if the value is one of <code
data-x="dom-context-2d-textBaseline-top">top</code>, <code
data-x="dom-context-2d-textBaseline-hanging">hanging</code>, <code
data-x="dom-context-2d-textBaseline-middle">middle</code>, <code
data-x="dom-context-2d-textBaseline-alphabetic">alphabetic</code>, <code
data-x="dom-context-2d-textBaseline-ideographic">ideographic</code>, or <code
data-x="dom-context-2d-textBaseline-bottom">bottom</code>, then the value must be changed to the
new value. Otherwise, the new value must be ignored. When the object implementing the
<code>CanvasTextDrawingStyles</code> interface is created, the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute must initially have the value
<code data-x="dom-context-2d-textBaseline-alphabetic">alphabetic</code>.</p>
getting, must return the current value. On setting, the current value must be changed to the new
value. When the object implementing the <code>CanvasTextDrawingStyles</code> interface is
created, the <code data-x="dom-context-2d-textBaseline">textBaseline</code> attribute must
initially have the value <code data-x="dom-context-2d-textBaseline-alphabetic">alphabetic</code>.</p>

<p>The <dfn><code data-x="dom-context-2d-direction">direction</code></dfn> IDL attribute, on
getting, must return the current value. On setting, if the value is one of "<code
data-x="dom-context-2d-direction-ltr">ltr</code>", "<code
data-x="dom-context-2d-direction-rtl">rtl</code>", <!--"<code
data-x="dom-context-2d-direction-auto">auto</code>",--> or "<code
data-x="dom-context-2d-direction-inherit">inherit</code>", then the value must be changed to the
new value. Otherwise, the new value must be ignored. When the object implementing the
<code>CanvasTextDrawingStyles</code> interface is created, the <code
data-x="dom-context-2d-direction">direction</code> attribute must initially have the value "<code
data-x="dom-context-2d-direction-inherit">inherit</code>".</p>
getting, must return the current value. On setting, the current value must be changed to the new
value. When the object implementing the <code>CanvasTextDrawingStyles</code> interface is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the "On setting" paragraph to be the same as the others; On setting, the current value must be changed to the new value.

created, the <code data-x="dom-context-2d-direction">direction</code> attribute must initially
have the value "<code data-x="dom-context-2d-direction-inherit">inherit</code>".</p>

</div>

Expand Down