-
-
Notifications
You must be signed in to change notification settings - Fork 950
web: Polyfill document.embeds to return ruffle-embeds too #22449
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
base: master
Are you sure you want to change the base?
web: Polyfill document.embeds to return ruffle-embeds too #22449
Conversation
|
Can we add a polyfill test for it? |
|
Done |
web/packages/selfhosted/test/polyfill/document_embeds/expected.html
Outdated
Show resolved
Hide resolved
598d8f0 to
389d766
Compare
|
This breaks documen.embeds == document.embeds and probably other invariants. |
389d766 to
15592b4
Compare
Fixed in the latest commit |
cfe5234 to
59263f6
Compare
59263f6 to
8c820cf
Compare
web/packages/selfhosted/test/polyfill/document_embeds/index.html
Outdated
Show resolved
Hide resolved
3ccbcf9 to
3a506e8
Compare
|
LGTM, but would be great if someone else (that knows more about polyfilling) would also take a look at this |
7a8a34a to
02c65c7
Compare
| interface CachedCollection extends HTMLCollection { | ||
| [CACHE_SYM]?: true; | ||
| } | ||
| Object.defineProperty(Document.prototype, "embeds", { |
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 guess I have one more question: why doesn't it refer back to embeds for unknown keys?
Let's say that a website uses another extension (called foo) that makes some embeds work, and suppose it works similarly to Ruffle, changing embed to foo-embed. foo will also have to polyfill Document.embeds because of the same reasons, but by using the current approach those two polyfills will conflict with each other.
If I were to write this polyfill, I would assume that Document.embeds contains all non-Ruffle embeds, and then refer to it for length and unknown keys, at the same time making sure I don't polyfill it for the second time. Doesn't it make sense?
No description provided.