Skip to content
Open
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ dictionary PaintEventInit : EventInit {

[Exposed=(Window,Worker)]
interface ElementImage {
// dimensions in device pixels
readonly attribute unsigned long width;
readonly attribute unsigned long height;
// dimensions scaled such that when drawing to canvas, the element will appear
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we call this "intrinsic size" and define it as a first-class concept? It's a subtle enough concept that we had a lengthy discussion about it. The definition would be something like:

"the size, in canvas coordinate space, at which an Element or ElementImage will have the same proportions when drawn into the canvas as it would have were it placed outside the canvas with the same ComputedStyle."

These attributes can then simply be described as "intrinsic size of the element", and we would refer to the "intrinsic size" concept again in the IDL for drawElementImage, because that's the size we will use if the optional destination size parameters are omitted.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The concept definition of "intrinsic size" could also contain polyfill code to compute it based on canvas.(width|height) and canvas.client(Width|Height) and element_style.(width|height)

// the same size as it would outside of canvas.
readonly attribute double width;
readonly attribute double height;

// value of `id` attribute on element, or the empty string
readonly attribute DOMString id;
Expand Down