mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
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:
parent
2eab9c6df1
commit
a028291466
35 changed files with 72 additions and 149 deletions
|
@ -26,6 +26,7 @@ use crate::dom::bindings::trace::CustomTraceable;
|
|||
use crate::dom::bindings::utils::define_all_exposed_interfaces;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::paintworkletglobalscope::{PaintWorkletGlobalScope, PaintWorkletTask};
|
||||
#[cfg(feature = "testbinding")]
|
||||
use crate::dom::testworkletglobalscope::{TestWorkletGlobalScope, TestWorkletTask};
|
||||
#[cfg(feature = "webgpu")]
|
||||
use crate::dom::webgpu::identityhub::IdentityHub;
|
||||
|
@ -60,6 +61,7 @@ impl WorkletGlobalScope {
|
|||
init: &WorkletGlobalScopeInit,
|
||||
) -> DomRoot<WorkletGlobalScope> {
|
||||
let scope: DomRoot<WorkletGlobalScope> = match scope_type {
|
||||
#[cfg(feature = "testbinding")]
|
||||
WorkletGlobalScopeType::Test => DomRoot::upcast(TestWorkletGlobalScope::new(
|
||||
runtime,
|
||||
pipeline_id,
|
||||
|
@ -163,6 +165,7 @@ impl WorkletGlobalScope {
|
|||
/// Perform a worklet task
|
||||
pub(crate) fn perform_a_worklet_task(&self, task: WorkletTask) {
|
||||
match task {
|
||||
#[cfg(feature = "testbinding")]
|
||||
WorkletTask::Test(task) => match self.downcast::<TestWorkletGlobalScope>() {
|
||||
Some(global) => global.perform_a_worklet_task(task),
|
||||
None => warn!("This is not a test worklet."),
|
||||
|
@ -203,6 +206,7 @@ pub(crate) struct WorkletGlobalScopeInit {
|
|||
#[derive(Clone, Copy, Debug, JSTraceable, MallocSizeOf)]
|
||||
pub(crate) enum WorkletGlobalScopeType {
|
||||
/// A servo-specific testing worklet
|
||||
#[cfg(feature = "testbinding")]
|
||||
Test,
|
||||
/// A paint worklet
|
||||
Paint,
|
||||
|
@ -210,6 +214,7 @@ pub(crate) enum WorkletGlobalScopeType {
|
|||
|
||||
/// A task which can be performed in the context of a worklet global.
|
||||
pub(crate) enum WorkletTask {
|
||||
#[cfg(feature = "testbinding")]
|
||||
Test(TestWorkletTask),
|
||||
Paint(PaintWorkletTask),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue