Backport upstream cross-realm HTMLElement fix - #54
Open
hiroshisuga wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport part of the upstream tldraw cross-realm fix from: tldraw#6338
This also addresses the first proposed approach in the following BigBlueButton issue: bigbluebutton/bigbluebutton#25597
The current BBB tldraw fork uses a realm-sensitive check in loopToHtmlElement:
elm instanceof HTMLElementThis may fail when the element belongs to a different browser window, because each window has its own HTMLElement constructor.
This PR replaces that check with the realm-independent nodeType check already adopted upstream:
elm.nodeType === Node.ELEMENT_NODEThis makes the editor more robust when tldraw is rendered into a different window or document from the one in which its JavaScript is running. In BBB, it also allows the detached-presentation implementation to avoid replacing the main window's global HTMLElement constructor ( bigbluebutton/bigbluebutton#25461 ).
Change Type
patch— Bug fixminor— New featuremajor— Breaking changedependencies— Changes to package dependencies1documentation— Changes to the documentation only2tests— Changes to any test code only2internal— Any other changes that don't affect the published package2Test Plan
Release Notes
Footnotes
publishes a
patchrelease, for devDependencies useinternal↩will not publish a new version ↩ ↩2 ↩3