diff options
author | Josh Matthews <josh@joshmatthews.net> | 2025-05-24 23:21:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-25 03:21:05 +0000 |
commit | 3a04f4195eb650f092c44d5a05fee178b9e84fbe (patch) | |
tree | be0a28b7a0f7d0d678d1516a3e52db5de144d844 /tests/wpt/css-tests/css-multicol-1_dev/html4/reference/multicol-span-all-margin-nested-001-ref.htm | |
parent | 0d44ca8ddcea5399807abf0e3aef7b097133f679 (diff) | |
download | servo-main.tar.gz servo-main.zip |
DomObject::global is a tricky API because it's used pervasively but has
subtle requirements that are not documented and not yet enforced by the
type system (#36116). The method returns the relevant global object for
a given DOM object, but that operation is only meaningful if there is an
active realm. We usually, but not always, have an active realm.
This change avoids a footgun by following the principle of least
surprise. Rather than making every single caller of `something.global()`
both prove that there is an active realm and think about which realm
they want active, we implement the obvious behaviour: always activate
the realm of the callee before obtaining the relevant global.
Testing: Existing WPT coverage is sufficient; this method is called all
over the codebase.
Fixes: #37070 #27037
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'tests/wpt/css-tests/css-multicol-1_dev/html4/reference/multicol-span-all-margin-nested-001-ref.htm')
0 files changed, 0 insertions, 0 deletions