aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source.rs
diff options
context:
space:
mode:
authorMukilan Thiyagarajan <mukilan@igalia.com>2025-02-19 11:20:01 +0530
committerGitHub <noreply@github.com>2025-02-19 05:50:01 +0000
commit56840e0a3509f017f745a002332c6125431260a6 (patch)
treea9401b39fa1717127d5e99e1c6a57ad2f102b737 /components/script/task_source.rs
parent29e0fad21ec561b1778e8d973c4e800702f1b38b (diff)
downloadservo-56840e0a3509f017f745a002332c6125431260a6.tar.gz
servo-56840e0a3509f017f745a002332c6125431260a6.zip
script: add skeleton implementation of `FontFace` API (#35262)
This patch implements the `FontFace` interface, but with some caveats 1. The interface is only exposed on `Window`. Support for Workers will be handled in the future. 2. The concept of `css-connected` `FontFace` is not implemented, so `@font-face` rules in stylesheets will not be represented in the DOM. 3. The constructor only supports using `url()` strings as source and `ArrayBuffer` and `ArrayBufferView` are not supported yet. A skeleton implementation of the `load` method of `FontFaceSet` is also implemented in this patch. The intention is to support some web pages that don't load without this method. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/script/task_source.rs')
-rw-r--r--components/script/task_source.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/task_source.rs b/components/script/task_source.rs
index 0030dcb8c30..3d9993f6082 100644
--- a/components/script/task_source.rs
+++ b/components/script/task_source.rs
@@ -27,6 +27,8 @@ pub(crate) enum TaskSourceName {
Canvas,
DOMManipulation,
FileReading,
+ /// <https://drafts.csswg.org/css-font-loading/#task-source>
+ FontLoading,
HistoryTraversal,
Networking,
PerformanceTimeline,
@@ -48,6 +50,7 @@ impl From<TaskSourceName> for ScriptThreadEventCategory {
TaskSourceName::Canvas => ScriptThreadEventCategory::ScriptEvent,
TaskSourceName::DOMManipulation => ScriptThreadEventCategory::ScriptEvent,
TaskSourceName::FileReading => ScriptThreadEventCategory::FileRead,
+ TaskSourceName::FontLoading => ScriptThreadEventCategory::FontLoading,
TaskSourceName::HistoryTraversal => ScriptThreadEventCategory::HistoryEvent,
TaskSourceName::Networking => ScriptThreadEventCategory::NetworkEvent,
TaskSourceName::PerformanceTimeline => {
@@ -71,6 +74,7 @@ impl TaskSourceName {
TaskSourceName::Canvas,
TaskSourceName::DOMManipulation,
TaskSourceName::FileReading,
+ TaskSourceName::FontLoading,
TaskSourceName::HistoryTraversal,
TaskSourceName::Networking,
TaskSourceName::PerformanceTimeline,