mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
Add a cache for `SameFormattingContextBlock`s: A new kind of cache is added which allows reusing fragments for `SameFormattingContextBlock` (the majority of block level elements). This can reduce the amount of fragment tree construction during incremental layout (although with a 40 byte overhead per `SameFormattingContextBlock`). Testing: This change adds a new Servo-specific WPT test that verifies that the minimal number of `Fragment`s are rebuilt after an incremental layout. Previously, when running `flexbox-deeply-nested-column-flow.html` from `tests/blink_perf_tests/perf_tests/layout/`, performance would degrade with successive test runs. This is due to how slow inline layout is. This change removes that progressive degradation, though we may be able to remove this cache with improvements to inline layout. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Luke Warlow <lwarlow@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
32 lines
986 B
Plaintext
32 lines
986 B
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
// skip-unless CARGO_FEATURE_TESTBINDING
|
|
|
|
// This interface is entirely internal to Servo, and should not be accessible to
|
|
// web pages.
|
|
|
|
[Exposed=(Window,Worker), Pref="dom_servo_helpers_enabled"]
|
|
namespace ServoTestUtils {
|
|
[Exposed=Window, Pref="layout_animations_test_enabled"]
|
|
undefined advanceClock(long millis);
|
|
|
|
undefined crashHard();
|
|
|
|
[Exposed=Window]
|
|
LayoutResult forceLayout();
|
|
|
|
undefined js_backtrace();
|
|
|
|
undefined panic();
|
|
};
|
|
|
|
[Exposed=Window, Pref="dom_servo_helpers_enabled"]
|
|
interface LayoutResult {
|
|
readonly attribute /* FrozenArray<DOMString> */ any phases;
|
|
readonly attribute unsigned long rebuiltFragmentCount;
|
|
readonly attribute unsigned long restyleFragmentCount;
|
|
readonly attribute unsigned long possiblyMovedFragmentCount;
|
|
};
|