servo/components/script
Mukilan Thiyagarajan a730469b70
script: Implement the FontFaceSet DOM API (#32576)
Add a skeleton implementation of FontFaceSet interface with support
for resolving the `document.fonts.ready` Promise when the loading of
web fonts is completed.

This change exposes new failures in the web platform tests.

These were ERROR before the change because `document.fonts.ready` caused
a `ReferenceError` causing the tests to be aborted and they now FAIL:
- /css/CSS2/linebox/vertical-align-top-bottom-001.html
- /css/css-flexbox/flex-one-sets-flex-basis-to-zero-px.html
- /css/css-fonts/generic-family-keywords-001.html
- /css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html
- /css/css-fonts/math-script-level-and-math-style/math-script-level-002.tentative.html
- /css/css-text/text-autospace/text-autospace-ligature-001.html
- /css/css-values/calc-size/calc-size-width.tentative.html

These were TIMEOUT before the change because `document.fonts.ready` was
a ReferenceError and the tests were asynchronous (reftest-wait). These now
FAIL because the assertions are now executed after fonts are loaded:
- /css/css-fonts/matching/fixed-stretch-style-over-weight.html
- /css/css-fonts/matching/range-descriptor-reversed.html
- /css/css-fonts/matching/stretch-distance-over-weight-distance.html
- /css/css-fonts/matching/style-ranges-over-weight-direction.html
- /css/css-fonts/variations/variable-box-font.html
- /css/css-fonts/variations/variable-gpos-m2b.html
- /css/css-fonts/variations/variable-gsub.html
- /css/css-fonts/variations/variable-opsz-size-adjust.html
- /css/css-position/sticky/position-sticky-change-top.html
- /css/css-position/sticky/position-sticky-fixed-ancestor.html
- /css/css-position/sticky/position-sticky-flexbox.html
- /css/css-position/sticky/position-sticky-grid.html
- /css/css-position/sticky/position-sticky-inline.html
- /css/css-position/sticky/position-sticky-rendering.html
- /css/css-position/sticky/position-sticky-stacking-context.html
- /css/css-position/sticky/position-sticky-table-td-left.html
- /css/css-position/sticky/position-sticky-table-td-right.html
- /css/css-position/sticky/position-sticky-table-tfoot-bottom.html
- /css/css-position/sticky/position-sticky-table-th-right.html
- /css/css-position/sticky/position-sticky-table-thead-top.html
- /css/css-position/sticky/position-sticky-table-tr-bottom.html
- /css/css-position/sticky/position-sticky-table-tr-top.html
- /css/css-position/sticky/position-sticky-writing-modes.html
- /css/css-pseudo/marker-intrinsic-contribution-001.html
- /css/css-text/hyphens/hyphens-character.html

These tests now PASS due to this patch:
* FAIL -> PASS
  - /html/canvas/element/text/2d.text.draw.fill.maxWidth.fontface.html
  - /html/canvas/element/text/2d.text.measure.width.empty.html
* TIMEOUT -> PASS
  - /css/css-fonts/variations/font-descriptor-range-reversed.html
  - /css/css-fonts/variations/variable-opsz.html
  - /css/css-position/sticky/position-sticky-table-th-left.html
* ERROR -> PASS
  - /css/css-fonts/generic-family-keywords-002.html
  - /css/css-fonts/generic-family-keywords-003.html
* These two tests only PASS in Layout 2020:
  - /css/CSS2/positioning/inline-static-position-001.html
  - /css/cssom-view/getBoundingClientRect-empty-inline.html

These two tests have subtests that PASS intermittenttly:
- /fetch/metadata/generated/css-font-face.sub.tentative.html
- /css/css-fonts/generic-family-keywords-001.html

These tests are new TIMEOUTS that used to FAIL because
`documents.fonts.ready` was undefined:
- /resource-timing/TAO-match.html
- /resource-timing/content-type.html
- /resource-timing/nextHopProtocol-is-tao-protected.https.html

The failure in `/resize-observer/change-layout-in-error.html` could be
due to an issue in the ResizeObserver implementation that is now exposed
with this change, but this needs more investigation.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-26 09:44:47 +00:00
..
docs Update branch name to main (#30877) 2023-12-16 09:32:20 +00:00
dom script: Implement the FontFaceSet DOM API (#32576) 2024-06-26 09:44:47 +00:00
layout_dom Rename gfx to fonts (#32556) 2024-06-19 20:26:19 +00:00
task_source Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
animation_timeline.rs script: Start replacing time with std::time and chrono (#30639) 2024-01-16 12:23:18 +00:00
animations.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
body.rs clippy: Fix let_and_return warnings (#31964) 2024-04-01 15:43:24 +00:00
build.rs Update python detection in codegen (#31873) 2024-03-26 10:14:06 +00:00
canvas_state.rs Upgrade Stylo to 2024-03-01 (#32089) 2024-04-16 12:27:51 +00:00
Cargo.toml Add a directory listing feature for file URLs (#32580) 2024-06-26 08:02:50 +00:00
clipboard_provider.rs
devtools.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
document_loader.rs clippy: fixed some warnings in components/script (#31888) 2024-03-26 21:25:42 +00:00
fetch.rs clippy fixes regarding clone_from (#32482) 2024-06-12 17:09:56 +00:00
image_listener.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
init.rs Fixed some clippy warning by adding default implementations (#31989) 2024-04-04 09:33:30 +00:00
layout_image.rs clippy: Fix some warnings in the script crate (#31719) 2024-03-18 10:05:18 +00:00
lib.rs Address issues uncovered by rust-1.78 beta (#32130) 2024-04-22 18:20:47 +00:00
mem.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
microtask.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
network_listener.rs clippy: Fix redundant field names warnings (#31793) 2024-03-20 23:05:29 +00:00
realms.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
script_module.rs Fixed some clippy warnings in components (#32025) 2024-04-10 07:50:01 +00:00
script_runtime.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
script_thread.rs script: Implement the FontFaceSet DOM API (#32576) 2024-06-26 09:44:47 +00:00
serviceworker_manager.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
stylesheet_loader.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
stylesheet_set.rs
task.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
task_manager.rs script: Start rework to better match the specification HTML event loop (#31505) 2024-05-13 09:23:03 +00:00
task_queue.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
test.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
textinput.rs clippy: Fix collapsible_else_if warnings (#31853) 2024-03-26 09:15:04 +00:00
timers.rs clippy: Fix some warnings in components/script/timers.rs (#31878) 2024-03-27 10:15:15 +00:00
unpremultiplytable.rs
webdriver_handlers.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
window_named_properties.rs clippy: Fix several warnings (#31710) 2024-03-18 08:33:43 +00:00