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

x/y/width/height attributes on HTML elements #247

Closed
zcorpan opened this issue Aug 25, 2016 · 3 comments
Closed

x/y/width/height attributes on HTML elements #247

zcorpan opened this issue Aug 25, 2016 · 3 comments

Comments

@zcorpan
Copy link
Member

zcorpan commented Aug 25, 2016

[[
‘canvas’
‘foreignObject’
‘iframe’
‘image’
‘video’
Let box be the tightest rectangle in coordinate space space that contains the positioning rectangle defined by the ‘x’, ‘y’, ‘width’ and ‘height’ geometric properties of the element.
...
]]
https://svgwg.org/svg2-draft/coords.html#ContainerElementBoudingBoxComputation

The HTML elements here do not have 'x' and 'y' attributes defined in HTML. Do you propose making them conforming for HTML?

How is the value taken from the 'width' and 'height' attributes for HTML elements? It could use the computed value from CSS (or some such), or use https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-dimension-values (can be error, percentage, or a length) if you want just the attribute and ignore any CSS...

Related
#240
whatwg/html#919

@AmeliaBR
Copy link
Contributor

No "geometric properties" are CSS properties, which is why that sentence was recently corrected!

For the SVG-namespaced elements, the geometric properties have equivalent presentation attributes, but for the HTML we are not proposing anything new.

The HTML width and height attributes will be expected to affect the CSS as defaults, same as they do in regular CSS/HTML layout.

I've just recently added a clarifying note to the Embedding chapter: https://svgwg.org/svg2-draft/embedded.html#Placement

I will need to change it to indicate that most of the HTML width/height attributes allow percentages. Canvas is the exception, because the attributes set the actual pixel size of the canvas.

Any other suggested changes?

@zcorpan
Copy link
Member Author

zcorpan commented Aug 25, 2016

Thanks!

I will need to change it to indicate that most of the HTML width/height attributes allow percentages.

That would only apply to implementors, not authors, since using percentages is non-conforming.

@AmeliaBR
Copy link
Contributor

since using percentages is non-conforming.

Ah, that explains my confusion. I think I'll skirt the issue and not mention them at all; it's only an informative note, with a link to the HTML spec for the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants