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

feat: [#825] Attribute iframe.sandbox should return a DOMTokenList #1375

Merged
merged 5 commits into from
Apr 3, 2024

Conversation

jeffwcx
Copy link
Contributor

@jeffwcx jeffwcx commented Mar 31, 2024

According to the specifications:

https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-sandbox
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox

The sandbox attribute of the HTMLIFrameElement should return a DOMTokenList.

Additionally, although sandbox works like a regular DOMTokenList, it is checked after the attribute is set. If there are tokens that do not comply with the specification, an error message will be printed (but no error will be thrown).

There is a bug in DOMTokenList where, after setting the value, operations like sandbox[0] do not take effect. So we need an update of the indices.

@jeffwcx
Copy link
Contributor Author

jeffwcx commented Apr 2, 2024

Hi, @capricorn86 can you take a look?

Copy link
Owner

@capricorn86 capricorn86 left a comment

Choose a reason for hiding this comment

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

Thank you for contributing @jeffwcx! ⭐

I made some fixes to the solution. Attributes are updated through a NamedNodeMap. For this element the class HTMLIFrameElementNamedNodeMap is used and this is where the indices should be updated and the validation should happen.

@capricorn86 capricorn86 merged commit 75041b2 into capricorn86:master Apr 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants