Truly independent web browser
LibWeb: Remove the style FFI counters
Aliaksandr Kalenikc8d0019a48a5
diff --git a/Libraries/LibWeb/CSS/StyleValues/RustStyleValueHandle.h b/Libraries/LibWeb/CSS/StyleValues/RustStyleValueHandle.hindex 88bd097ebb5..4ebac63b02c 100644--- a/Libraries/LibWeb/CSS/StyleValues/RustStyleValueHandle.h+++ b/Libraries/LibWeb/CSS/StyleValues/RustStyleValueHandle.h@@ -13,8 +13,6 @@namespace Web::CSS {-inline thread_local bool g_style_ffi_counters_enabled { false };-// Shared handle to a Rust-allocated, immutable StyleValueData. The StyleValueData layout is// exposed through cbindgen, so reading through the handle is an inline field access with no FFI// call.@@ -26,8 +24,6 @@ public:: m_value(value){VERIFY(m_value);- if (g_style_ffi_counters_enabled)- StyleValueFFI::rust_style_ffi_note_style_value_created();}RustStyleValueHandle(RustStyleValueHandle const& other)diff --git a/Libraries/LibWeb/Internals/Internals.cpp b/Libraries/LibWeb/Internals/Internals.cppindex 9625991281c..44eaefe9ad2 100644--- a/Libraries/LibWeb/Internals/Internals.cpp+++ b/Libraries/LibWeb/Internals/Internals.cpp@@ -3125,21 +3125,6 @@ GC::Ref<JS::Object> Internals::compare_layout_tree_with_full_rebuild()return object;}-GC::Ref<JS::Object> Internals::style_ffi_counters()-{- auto object = JS::Object::create(window().principal_realm(), nullptr);- auto const counter_count = CSS::StyleValueFFI::rust_style_ffi_counter_count();- for (size_t index = 0; index < counter_count; ++index) {- auto const* name = reinterpret_cast<char const*>(CSS::StyleValueFFI::rust_style_ffi_counter_name(index));- auto const value = CSS::StyleValueFFI::rust_style_ffi_counter_value(index);- object->define_direct_property(- Utf16FlyString::from_utf8(StringView { name, strlen(name) }),- JS::Value(static_cast<double>(value)),- JS::default_attributes);- }- return object;-}-GC::Ref<JS::Object> Internals::style_memory_report(){auto& document = window().associated_document();@@ -3534,12 +3519,6 @@ Utf16String Internals::style_engine_matched_rules()return builder.to_string();}-void Internals::reset_style_ffi_counters()-{- CSS::g_style_ffi_counters_enabled = true;- CSS::StyleValueFFI::rust_style_ffi_counters_reset();-}-GC::Ref<JS::Object> Internals::style_group_sharing_info(DOM::Element& element){auto& realm = HTML::relevant_realm(window());diff --git a/Libraries/LibWeb/Internals/Internals.h b/Libraries/LibWeb/Internals/Internals.hindex 7006b4d97d6..1c25cdda8c2 100644--- a/Libraries/LibWeb/Internals/Internals.h+++ b/Libraries/LibWeb/Internals/Internals.h@@ -343,7 +343,6 @@ public:GC::Ref<JS::Object> layout_tree_build_stats();GC::Ref<JS::Object> compare_layout_tree_with_full_rebuild();GC::Ref<JS::Object> computed_values_stats();- GC::Ref<JS::Object> style_ffi_counters();GC::Ref<JS::Object> style_engine_counters();GC::Ref<JS::Object> style_memory_report();u64 style_memory_of_frames();@@ -360,7 +359,6 @@ public:void reset_style_counters();GC::Ref<JS::Object> style_last_pass();Utf16String style_engine_matched_rules();- void reset_style_ffi_counters();GC::Ref<JS::Object> style_group_sharing_info(DOM::Element&);void update_style();void set_user_style(Utf16String const& source);diff --git a/Libraries/LibWeb/Internals/Internals.idl b/Libraries/LibWeb/Internals/Internals.idlindex f9d321db23c..9a573068f4c 100644--- a/Libraries/LibWeb/Internals/Internals.idl+++ b/Libraries/LibWeb/Internals/Internals.idl@@ -434,9 +434,6 @@ interface Internals {// Keys: liveComputedValues, totalComputedValuesCreated,// retainedLegacyComputedPropertyArrayHolders, retainedLegacyComputedPropertyArrayBytes.object computedValuesStats();- // Returns a snapshot of the process-wide style FFI boundary counters: one key per boundary- // operation, counting calls into the Rust style core and callbacks it makes into C++.- object styleFfiCounters();object styleEngineCounters();// What the document's style engine holds on the heap, by owner, with the C++ style state its elements hold:// { owners: { name: bytes }, elements, styledElements }.@@ -475,7 +472,6 @@ interface Internals {object styleLastPass();// Reports a snapshot of StyleEngine's matched rules for the whole document.DOMString styleEngineMatchedRules();- undefined resetStyleFfiCounters();// Returns, for each ComputedValues style value group of the given element, whether the// group payload is shared with the parent element, whether it is the default payload,// and its identity for comparisons while the computed style remains alive.diff --git a/Libraries/LibWeb/Rust/src/css/animation.rs b/Libraries/LibWeb/Rust/src/css/animation.rsindex 2f1f06cc8e9..81022a5fdc0 100644--- a/Libraries/LibWeb/Rust/src/css/animation.rs+++ b/Libraries/LibWeb/Rust/src/css/animation.rs@@ -9227,7 +9227,6 @@ fn snap_animated_border_width(/// Answers the final value of each custom property the effects animate, by the number it animates/// under, in that order.pub(crate) fn evaluate_animations(batch: ComputedAnimationBatch<'_>) -> Vec<(u32, RetainedStyleValueData)> {- crate::css::ffi_stats::note_animation_evaluation();let ComputedAnimationBatch {context: sample_context,device_pixels_per_css_pixel,diff --git a/Libraries/LibWeb/Rust/src/css/cascaded_properties.rs b/Libraries/LibWeb/Rust/src/css/cascaded_properties.rsindex 01f7a13f423..9990764bae0 100644--- a/Libraries/LibWeb/Rust/src/css/cascaded_properties.rs+++ b/Libraries/LibWeb/Rust/src/css/cascaded_properties.rs@@ -348,7 +348,6 @@ pub(crate) fn parse_substituted_value(values: &[ComponentValue],contains_attr_tainted_values: bool,) -> RetainedStyleValueData {- crate::css::ffi_stats::bump(crate::css::ffi_stats::FfiOp::SubstitutionParse);// NB: Substitution can nest components deeper than text may, which no value holds.if crate::css::parser::component_value::exceeds_component_value_nesting_limit(values) {return RetainedStyleValueData::from_owned(StyleValueData::GuaranteedInvalid);diff --git a/Libraries/LibWeb/Rust/src/css/ffi_stats.rs b/Libraries/LibWeb/Rust/src/css/ffi_stats.rsindex 93bd1df43bc..4bd727fc9a6 100644--- a/Libraries/LibWeb/Rust/src/css/ffi_stats.rs+++ b/Libraries/LibWeb/Rust/src/css/ffi_stats.rs@@ -4,52 +4,11 @@* SPDX-License-Identifier: BSD-2-Clause*/-//! Counters for the style system's FFI boundary crossings.-//!-//! Every entry point into the Rust style core and every callback it makes into-//! C++ bumps one counter, grouped by operation rather than by symbol. The-//! counters measure how coarse the boundary is (calls per element, per-//! declaration, per longhand) so that boundary-removal work can compare-//! before/after counts on deterministic workloads. Reading and resetting is-//! exposed to C++ for the `internals.styleFfiCounters()` test surface.-//!-//! The counters are always compiled in but disabled until reset, so the hot path-//! remains one relaxed atomic load per crossing.+//! C++ releases that the style core defers until a complete style update ends, and, in unit tests, counts of the+//! callbacks the core makes into C++.use std::cell::RefCell;-use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};-macro_rules! define_ffi_ops {- ($($variant:ident => $name:literal,)+) => {- /// One countable boundary operation. Entries are C++ calls into the- /// Rust core; callbacks are calls the core makes back into C++.- #[derive(Clone, Copy)]- #[repr(usize)]- pub(crate) enum FfiOp {- $($variant,)+- }-- const FFI_OP_COUNT: usize = 0 $(+ { let _ = FfiOp::$variant; 1 })+;-- /// Nul-terminated so the name can cross the FFI as a C string.- static FFI_OP_NAMES: [&str; FFI_OP_COUNT] = [$(concat!($name, "\0"),)+];- };-}--define_ffi_ops! {- // Entries: C++ -> Rust.- StyleValueCreateEntry => "styleValueCreateEntries",- AnimationKeyframeLonghandEntry => "animationKeyframeLonghandEntries",- AnimationEvaluationEntry => "animationEvaluationEntries",- TransitionDecisionEntry => "transitionDecisionEntries",- SubstitutionParse => "substitutionParses",- SizesAttributeParseEntry => "sizesAttributeParseEntries",- // Ownership callbacks: Rust -> C++.- StringRetainReleaseCallback => "stringRetainReleaseCallbacks",-}--static COUNTS: [AtomicU64; FFI_OP_COUNT] = [const { AtomicU64::new(0) }; FFI_OP_COUNT];-static COUNTERS_ENABLED: AtomicBool = AtomicBool::new(false);#[cfg(test)]thread_local! {pub(crate) static CPP_CALLBACK_COUNT: std::cell::Cell<u64> = const { std::cell::Cell::new(0) };@@ -98,25 +57,6 @@ unsafe extern "C" {fn ladybird_utf16_fly_string_unref(raw: usize);}-#[inline]-pub(crate) fn bump(op: FfiOp) {- if COUNTERS_ENABLED.load(Ordering::Relaxed) {- COUNTS[op as usize].fetch_add(1, Ordering::Relaxed);- }-}--#[inline]-pub(crate) fn bump_cpp_callback(op: FfiOp) {- #[cfg(test)]- {- CPP_CALLBACK_COUNT.set(CPP_CALLBACK_COUNT.get() + 1);- if !matches!(op, FfiOp::StringRetainReleaseCallback) {- THREAD_UNSAFE_CPP_CALLBACK_COUNT.set(THREAD_UNSAFE_CPP_CALLBACK_COUNT.get() + 1);- }- }- bump(op);-}-pub(crate) fn release_utf16_fly_string(raw: usize) {let deferred = COMPLETE_STYLE_UPDATE_STATE.with(|state| {let mut state = state.borrow_mut();@@ -129,7 +69,8 @@ pub(crate) fn release_utf16_fly_string(raw: usize) {if deferred {return;}- bump_cpp_callback(FfiOp::StringRetainReleaseCallback);+ #[cfg(test)]+ CPP_CALLBACK_COUNT.set(CPP_CALLBACK_COUNT.get() + 1);unsafe { ladybird_utf16_fly_string_unref(raw) };}@@ -185,45 +126,3 @@ pub extern "C" fn rust_deferred_cpp_releases_clear() {state.has_outstanding_view = false;});}--/// Returns the number of FFI boundary counters.-#[unsafe(no_mangle)]-pub extern "C" fn rust_style_ffi_counter_count() -> usize {- FFI_OP_COUNT-}--/// Returns the nul-terminated name of the counter at `index`.-#[unsafe(no_mangle)]-pub extern "C" fn rust_style_ffi_counter_name(index: usize) -> *const u8 {- FFI_OP_NAMES[index].as_ptr()-}--/// Returns the current value of the counter at `index`.-#[unsafe(no_mangle)]-pub extern "C" fn rust_style_ffi_counter_value(index: usize) -> u64 {- COUNTS[index].load(Ordering::Relaxed)-}--/// Resets every counter to zero.-#[unsafe(no_mangle)]-pub extern "C" fn rust_style_ffi_counters_reset() {- for count in &COUNTS {- count.store(0, Ordering::Relaxed);- }- COUNTERS_ENABLED.store(true, Ordering::Relaxed);-}--/// Notes the adoption of a Rust style value allocation by a C++ shell; called-/// from the C++ side where shell construction funnels through one place.-#[unsafe(no_mangle)]-pub extern "C" fn rust_style_ffi_note_style_value_created() {- bump(FfiOp::StyleValueCreateEntry);-}--pub(crate) fn note_animation_evaluation() {- bump(FfiOp::AnimationEvaluationEntry);-}--pub(crate) fn note_transition_decision() {- bump(FfiOp::TransitionDecisionEntry);-}diff --git a/Libraries/LibWeb/Rust/src/css/parser/query_parser.rs b/Libraries/LibWeb/Rust/src/css/parser/query_parser.rsindex 2889db537d2..1616d4a73af 100644--- a/Libraries/LibWeb/Rust/src/css/parser/query_parser.rs+++ b/Libraries/LibWeb/Rust/src/css/parser/query_parser.rs@@ -2972,7 +2972,6 @@ pub unsafe extern "C" fn rust_parse_sizes_attribute(media_environment: Option<&FfiMediaEnvironment<'_>>,img_auto_width: Option<&f64>,) -> *const c_void {- crate::css::ffi_stats::bump(crate::css::ffi_stats::FfiOp::SizesAttributeParseEntry);let Some(source) = source.units() else {return std::ptr::null();};diff --git a/Libraries/LibWeb/Rust/src/css/style/engine_calls.rs b/Libraries/LibWeb/Rust/src/css/style/engine_calls.rsindex 4d978233a9f..bdc043bae22 100644--- a/Libraries/LibWeb/Rust/src/css/style/engine_calls.rs+++ b/Libraries/LibWeb/Rust/src/css/style/engine_calls.rs@@ -1601,7 +1601,6 @@ pub unsafe extern "C" fn style_engine_decide_transitions(on_actions: unsafe extern "C" fn(*mut c_void, *const FfiTransitionAction, usize),context: *mut c_void,) {- crate::css::ffi_stats::note_transition_decision();// SAFETY: Guaranteed by the caller.let existing = unsafe { ak::slice_from_raw_parts(input.existing_transitions, input.existing_transition_count) };// SAFETY: As above.diff --git a/Libraries/LibWeb/Rust/src/css/style_compute.rs b/Libraries/LibWeb/Rust/src/css/style_compute.rsindex 997353c6cfe..d5f953f644a 100644--- a/Libraries/LibWeb/Rust/src/css/style_compute.rs+++ b/Libraries/LibWeb/Rust/src/css/style_compute.rs@@ -6194,7 +6194,6 @@ pub(crate) fn compute_animation_keyframe_longhands(length_contexts: &FfiAnimationLengthContexts,custom_property_values: &[Option<RetainedStyleValueData>],) -> AnimationKeyframeLonghands {- crate::css::ffi_stats::bump(crate::css::ffi_stats::FfiOp::AnimationKeyframeLonghandEntry);use crate::css::property_metadata::{FIRST_LONGHAND_PROPERTY_ID, LAST_LONGHAND_PROPERTY_ID, NUMBER_OF_LONGHAND_PROPERTIES,};diff --git a/Meta/Linters/check_rust_process_wide_state.py b/Meta/Linters/check_rust_process_wide_state.pyindex a6f74b120ef..244fa5fec52 100755--- a/Meta/Linters/check_rust_process_wide_state.py+++ b/Meta/Linters/check_rust_process_wide_state.py@@ -89,8 +89,6 @@ RENDER_STATE_ALLOWED = {DIAGNOSTIC,["css/ffi_stats.rs:COMPLETE_STYLE_UPDATE_STATE",- "css/ffi_stats.rs:COUNTERS_ENABLED",- "css/ffi_stats.rs:COUNTS","css/ffi_stats.rs:CPP_CALLBACK_COUNT","css/ffi_stats.rs:THREAD_UNSAFE_CPP_CALLBACK_COUNT",],diff --git a/Meta/style-update-capture.py b/Meta/style-update-capture.pyindex 2b63f690e20..5b9b3abdcee 100755--- a/Meta/style-update-capture.py+++ b/Meta/style-update-capture.py@@ -294,7 +294,7 @@ def normalize(sample):def fixture_run(browser, scenario, seed):browser.command("url", {"url": "about:blank"})- browser.script("internals.resetStyleFfiCounters(); internals.updateStyle();")+ browser.script("internals.updateStyle();")before = browser.resources()setup = browser.script(FIXTURE.read_text()diff --git a/Tests/LibWeb/TestCSSSyntaxParser.cpp b/Tests/LibWeb/TestCSSSyntaxParser.cppindex d3b0617994c..a98bedc0c87 100644--- a/Tests/LibWeb/TestCSSSyntaxParser.cpp+++ b/Tests/LibWeb/TestCSSSyntaxParser.cpp@@ -45,7 +45,6 @@ TEST_CASE(native_import_resource_owner_retains_rules_without_cssom)TEST_CASE(native_rule_lists_own_live_payloads_and_child_order){- StyleValueFFI::rust_style_ffi_counters_reset();IGNORE_USE_IN_ESCAPING_LAMBDA ValueParserFFI::NativeRuleList const* root = nullptr;auto thread = Threading::Thread::construct("CSS native rule owners"sv, [&] {ValueParserFFI::ParseContext context {};@@ -56,12 +55,6 @@ TEST_CASE(native_rule_lists_own_live_payloads_and_child_order)});thread->start();MUST(thread->join());- for (size_t index = 0; index < StyleValueFFI::rust_style_ffi_counter_count(); ++index) {- auto const* name_data = reinterpret_cast<char const*>(StyleValueFFI::rust_style_ffi_counter_name(index));- auto name = StringView { name_data, strlen(name_data) };- if (name == "stringRetainReleaseCallbacks"sv)- EXPECT_EQ(StyleValueFFI::rust_style_ffi_counter_value(index), 0u);- }auto* retained = ValueParserFFI::rust_rule_list_retain(root);RustRule media { ValueParserFFI::rust_rule_list_at(root, 0) };@@ -368,7 +361,6 @@ TEST_CASE(style_engine_consumes_native_inline_declaration_blocks)auto shared = declarations.share();auto transitions = parse_native_declaration_block(u"transition-duration: 1s"sv);auto retained = declarations.retain();- StyleValueFFI::rust_style_ffi_counters_reset();engine.set_element_inline_style_properties(node, declarations.handle());EXPECT(!engine.css_transitions_may_observe_style_changes());engine.set_element_inline_style_properties(node, shared.handle());@@ -376,12 +368,6 @@ TEST_CASE(style_engine_consumes_native_inline_declaration_blocks)declarations.replace(transitions);engine.set_element_inline_style_properties(node, retained.handle());EXPECT(engine.css_transitions_may_observe_style_changes());- for (size_t index = 0; index < StyleValueFFI::rust_style_ffi_counter_count(); ++index) {- auto const* name_data = reinterpret_cast<char const*>(StyleValueFFI::rust_style_ffi_counter_name(index));- auto name = StringView { name_data, strlen(name_data) };- if (name == "stringRetainReleaseCallbacks"sv)- EXPECT_EQ(StyleValueFFI::rust_style_ffi_counter_value(index), 0u);- }}TEST_CASE(style_engine_expands_presentation_hint_shorthands_in_rust)diff --git a/Tests/LibWeb/Text/expected/HTML/sizes-attribute-parsing.txt b/Tests/LibWeb/Text/expected/HTML/sizes-attribute-parsing.txtindex 015cb5a7979..8a07c75db72 100644--- a/Tests/LibWeb/Text/expected/HTML/sizes-attribute-parsing.txt+++ b/Tests/LibWeb/Text/expected/HTML/sizes-attribute-parsing.txt@@ -6,4 +6,3 @@ bare non-final length: 40math function: 40non-finite math: 60non-math function: 60-sizes attribute parser observed: truediff --git a/Tests/LibWeb/Text/expected/css/animation-effect-batch-rust.txt b/Tests/LibWeb/Text/expected/css/animation-effect-batch-rust.txtindex 5385bd9c5fe..221a89fdd83 100644--- a/Tests/LibWeb/Text/expected/css/animation-effect-batch-rust.txt+++ b/Tests/LibWeb/Text/expected/css/animation-effect-batch-rust.txt@@ -1,14 +1,8 @@opacity: 0.5width: 20pxcolor: rgb(128, 128, 128)-animation evaluations: 1-keyframe longhand drives: 1resampled opacity: 0.6resampled width: 25pxresampled color: rgb(191, 191, 191)-resample animation evaluations: 1-resample keyframe longhand drives: 0base-mutated width: 125px-base mutation longhand drives: 1mutated width: 135px-keyframe mutation longhand drives: 1diff --git a/Tests/LibWeb/Text/expected/css/ffi-parse-counters.txt b/Tests/LibWeb/Text/expected/css/ffi-parse-counters.txtdeleted file mode 100644index 40c99683f64..00000000000--- a/Tests/LibWeb/Text/expected/css/ffi-parse-counters.txt+++ /dev/null@@ -1 +0,0 @@-computed width: 1pxdiff --git a/Tests/LibWeb/Text/expected/css/native-cascade-declaration-ownership.txt b/Tests/LibWeb/Text/expected/css/native-cascade-declaration-ownership.txtindex 7f93f85d66a..aa7cad4ec82 100644--- a/Tests/LibWeb/Text/expected/css/native-cascade-declaration-ownership.txt+++ b/Tests/LibWeb/Text/expected/css/native-cascade-declaration-ownership.txt@@ -1,4 +1,3 @@-installation creates no value facades: truenative declarations: 13px, 17px, 0.37retained owner observes mutation: 23pxretained owner observes replacement: 31px, 41pxdiff --git a/Tests/LibWeb/Text/expected/css/native-var-substitution.txt b/Tests/LibWeb/Text/expected/css/native-var-substitution.txtindex bb37c51005b..76bc256aa59 100644--- a/Tests/LibWeb/Text/expected/css/native-var-substitution.txt+++ b/Tests/LibWeb/Text/expected/css/native-var-substitution.txt@@ -3,10 +3,7 @@ height: 7pxcycle fallback: 3pxfallback inside cycle ignored: rgb(255, 0, 0)fallback outside cycle used: rgb(0, 0, 255)-native substitution parses: trueregistered width: 9pxunregistered height: 11pxregistered universal initial: 13px-registered substitution parses: truestring-bearing family: LadybirdCallbackFallback-string-bearing substitution parses: truediff --git a/Tests/LibWeb/Text/expected/css/transition-effect-batch-rust.txt b/Tests/LibWeb/Text/expected/css/transition-effect-batch-rust.txtindex 5554e8d5e62..78fd26a9d93 100644--- a/Tests/LibWeb/Text/expected/css/transition-effect-batch-rust.txt+++ b/Tests/LibWeb/Text/expected/css/transition-effect-batch-rust.txt@@ -1,4 +1,2 @@opacity: 0width: 10px-transition decisions: 1-animation evaluations: 1diff --git a/Tests/LibWeb/Text/input/HTML/sizes-attribute-parsing.html b/Tests/LibWeb/Text/input/HTML/sizes-attribute-parsing.htmlindex 88f26114a94..783cfe897a7 100644--- a/Tests/LibWeb/Text/input/HTML/sizes-attribute-parsing.html+++ b/Tests/LibWeb/Text/input/HTML/sizes-attribute-parsing.html@@ -16,8 +16,6 @@});}- internals.resetStyleFfiCounters();-println(`direct length: ${await parsedSourceSize("60px")}`);println(`true condition: ${await parsedSourceSize("(min-width: 0px) 40px, 60px")}`);println(`false condition: ${await parsedSourceSize("(width < 0px) 40px, 60px")}`);@@ -26,7 +24,5 @@println(`math function: ${await parsedSourceSize("calc(20px + 20px), 60px")}`);println(`non-finite math: ${await parsedSourceSize("calc(1px / 0), 60px")}`);println(`non-math function: ${await parsedSourceSize("foo(40px), 60px")}`);- const counters = internals.styleFfiCounters();- println(`sizes attribute parser observed: ${counters.sizesAttributeParseEntries > 0}`);});</script>diff --git a/Tests/LibWeb/Text/input/css/animation-effect-batch-rust.html b/Tests/LibWeb/Text/input/css/animation-effect-batch-rust.htmlindex b3f58b8b461..375fb6918f8 100644--- a/Tests/LibWeb/Text/input/css/animation-effect-batch-rust.html+++ b/Tests/LibWeb/Text/input/css/animation-effect-batch-rust.html@@ -27,41 +27,26 @@animation.currentTime = 50;}- internals.resetStyleFfiCounters();internals.updateStyle();- const counters = internals.styleFfiCounters();const style = getComputedStyle(target);println(`opacity: ${style.opacity}`);println(`width: ${style.width}`);println(`color: ${style.color}`);- println(`animation evaluations: ${counters.animationEvaluationEntries}`);- println(`keyframe longhand drives: ${counters.animationKeyframeLonghandEntries}`);-for (const animation of animations)animation.currentTime = 75;- internals.resetStyleFfiCounters();internals.updateStyle();- const resampleCounters = internals.styleFfiCounters();println(`resampled opacity: ${style.opacity}`);println(`resampled width: ${style.width}`);println(`resampled color: ${style.color}`);- println(`resample animation evaluations: ${resampleCounters.animationEvaluationEntries}`);- println(`resample keyframe longhand drives: ${resampleCounters.animationKeyframeLonghandEntries}`);target.style.width = "100px";- internals.resetStyleFfiCounters();internals.updateStyle();- const baseMutationCounters = internals.styleFfiCounters();println(`base-mutated width: ${style.width}`);- println(`base mutation longhand drives: ${baseMutationCounters.animationKeyframeLonghandEntries}`);animations[2].effect.setKeyframes({ width: ["20px", "40px"] });- internals.resetStyleFfiCounters();internals.updateStyle();- const keyframeMutationCounters = internals.styleFfiCounters();println(`mutated width: ${style.width}`);- println(`keyframe mutation longhand drives: ${keyframeMutationCounters.animationKeyframeLonghandEntries}`);});</script>diff --git a/Tests/LibWeb/Text/input/css/calculated-animation-rust.html b/Tests/LibWeb/Text/input/css/calculated-animation-rust.htmlindex 7dabbf2d67a..52e900bb950 100644--- a/Tests/LibWeb/Text/input/css/calculated-animation-rust.html+++ b/Tests/LibWeb/Text/input/css/calculated-animation-rust.html@@ -36,7 +36,6 @@additiveAnimation.pause();additiveAnimation.currentTime = 50;- internals.resetStyleFfiCounters();internals.updateStyle();const style = getComputedStyle(target);println(`width: ${style.width}`);diff --git a/Tests/LibWeb/Text/input/css/discrete-animation-rust.html b/Tests/LibWeb/Text/input/css/discrete-animation-rust.htmlindex 9931392e710..1c29d6e1edd 100644--- a/Tests/LibWeb/Text/input/css/discrete-animation-rust.html+++ b/Tests/LibWeb/Text/input/css/discrete-animation-rust.html@@ -12,7 +12,6 @@const animation = target.animate({ alignContent: ["normal", "center"] }, 100);animation.pause();- internals.resetStyleFfiCounters();animation.currentTime = 25;println(getComputedStyle(target).alignContent);diff --git a/Tests/LibWeb/Text/input/css/ffi-parse-counters.html b/Tests/LibWeb/Text/input/css/ffi-parse-counters.htmldeleted file mode 100644index 14b513e2d54..00000000000--- a/Tests/LibWeb/Text/input/css/ffi-parse-counters.html+++ /dev/null@@ -1,60 +0,0 @@-<!DOCTYPE html>-<script src="../include.js"></script>-<script>- test(() => {- const rules = [];- for (let index = 0; index < 64; ++index) {- rules.push(`- .ffi-rule-${index}:is(.enabled, [data-index="${index}"]) {- color: rgb(${index}, ${index + 1}, ${index + 2});- margin: ${index}px;- font-family: "FFI Family ${index}", sans-serif;- --ffi-size: if(media((width >= 0px)): ${index + 1}px; else: 1px);- width: var(--ffi-size);- -webkit-ffi-baseline: ignored;- }- `);- }-- const source = `- @font-face {- font-family: "FFI Baseline";- src: url("data:font/woff2;base64,d09GMg==") format("woff2") tech(variations);- }- @counter-style ffi-counter {- system: cyclic;- symbols: "a" "b";- pad: calc(sign(1em - 1px) + 1) "0";- }- @media screen and (min-width: 0px) {- .ffi-media { display: grid; }- }- @supports (display: grid) and selector(.ffi-supports:is(div, span)) {- .ffi-supports { padding: 1px; }- }- @supports font-format(woff2) and font-tech(variations) {- .ffi-font-support { border-width: 1px; }- }- @container (width > 0px) {- .ffi-container { height: 2px; }- }- .ffi-path {- clip-path: path("M 0 0 L 10 10 Z");- }- ${rules.join("\n")}- `;-- internals.updateStyle();- internals.resetStyleFfiCounters();-- const sheet = new CSSStyleSheet();- sheet.replaceSync(source);- document.adoptedStyleSheets = [sheet];-- const target = document.createElement("div");- target.className = "ffi-rule-0 enabled ffi-path ffi-media ffi-supports ffi-font-support ffi-container";- target.dataset.index = "0";- document.body.appendChild(target);- println(`computed width: ${getComputedStyle(target).width}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/filter-animation-rust.html b/Tests/LibWeb/Text/input/css/filter-animation-rust.htmlindex cdc6df7e597..25a0a6e6173 100644--- a/Tests/LibWeb/Text/input/css/filter-animation-rust.html+++ b/Tests/LibWeb/Text/input/css/filter-animation-rust.html@@ -9,8 +9,6 @@<script src="../include.js"></script><script>test(() => {- internals.resetStyleFfiCounters();-const filterAnimation = target.animate({filter: [@@ -33,6 +31,5 @@backdropFilterAnimation.currentTime = 50;println(getComputedStyle(target).backdropFilter);backdropFilterAnimation.cancel();-});</script>diff --git a/Tests/LibWeb/Text/input/css/font-feature-settings-computed.html b/Tests/LibWeb/Text/input/css/font-feature-settings-computed.htmlindex 821e42de27a..088dea5cabf 100644--- a/Tests/LibWeb/Text/input/css/font-feature-settings-computed.html+++ b/Tests/LibWeb/Text/input/css/font-feature-settings-computed.html@@ -7,7 +7,6 @@test(() => {const target = document.getElementById("target");internals.updateStyle();- internals.resetStyleFfiCounters();for (const value of ['"liga" 1, "kern" 1','"kern" 1, "liga" 0, "kern" 0',diff --git a/Tests/LibWeb/Text/input/css/if-condition-ffi-counters.html b/Tests/LibWeb/Text/input/css/if-condition-ffi-counters.htmlindex fe956f936dd..b0b7ad2d9ce 100644--- a/Tests/LibWeb/Text/input/css/if-condition-ffi-counters.html+++ b/Tests/LibWeb/Text/input/css/if-condition-ffi-counters.html@@ -10,7 +10,6 @@`;document.body.appendChild(target);- internals.resetStyleFfiCounters();println(`${name} result: ${getComputedStyle(target).width}`);target.remove();}@@ -27,7 +26,6 @@document.body.appendChild(target);}- internals.resetStyleFfiCounters();internals.updateStyle();println(`shared results: ${targets.map(target => getComputedStyle(target).width).join(", ")}`);targets.forEach(target => target.remove());diff --git a/Tests/LibWeb/Text/input/css/math-depth-absolutization.html b/Tests/LibWeb/Text/input/css/math-depth-absolutization.htmlindex 9b3a0b9f9b2..42ef962a4cf 100644--- a/Tests/LibWeb/Text/input/css/math-depth-absolutization.html+++ b/Tests/LibWeb/Text/input/css/math-depth-absolutization.html@@ -24,7 +24,6 @@<script src="../include.js"></script><script>test(() => {- internals.resetStyleFfiCounters();internals.updateStyle();println(getComputedStyle(foo).mathDepth);println(getComputedStyle(bar).mathDepth);diff --git a/Tests/LibWeb/Text/input/css/math-depth-relative-lengths-in-calc.html b/Tests/LibWeb/Text/input/css/math-depth-relative-lengths-in-calc.htmlindex 16a6946a842..682bcedb6f5 100644--- a/Tests/LibWeb/Text/input/css/math-depth-relative-lengths-in-calc.html+++ b/Tests/LibWeb/Text/input/css/math-depth-relative-lengths-in-calc.html@@ -23,7 +23,6 @@<script src="../include.js"></script><script>test(() => {- internals.resetStyleFfiCounters();internals.updateStyle();println(getComputedStyle(bar).mathDepth);println(getComputedStyle(baz).mathDepth);diff --git a/Tests/LibWeb/Text/input/css/modern-color-animation-rust.html b/Tests/LibWeb/Text/input/css/modern-color-animation-rust.htmlindex a1ee02bd010..578416edfe1 100644--- a/Tests/LibWeb/Text/input/css/modern-color-animation-rust.html+++ b/Tests/LibWeb/Text/input/css/modern-color-animation-rust.html@@ -14,7 +14,6 @@}test(() => {- internals.resetStyleFfiCounters();sample("color(srgb 0 0 0)", "color(srgb 1 1 1)");sample("oklab(none 0.2 0.3)", "oklab(0.5 0.6 0.7)");sample("oklab(none 0.2 0.3 / none)", "oklab(none 0.6 0.7 / none)");diff --git a/Tests/LibWeb/Text/input/css/native-animation-name-computation.html b/Tests/LibWeb/Text/input/css/native-animation-name-computation.htmlindex 5f62ad758c4..093d4465eb6 100644--- a/Tests/LibWeb/Text/input/css/native-animation-name-computation.html+++ b/Tests/LibWeb/Text/input/css/native-animation-name-computation.html@@ -7,7 +7,6 @@const target = document.createElement("div");target.style.animationName = '"something", "none", "initial", foo, "multi word string"';- internals.resetStyleFfiCounters();document.body.appendChild(target);internals.updateStyle();diff --git a/Tests/LibWeb/Text/input/css/native-background-list-coordination.html b/Tests/LibWeb/Text/input/css/native-background-list-coordination.htmlindex a1fcab89019..390661f1403 100644--- a/Tests/LibWeb/Text/input/css/native-background-list-coordination.html+++ b/Tests/LibWeb/Text/input/css/native-background-list-coordination.html@@ -15,7 +15,6 @@background-size: 30px auto;`;- internals.resetStyleFfiCounters();document.body.appendChild(target);internals.updateStyle();@@ -32,7 +31,6 @@println(`${property}: ${computedStyle.getPropertyValue(property)}`);}- internals.resetStyleFfiCounters();target.style.backgroundPosition = "20px 30px";internals.updateStyle();diff --git a/Tests/LibWeb/Text/input/css/native-border-width-computation.html b/Tests/LibWeb/Text/input/css/native-border-width-computation.htmlindex f03878a65bb..c9998de3416 100644--- a/Tests/LibWeb/Text/input/css/native-border-width-computation.html+++ b/Tests/LibWeb/Text/input/css/native-border-width-computation.html@@ -16,7 +16,6 @@outline-width: calc(4px - 0.5px);`;- internals.resetStyleFfiCounters();document.body.appendChild(target);internals.updateStyle();diff --git a/Tests/LibWeb/Text/input/css/native-cascade-declaration-ownership.html b/Tests/LibWeb/Text/input/css/native-cascade-declaration-ownership.htmlindex 168ee2b072b..3897ab76c18 100644--- a/Tests/LibWeb/Text/input/css/native-cascade-declaration-ownership.html+++ b/Tests/LibWeb/Text/input/css/native-cascade-declaration-ownership.html@@ -6,9 +6,7 @@getComputedStyle(document.body).width;const style = document.createElement("style");style.textContent = ".native-target { width: 13px; height: 17px; opacity: 0.37; }";- internals.resetStyleFfiCounters();document.head.append(style);- println(`installation creates no value facades: ${internals.styleFfiCounters().styleValueCreateEntries === 0}`);target.className = "native-target";println(`native declarations: ${getComputedStyle(target).width}, ${getComputedStyle(target).height}, ${getComputedStyle(target).opacity}`);diff --git a/Tests/LibWeb/Text/input/css/native-container-relative-length-computation.html b/Tests/LibWeb/Text/input/css/native-container-relative-length-computation.htmlindex 92979305dd9..31db0a38fbb 100644--- a/Tests/LibWeb/Text/input/css/native-container-relative-length-computation.html+++ b/Tests/LibWeb/Text/input/css/native-container-relative-length-computation.html@@ -23,7 +23,6 @@test(() => {const viewportFallback = document.getElementById("viewport-fallback");getComputedStyle(container).width;- internals.resetStyleFfiCounters();target.style.fontSize = "5cqw";viewportFallback.style.width = "10cqw";diff --git a/Tests/LibWeb/Text/input/css/native-corner-shape-computation.html b/Tests/LibWeb/Text/input/css/native-corner-shape-computation.htmlindex fe5d420c69a..27df9276c2f 100644--- a/Tests/LibWeb/Text/input/css/native-corner-shape-computation.html+++ b/Tests/LibWeb/Text/input/css/native-corner-shape-computation.html@@ -12,7 +12,6 @@corner-bottom-left-shape: superellipse(calc(4 / 2));`;- internals.resetStyleFfiCounters();document.body.appendChild(target);internals.updateStyle();diff --git a/Tests/LibWeb/Text/input/css/native-font-longhand-computation.html b/Tests/LibWeb/Text/input/css/native-font-longhand-computation.htmlindex 701ff093ac4..956ae743ecf 100644--- a/Tests/LibWeb/Text/input/css/native-font-longhand-computation.html+++ b/Tests/LibWeb/Text/input/css/native-font-longhand-computation.html@@ -35,7 +35,6 @@`;parent.appendChild(anchorTarget);- internals.resetStyleFfiCounters();document.body.appendChild(parent);internals.updateStyle();@@ -60,7 +59,6 @@println(`deferred anchor left: ${anchorStyle.left}`);println(`deferred anchor top: ${anchorStyle.top}`);- internals.resetStyleFfiCounters();target.style.fontSize = "16px";internals.updateStyle();println(`partial font-size: ${getComputedStyle(target).fontSize}`);diff --git a/Tests/LibWeb/Text/input/css/native-image-computation.html b/Tests/LibWeb/Text/input/css/native-image-computation.htmlindex 3927cb54553..61d2ca2c668 100644--- a/Tests/LibWeb/Text/input/css/native-image-computation.html+++ b/Tests/LibWeb/Text/input/css/native-image-computation.html@@ -16,7 +16,6 @@const inlineTarget = document.getElementById("inline-target");const stylesheetTarget = document.getElementById("stylesheet-target");inlineTarget.style.listStyleImage = 'url("inline.png")';- internals.resetStyleFfiCounters();internals.updateStyle();const computedStyle = getComputedStyle(stylesheetTarget);diff --git a/Tests/LibWeb/Text/input/css/native-structural-random-computation.html b/Tests/LibWeb/Text/input/css/native-structural-random-computation.htmlindex 5cfd07ea1cc..5a266e5edf2 100644--- a/Tests/LibWeb/Text/input/css/native-structural-random-computation.html+++ b/Tests/LibWeb/Text/input/css/native-structural-random-computation.html@@ -19,7 +19,6 @@<script src="../include.js"></script><script>test(() => {- internals.resetStyleFfiCounters();internals.updateStyle();const computedStyle = getComputedStyle(target);diff --git a/Tests/LibWeb/Text/input/css/native-tree-counting-computation.html b/Tests/LibWeb/Text/input/css/native-tree-counting-computation.htmlindex 930e2417f00..89bf66b2b57 100644--- a/Tests/LibWeb/Text/input/css/native-tree-counting-computation.html+++ b/Tests/LibWeb/Text/input/css/native-tree-counting-computation.html@@ -19,7 +19,6 @@</div><script>test(() => {- internals.resetStyleFfiCounters();internals.updateStyle();const computedStyle = getComputedStyle(target);diff --git a/Tests/LibWeb/Text/input/css/native-var-substitution.html b/Tests/LibWeb/Text/input/css/native-var-substitution.htmlindex e3c59d9918a..e9a75688bbe 100644--- a/Tests/LibWeb/Text/input/css/native-var-substitution.html+++ b/Tests/LibWeb/Text/input/css/native-var-substitution.html@@ -3,7 +3,6 @@<script>test(() => {internals.updateStyle();- internals.resetStyleFfiCounters();const element = document.createElement("div");element.style.cssText = `@@ -30,9 +29,6 @@println(`fallback inside cycle ignored: ${computed.color}`);println(`fallback outside cycle used: ${computed.backgroundColor}`);- const nativeCounters = internals.styleFfiCounters();- println(`native substitution parses: ${nativeCounters.substitutionParses > 0}`);-CSS.registerProperty({name: "--registered-native-fallback",syntax: "<length>",@@ -45,7 +41,6 @@inherits: false,initialValue: "13px",});- internals.resetStyleFfiCounters();const registered = document.createElement("div");registered.style.cssText = `@@ -60,15 +55,9 @@println(`unregistered height: ${getComputedStyle(registered).height}`);println(`registered universal initial: ${getComputedStyle(registered).marginLeft}`);- const registeredCounters = internals.styleFfiCounters();- println(`registered substitution parses: ${registeredCounters.substitutionParses > 0}`);-const stringBearing = document.createElement("div");stringBearing.style.cssText = "--family: LadybirdCallbackFallback; font-family: var(--family)";document.body.appendChild(stringBearing);println(`string-bearing family: ${getComputedStyle(stringBearing).fontFamily}`);-- const stringBearingCounters = internals.styleFfiCounters();- println(`string-bearing substitution parses: ${stringBearingCounters.substitutionParses > registeredCounters.substitutionParses}`);});</script>diff --git a/Tests/LibWeb/Text/input/css/repeatable-list-animation-rust.html b/Tests/LibWeb/Text/input/css/repeatable-list-animation-rust.htmlindex 8dc07054368..31f1e2f7203 100644--- a/Tests/LibWeb/Text/input/css/repeatable-list-animation-rust.html+++ b/Tests/LibWeb/Text/input/css/repeatable-list-animation-rust.html@@ -12,7 +12,6 @@animation.pause();animation.currentTime = 50;- internals.resetStyleFfiCounters();internals.updateStyle();println(getComputedStyle(target).objectPosition);});diff --git a/Tests/LibWeb/Text/input/css/shadow-animation-rust.html b/Tests/LibWeb/Text/input/css/shadow-animation-rust.htmlindex f5fdeed792c..edc30433f4b 100644--- a/Tests/LibWeb/Text/input/css/shadow-animation-rust.html+++ b/Tests/LibWeb/Text/input/css/shadow-animation-rust.html@@ -9,8 +9,6 @@<script src="../include.js"></script><script>test(() => {- internals.resetStyleFfiCounters();-const boxShadowAnimation = target.animate({ boxShadow: ["inset 0 0 0 0 black", "inset 8px 12px 4px calc(max(10em, 20px) / 2) white"] },100@@ -28,6 +26,5 @@textShadowAnimation.currentTime = 50;println(getComputedStyle(target).textShadow);textShadowAnimation.cancel();-});</script>diff --git a/Tests/LibWeb/Text/input/css/substitution-oracle-counter.html b/Tests/LibWeb/Text/input/css/substitution-oracle-counter.htmlindex 8290f6b5595..c5b37f11fb6 100644--- a/Tests/LibWeb/Text/input/css/substitution-oracle-counter.html+++ b/Tests/LibWeb/Text/input/css/substitution-oracle-counter.html@@ -37,7 +37,6 @@parent.appendChild(element);document.body.appendChild(parent);- internals.resetStyleFfiCounters();internals.updateStyle();const style = getComputedStyle(element);@@ -61,7 +60,6 @@initialValue: "0",});internals.updateStyle();- internals.resetStyleFfiCounters();const registeredParent = document.createElement("div");registeredParent.style.setProperty("--non-inherited-order", "8");const registeredChild = document.createElement("div");@@ -71,6 +69,5 @@println(`registered inherit initial: ${getComputedStyle(registeredChild).zIndex}`);registeredParent.style.setProperty("--non-inherited-order", "9");println(`registered inherit mutation: ${getComputedStyle(registeredChild).zIndex}`);-});</script>diff --git a/Tests/LibWeb/Text/input/css/transition-effect-batch-rust.html b/Tests/LibWeb/Text/input/css/transition-effect-batch-rust.htmlindex 2b4be3234aa..173758aee25 100644--- a/Tests/LibWeb/Text/input/css/transition-effect-batch-rust.html+++ b/Tests/LibWeb/Text/input/css/transition-effect-batch-rust.html@@ -14,13 +14,9 @@target.style.opacity = "1";target.style.width = "20px";- internals.resetStyleFfiCounters();internals.updateStyle();- const counters = internals.styleFfiCounters();const style = getComputedStyle(target);println(`opacity: ${style.opacity}`);println(`width: ${style.width}`);- println(`transition decisions: ${counters.transitionDecisionEntries}`);- println(`animation evaluations: ${counters.animationEvaluationEntries}`);});</script>