Don't build testbinding-related code by default (#37034)

Disabling the TestBinding-related bindings and implementations saves 2mb
in a release build. Also, we lost the related test preferences when we
turned the layout-2020 tests on, so the tests have all been failing for
a long time.

Testing: Existing tests in CI.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-05-17 10:14:19 +02:00 committed by GitHub
parent 2eab9c6df1
commit a028291466
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 72 additions and 149 deletions

View file

@ -27,6 +27,7 @@ use crate::dom::bindings::str::DOMString;
use crate::dom::document::{FakeRequestAnimationFrameCallback, RefreshRedirectDue};
use crate::dom::eventsource::EventSourceTimeoutCallback;
use crate::dom::globalscope::GlobalScope;
#[cfg(feature = "testbinding")]
use crate::dom::testbinding::TestBindingCallback;
use crate::dom::types::{Window, WorkerGlobalScope};
use crate::dom::xmlhttprequest::XHRTimeoutCallback;
@ -78,6 +79,7 @@ pub(crate) enum OneshotTimerCallback {
XhrTimeout(XHRTimeoutCallback),
EventSourceTimeout(EventSourceTimeoutCallback),
JsTimer(JsTimerTask),
#[cfg(feature = "testbinding")]
TestBindingCallback(TestBindingCallback),
FakeRequestAnimationFrame(FakeRequestAnimationFrameCallback),
RefreshRedirectDue(RefreshRedirectDue),
@ -89,6 +91,7 @@ impl OneshotTimerCallback {
OneshotTimerCallback::XhrTimeout(callback) => callback.invoke(can_gc),
OneshotTimerCallback::EventSourceTimeout(callback) => callback.invoke(),
OneshotTimerCallback::JsTimer(task) => task.invoke(this, js_timers, can_gc),
#[cfg(feature = "testbinding")]
OneshotTimerCallback::TestBindingCallback(callback) => callback.invoke(),
OneshotTimerCallback::FakeRequestAnimationFrame(callback) => callback.invoke(can_gc),
OneshotTimerCallback::RefreshRedirectDue(callback) => callback.invoke(can_gc),