-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Take sizes from <img> if a <source> doesn't have a sizes attribute #6695
base: main
Are you sure you want to change the base?
Conversation
@@ -28722,9 +28723,15 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</code | |||
its value does not <span data-x="matches the environment">match the environment</span>, | |||
continue to the next child.</p></li> | |||
|
|||
<li><p><span data-x="parse a sizes attribute">Parse <var>child</var>'s sizes attribute</span> | |||
with the fallback width <var>width</var>, and let <var>source set</var>'s <span>source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "parse a sizes attribute" algorithm doesn't take a "fallback width" and there's no width variable in this algorithm. I assume this is left over from something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see #5900
<li><p>Let <var>sizesSource</var> be <var>el</var>.</p></li> | ||
|
||
<li><p>If <var>child</var> <span data-x="concept-element-attribute-has">has</span> an | ||
<span>attribute</span> whose <span>qualified name</span> is <code data-x="">"sizes"</code>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you should check the qualified name; it would pick up a namespaced attribute with that name (can be set with setAttributeNS()
). Also, link
's sizes attribute is named imagesizes
.
Say: If child has a sizes attribute present, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. I've changed this.
Fixes #6633 by allowing sizes data to come from the
<img>
if a particular sibling<source>
doesn't have asizes
attribute.(See WHATWG Working Mode: Changes for more details.)
/images.html ( diff )
/infrastructure.html ( diff )