aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/fontfaceset.rs
Commit message (Collapse)AuthorAgeFilesLines
* refactor: add CanGc as argument to Promise::resolve (#35616)Yerkebulan Tulibergenov2025-02-231-3/+3
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* script: add skeleton implementation of `FontFace` API (#35262)Mukilan Thiyagarajan2025-02-191-3/+66
| | | | | | | | | | | | | | | | 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>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Generate a trait abstracting over all known DOM interfaces (#34357)Josh Matthews2024-11-241-1/+1
| | | | | | | | | | | | | | | | | * script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Update trait implementations with new generic type. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* cangc fixes in several files + event.rs + rtcpeerconnection.rs (#34002)chickenleaf2024-10-251-3/+3
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Mark promise creation methods with CanGc (#33928)Josh Matthews2024-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add CanGc annotations to promise constructor. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc arguments for Promise::new_in_current_realm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix out-of-order entries. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from Promise::new. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Suppress clippy warning. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* CanGc changes from fontfaceset.rs (#33920)chickenleaf2024-10-211-2/+2
| | | | | | | | | | | | | | | | * CanGc changes from fontfaceset.rs Signed-off-by: L Ashwin B <lashwinib@gmail.com> * Update components/script/dom/bindings/codegen/Bindings.conf Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: chickenleaf <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com> Signed-off-by: chickenleaf <lashwinib@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* tidy: Fix rustdoc warnings and add a tidy check for a common URL issue (#33366)Martin Robinson2024-09-081-1/+1
| | | | | | | | This change fixes all rustdoc errors and also adds a tidy check for a very common rustdoc URL issue. Eventually rustdoc warnings should likely cause the build to fail, but this catches those issues sooner in order to not waste so much developer time. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Start marking functions that can transitively trigger a GC (#33144)Josh Matthews2024-08-221-1/+7
| | | | | | | | | | | | | | | | | * Mark JS reflector wrappers as CanGc. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from reflect_dom_object_with_proto. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Mark DOM constructors as GC operations. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Implement the `FontFaceSet` DOM API (#32576)Mukilan Thiyagarajan2024-06-261-0/+50
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>