Skip to content

Backport upstream cross-realm HTMLElement fix - #54

Open
hiroshisuga wants to merge 1 commit into
bigbluebutton:mainfrom
hiroshisuga:patch-5
Open

Backport upstream cross-realm HTMLElement fix#54
hiroshisuga wants to merge 1 commit into
bigbluebutton:mainfrom
hiroshisuga:patch-5

Conversation

@hiroshisuga

@hiroshisuga hiroshisuga commented Aug 11, 2026

Copy link
Copy Markdown

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 HTMLElement
This 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_NODE
This 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 fix
  • minor — New feature
  • major — Breaking change
  • dependencies — Changes to package dependencies1
  • documentation — Changes to the documentation only2
  • tests — Changes to any test code only2
  • internal — Any other changes that don't affect the published package2
  • I don't know

Test Plan

  1. Build the @bigbluebutton/editor package with this change.
  2. Use the package in BigBlueButton with the presentation/whiteboard rendered into a separate browser window (for instance [3.0 feat] Detachable presentation, showing next slide and presenter's note bigbluebutton#25461 , which however still expects the replacement of the global HTMLElement constructor).
  3. Verify that tldraw elements can be selected, resized, and otherwise interacted with correctly without replacing the main window's HTMLElement constructor.
  4. Verify that the whiteboard continues to work normally when rendered in the main BBB window.
  • Unit Tests
  • End to end tests

Release Notes

  • Backport an upstream tldraw cross-realm fix so DOM elements from another browser window are recognized without relying on the global HTMLElement constructor.
  • This patch does not affect the behaviour of tldraw used in normal BBB releases.

Footnotes

  1. publishes a patch release, for devDependencies use internal

  2. will not publish a new version 2 3

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.

1 participant