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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add loading attribute to source elements #7237

Closed
wants to merge 1 commit into from

Conversation

pmeenan
Copy link
Contributor

@pmeenan pmeenan commented Oct 18, 2021

(work-in-process while platform tests are created and implementor positions are requested)
This addresses #7227


馃挜 Error: Wattsi server error 馃挜

PR Preview failed to build. (Last tried on Oct 18, 2021, 3:30 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

馃毃 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.

馃敆 Related URL

<html>
<head><title>524 Origin Time-out</title></head>
<body bgcolor="white">
<center><h1>524 Origin Time-out</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

As far as I can tell it isn't spelled out how to actually implement this feature (apart from its IDL attribute).

Also, you forgot to update the element index.

attribute is a <span>lazy loading attribute</span>. The <code>img</code> element can use the
<code data-x="attr-source-loading">loading</code> attribute of a <code>source</code> element,
instead of those on the <code>img</code> element itself, to determine its
<a href="#attr-img-loading">loading policy</a>.</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 don't see the processing model implications for this attribute spelled out elsewhere.

@annevk annevk added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: img labels Oct 22, 2021
@annevk
Copy link
Member

annevk commented Oct 22, 2021

Thanks for contributing this by the way! You'll have to sign https://participate.whatwg.org/agreement for us to be able to eventually merge this (pending the other checkboxes in OP).

@annevk
Copy link
Member

annevk commented Oct 22, 2021

cc @zcorpan @yoavweiss

@zcorpan
Copy link
Member

zcorpan commented Oct 22, 2021

I think the img element would need a new internal slot for the "current lazy loading policy" (feel free to bikeshed the name). Changes to the current lazy loading policy's value would be handled like the current changes to the img element's loading attribute's state.

Changing any of the loading attributes would re-evaluate the current lazy loading policy's value, so it can be changed if necessary.

The following places would also need to (re)-evaluate the current lazy loading policy:

@pmeenan
Copy link
Contributor Author

pmeenan commented Nov 10, 2021

Going to close this out for now. There's an existing way to do it that covers more scenarios without having to change the behavior of <picture>.

#7227 (comment)

@pmeenan pmeenan closed this Nov 10, 2021
@whatwg whatwg deleted a comment from berrylover03 Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: img
Development

Successfully merging this pull request may close these issues.

None yet

3 participants