Skip to content

Port CanGC/InRealm methods to use &mut JSContext/CurrentRealm #42638

@sagudev

Description

@sagudev

In bindings.conf each "dom method" (the ones that are exposed in JS), have entries like this:

'CSSStyleSheet': {
'inRealms': ['Replace'],
'canGc': ['AddRule', 'DeleteRule', 'GetCssRules', 'GetRules', 'InsertRule', 'RemoveRule', 'Replace'],
},

that adds the type (CanGc or InRealm) to method.

To port to new model, we need to switch:

  • from InRealm to &mut CurrentRealm like done in this commit: 0132fc0
  • from CanGc to &mut JSContext like done in this commit: 36e5b32

Full demonstration PR is here: #42637

TASK: Select one file and port some methods, but please claim the file beforehand by writing a comment in this issue. If methods are used in other files feel free to skip them or make sure their users also get &mut JSContext (this is more advanced).

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-less-complexStraightforward. Recommended for a new contributor.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions