Skip to content

script: move drop implementation to a separate struct from WebGLTexture (#26488)#44513

Merged
jdm merged 1 commit into
servo:mainfrom
willypuzzle:26488-Drop-impls-for-DOM-types-should-be-forbidden-WebGLTexture
Apr 28, 2026
Merged

script: move drop implementation to a separate struct from WebGLTexture (#26488)#44513
jdm merged 1 commit into
servo:mainfrom
willypuzzle:26488-Drop-impls-for-DOM-types-should-be-forbidden-WebGLTexture

Conversation

@willypuzzle

Copy link
Copy Markdown
Contributor

Move the drop logic for WebGLTexture into a new DroppableWebGLTexture struct, removing the allowDropImpl binding configuration. This also switches WebXR session and rendering context references to WeakRef to avoid cycles, and changes detach_texture to accept a WebGLTextureId directly instead of a &WebGLTexture reference.

Testing: WebGLTests should cover the related parts.
Fixes: Partially #26488

@willypuzzle willypuzzle requested a review from gterzian as a code owner April 26, 2026 15:58
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 26, 2026
Comment thread components/script/dom/webgl/webgltexture.rs
@willypuzzle willypuzzle force-pushed the 26488-Drop-impls-for-DOM-types-should-be-forbidden-WebGLTexture branch 3 times, most recently from 0a8e02c to 1aa6c4d Compare April 26, 2026 20:34
…re (servo#26488)

Move the drop logic for WebGLTexture into a new `DroppableWebGLTexture`
struct, removing the `allowDropImpl` binding configuration. This also
switches WebXR session and rendering context references to `WeakRef` to
avoid cycles, and changes `detach_texture` to accept a `WebGLTextureId`
directly instead of a `&WebGLTexture` reference.

Fixes: Partially servo#26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

script: add `must_root` lint attribute to `DroppableWebGLTexture`

Applies the `crown::unrooted_must_root_lint::must_root` annotation to `DroppableWebGLTexture` to enforce proper GC root safety for this DOM-adjacent type.

Fixes: Partially servo#26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
@willypuzzle willypuzzle force-pushed the 26488-Drop-impls-for-DOM-types-should-be-forbidden-WebGLTexture branch from 1aa6c4d to b78dfb0 Compare April 26, 2026 21:41
@willypuzzle

Copy link
Copy Markdown
Contributor Author

@jdm @sagudev what would you do with this?

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 28, 2026
@jdm jdm added this pull request to the merge queue Apr 28, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 28, 2026
Merged via the queue into servo:main with commit f2f47cd Apr 28, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 28, 2026
@willypuzzle willypuzzle deleted the 26488-Drop-impls-for-DOM-types-should-be-forbidden-WebGLTexture branch April 28, 2026 19:11
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.

4 participants