aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
Commit message (Collapse)AuthorAgeFilesLines
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-1754-69/+68
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* Rename NavigationType to NavigationTimingType (#32299)shanehandley2024-05-162-16/+16
| | | | | | | | | This was renamed in the spec: https://github.com/w3c/navigation-timing/pull/172 The NavigationType enum name is now part of the navigation history apis: https://html.spec.whatwg.org/multipage/nav-history-apis.html\#navigationtype
* Fix RefCell borrows (#32276)Samson2024-05-131-3/+2
| | | | | | | * Fix RefCell borrows * Update document.rs fmt
* script: Start rework to better match the specification HTML event loop (#31505)Gregory Terzian2024-05-138-279/+518
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix the HTML event-loop: add a update the rendering task add rendering task source sketch structure to update the rendering resize steps composition events fix warnings in rendering task source refactor handling of composition events: put window and doc for pipeline on top set script as user interacting in update the rendering task fmt add todos for other steps, put all compositor handling logic in one place update the rendering: evaluate media queries and report changes update the rendering: update animations and send events update the rendering: run animation frames update the rendering: order docs put rendering related info on documents map tidy update the rendering: add issue numbers to todos update the rendering: reflow as last step update the rendering: add todo for top layer removals note rendering opportunity when ticking animations for testing fix double borrow crash in css/basic-transition fix faster reversing of transitions test undo ordering of docs bypass not fully-active pipeline task throttling for rendering tasks ensure tasks are dequed from task queue prioritize update the rendering task remove servo media stuff from set activity tidy debug update the rendering: perform microtask checkpoint after task tidy-up only run evaluate media queries if resized re-add evaluation of media queries for each rendering task, re-prioritize rendering tasks, re-add microtask checkpoint for all sequential messages re-structure resize steps, and their interaction with evaluating media queries and reacting to environment changes update the rendering: remove reflow call at the end update webmessaging expectations update to FAIL /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html update to FAIL load-pageshow-events-window-open.html add issue number for ordering of docs nits move batching of mouse move event to document info nits add doc for mouse move event index reset mouse move event index when taking pending compositor events fix replacing mouse move event nits * move update the rendering related data to document * move re-taking of tasks to try_recv * address nits * change task queue try_recv into take_tasks_and_recv, with nits * refactor process_pending_compositor_events * when updating the rendering, return early if script cannot continue running * use an instant for the last render opportunity time * nits * remove handle_tick_all_animations * use a vec for pending resize and compositor events * fix spec links * Fix a few other nits before landing --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* fix: Implement additional logic in ↵shanehandley2024-05-134-14/+67
| | | | DOMString::set_best_representation_of_the_floating_point_number in order to correct some failing tests related to -0 values. (#32272)
* clippy: Fix last few warnings (#32270)Pi-Cla2024-05-123-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix clippy in components/script warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do (components/script/dom/htmlformelement.rs:896:20) warning: `Box::new(_)` of default value (components/script/dom/paintworkletglobalscope.rs:291:29) warning: this creates an owned instance just for comparison (components/script/dom/radionodelist.rs:105:50) * Fix clippy in layout_thread (2013 and 2020) warning: this `if` statement can be collapsed (components/layout_thread/lib.rs:876:17) warning: the following explicit lifetimes could be elided: 'a (components/layout_thread/lib.rs:239 and 2020 same line) warning: deref which would be done by auto-deref (components/layout_thread/lib.rs:500 and 1289) warning: dereferencing a tuple pattern where every element takes a reference (components/layout_thread/lib.rs:503,1562 and 2020 line 1153) warning: useless conversion to the same type: `style::invalidation::element::restyle_hints::RestyleHint` (components/layout_thread_2020/lib.rs:742:36) * Fix clippy in components/servo warning: constants have by default a `'static` lifetime (components/servo/lib.rs:1238:31) warning: creating a `let` binding to a value of unit type, which usually can't be used afterwards (5 occurances in components/servo/lib.rs) * FIx clippy in ports/servoshell warning: this expression creates a reference which is immediately dereferenced by the compiler (ports/servoshell/app.rs:251:89) warning: using `clone` on type `Option<TopLevelBrowsingContextId>` which implements the `Copy` trait (ports/servoshell/webview.rs:122:9)
* Implement attributes for the `<meter>` element (#32230)shanehandley2024-05-112-13/+139
| | | | | * Implement attributes for the meter element * Remove checks for min < max before clamping
* clippy: Fix vtable_address_comparisons error (#32262)sergiitomusiak2024-05-091-1/+5
| | | | | | | | | | | | * clippy: Fix vtable_address_comparisons error * Update components/script/dom/bindings/root.rs Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com> --------- Co-authored-by: Sergii Tomusiak <sergiitomusiak@github.com> Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
* webgpu: Refactor webgpu crate (#32255)Samson2024-05-0814-26/+23
| | | | | | | * wgpu(_core) -> wgc * Refactor webgpu crate split lib.rs into multiple modules
* webgpu: Update to wgpu 0.20 (#32173)Samson2024-05-088-35/+39
| | | | | | | | | | | * Update wgpu to 0.20 * good expectations * Throw TypeError in configure on unsupported format instead of panic * Expect * `into_command_buffer_id`,`into_command_encoder_id`
* Revert "script: implement AbortController (#31361)" (#32243)Samson2024-05-0711-254/+8
| | | This reverts commit 7fce850cffb72a6fbcf763a40164a9b35b7fa833.
* script: implement AbortController (#31361)Smitty2024-05-0411-8/+254
| | | | | | | | | | | | | | | | | | | | | * Implement AbortController Signed-off-by: syvb <me@iter.ca> * Update WPT tests Signed-off-by: syvb <me@iter.ca> * Address review comments * Fix duplicate import generation * Update WPT test expectations * Change expectation to FAIL for flaky test --------- Signed-off-by: syvb <me@iter.ca>
* Fix some clippy warnings in `components/gfx` and `components/script` (#32215)Pi-Cla2024-05-0214-26/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * clippy: Squish warnings and errors in gfx warning: redundant closure (gfx/font.rs:415:18) warning: useless conversion to the same type (gfx/font.rs:534:9) warning: the following explicit lifetimes could be elided: 'a (gfx/font.rs:619:16) error: this loop never actually loops (gfx/font_cache_thread.rs:112:9) warning: this expression creates a reference which is immediately dereferenced by the compiler (gfx/font_cache_thread.rs:229:51) warning: redundant closure (gfx/font_cache_thread.rs:551:18) 3 instances of: warning: casting integer literal to `f64` is unnecessary (gfx/platform/freetype/font_list.rs:271-273) * clippy: methods called `from_*` usually take no `self` It reports that by standard convention, from_* methods should not take any `&self` parameter * clippy: you should consider adding a `Default` implementation It reports that public types with a pub fn new() -> Self should have a Default implementation since they can be constructed without arguments * clippy: casting to the same type is unnecessary (`f32` -> `f32`) * clippy: use of `unwrap_or_else` to construct default value * clippy: methods called `is_*` usually take `self` by mutable reference or `self` by reference or no `self` * clippy: manual `!RangeInclusive::contains` implementation contains expresses the intent better and has less failure modes (such as fencepost errors or using || instead of &&) * clippy: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]` * clippy: Fix some new warnings warning: this `if` statement can be collapsed (gfx/font.rs:468:130) warning: this lifetime isn't used in the impl (gfx/platform/freetype/font.rs:341:6) warning: field assignment outside of initializer for an instance created with Default::default() (compositor.rs:881:17)
* script: Include layout when collecting memory reports (#32204)Mukilan Thiyagarajan2024-05-011-0/+7
| | | Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* webgpu: Use safe callbacks & try_recv_timeout (#32008)Samson2024-04-301-10/+0
| | | | | | | | | | | | | * Use safe callback in SwapChainPresent and remove present_buffer_maps * Use rust closure in BufferMapAsync * Remove buffer_maps and dead code elimination * scope id passthrough * Inline callbacks * try_recv timeout and halve DEVICE_POLL_INTERVAL
* script: implement autofocus IDL reflection (#32170)Nolan Lawson2024-04-295-1/+45
| | | | | * script: implement autofocus IDL reflection * test: update wpt results files
* Fixe some clippy warnings (#32131)komuhangi2024-04-295-36/+32
|
* Turn white-space into a shorthand (#32146)Oriol Brufau2024-04-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Bumps Stylo to servo/stylo#37 `white-space` is split into `white-space-collapse` and `text-wrap-mode`: | white-space | white-space-collapse | text-wrap-mode | | ----------- | -------------------- | -------------- | | normal | collapse | wrap | | nowrap | collapse | nowrap | | pre-wrap | preserve | wrap | | pre | preserve | nowrap | | pre-line | preserve-breaks | wrap | | - | preserve-breaks | nowrap | Note this introduces a combination that wasn't previously possible, but I think the existing logic can handle it well enough. The old `allow_wrap()` is replaced by checking whether `text-wrap-mode` is set to `wrap`. The old `preserve_newlines()` is replaced by checking whether `white-space-collapse` is *not* set to `collapse`. The old `preserve_spaces()` is replaced by checking whether `white-space-collapse` is set to `preserve`.
* feat: implement ARIA string reflection on Element (#32080)Nolan Lawson2024-04-273-0/+433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: implement ARIA string reflection * Update components/script/dom/element.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> * fix: respond to PR comments * fix: make functions non-public * fix: use proper ARIAMixin mixin * fix: tidy issues * fix: double newline at end of file * fix: move role before aria-* to match spec order * fix: fix link to spec and format as spec does * fix: delete now-passing WPT tests * fix: remove legacy-layout test --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Bump Stylo to servo/stylo#34 and upgrade html5ever and xml5ever (#32145)Oriol Brufau2024-04-262-7/+7
| | | | See https://github.com/servo/stylo/commit/81a55ac "Switch to markup5ever's version of Atom and upgrade xml5ever"
* webgpu: Update wgpu to 0.19 (#31995)Samson2024-04-2620-109/+409
| | | | | | | | | | | * Update wgpu to https://github.com/gfx-rs/wgpu/commit/32e70bc1635905c508d408eb1cf22b2aa062ffe1 (0.19) * Update expect only good * reexpect * remove dbg stuff * Remove all occurrences of dx11_hub
* Upgrade Stylo to 2024-04-16 (#32128)Oriol Brufau2024-04-256-15/+43
| | | | | | | | | | | | | | | * Upgrade Stylo to 2024-04-16 * Fixup for https://phabricator.services.mozilla.com/D205051 * Fixup for https://phabricator.services.mozilla.com/D203153 * Fixup for https://phabricator.services.mozilla.com/D202460 * Fixup for https://phabricator.services.mozilla.com/D205718 * Fixup for https://phabricator.services.mozilla.com/D206428 * Update test expectations
* script: Prevent "scroll to fragment" from scrolling offscreen (#32129)Martin Robinson2024-04-252-20/+17
| | | | | | | | | Previously, the "scroll to fragment" operation could scroll past the end of the screen, because the scroll position was not clamped to viewport boundaries. Correct this by using the `Window::scroll()` method which handles this case. In addition, ensure that `Window`'s `current_viewport` member is initialized properly when it is created.
* Address issues uncovered by rust-1.78 beta (#32130)Martin Robinson2024-04-229-95/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes changes to allow Servo to compile with the 1.78 version of Rust: - Dead code is removd (Rust seems to have gotten better at detecting it). - The `FlowRef` `DerefMut` is updated according to @SimonSapin's advice [^1]. - The `imports.rs` now explicitly silences warnings about unused imports. [^1]: https://github.com/servo/servo/issues/6503#issuecomment-2066088179 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
* script_layout: Remove script to layout messages (#32081)Martin Robinson2024-04-229-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of communicating with layout via messages, script can simply call methods on the layout trait. This simplifies the way that script communicates with layout and opens the path to sharing more data structures between the two systems. This is part of a continuing series of cleanups after removing the layout thread. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
* fix(user-timing): fix clearing marks/measures by name (#32120)Nolan Lawson2024-04-221-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes several tests in [wpt/user-timing](https://wpt.fyi/results/user-timing?label=master&product=chrome%5Bexperimental%5D&product=firefox%5Bexperimental%5D&product=safari%5Bexperimental%5D&product=servo&aligned) by fixing some logic errors in how marks/measures are cleared (via [`clearMarks`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks) and [`clearMeasures`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures)). There are two changes: 1. Fix the boolean logic in `clear_entries_by_name_and_type` so that, when `clearMarks('foo')` or `clearMeasures('foo')` is called, the presence of the entry name correctly filters based on existing entry names. 2. Make the `entry_name` param a `DOMString` rather than an `Option<DOMString>` since every API call has it as `Some` anyway, and I'm not aware of any [Performance APIs](https://developer.mozilla.org/en-US/docs/Web/API/Performance) where you can clear all entries regardless of type. (This is not strictly required for the fix, but I think it makes the code easier to read.) ~~I also considered adding the expected WPT results using `mach update-wpt`. But I'm not sure if you want these changes, since the expectations are currently missing (i.e. `tests/wpt/meta/user-timing` does not exist).~~ (_Update: added!_) For the record, this PR fixes the following tests: - `clearMarks.html.ini` - `clearMeasures.html.ini` - `clear_non_existent_mark.any.js.ini` - `clear_non_existent_measure.any.js.ini` - `clear_one_mark.any.js.ini` - `clear_one_measure.any.js.ini` ~~In case you do want these meta files, here they are: https://github.com/nolanlawson/servo/commit/510e6146ba01bae4f4aafda8754718e24ce6e868~~ --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
* Fix InsertRule to use the right CssRuleTypes (#32125)Oriol Brufau2024-04-2212-41/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `CSSRule::Type()` returns an u16 for CSSOM. `InsertRule()` was incorrectly using this to create a `CssRuleTypes`. Instead of `CssRuleTypes::from_bits(rule_type)`, it should be something like `CssRuleTypes::from_bits(1 << rule_type)`. However, that would only work when `Type()` provides an actual value, which per https://drafts.csswg.org/cssom/#dom-cssrule-type only happens for old rule types. New rule types just return 0. Therefore, this patch changes the signature of `SpecificCSSRule::ty()` to return the actual `CssRuleType`, and then `CSSRule::Type()` can zero it out when necessary. The fix is only relevant for CSS Nesting, which is currently disabled on Servo, so no test is necessary. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because the fix is only relevant for CSS Nesting, which is currently disabled <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
* clippy: fix several lint warns (#32126)Kitsu2024-04-2215-65/+36
| | | | | | | | | | | | | | | As seems #31500 still remain opened here's the next partial fix. Fixed list: `unused_mut`, `clippy::needless_borrow`, `clippy::match_ref_pats`, `clippy::borrow_deref_ref`, `clippy::ptr_eq`, `clippy::unnecessary_cast`, `clippy::derivable_impls`, `clippy::collapsible_match`, `clippy::extra_unused_lifetimes`, `clippy::map_clone`, `clippy::manual_filter`. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes are part of #31500. - [x] These changes do not require tests because are only cosmetic.
* Fixed some clippy warnings in components (#32107)komuhangi2024-04-199-29/+20
| | | | | | | * Fixed some clippy warnings in components * Updated handling of NaN values in comparison * Updated formatting using ./mach fmt
* script: Add an implementation of `Default` for `Documents` (#32048)Son of Binary2024-04-191-7/+10
|
* clippy: Fix `explicit_auto_deref` warnings in `components/script` (#32113)Oluwatobi Sofela2024-04-193-62/+62
| | | | | * clippy: Fix explicit_auto_deref warnings * refactor: Change basic comments to rustdoc comments
* clippy: Fix `map_flatten` warning in `components/script` (#32110)Oluwatobi Sofela2024-04-181-4/+3
| | | | | * clippy: Fix map_flatten warning * refactor: Change plain comments to rustdoc comments
* Upgrade Stylo to 2024-03-01 (#32089)Oriol Brufau2024-04-169-59/+47
| | | | | | | * Upgrade Stylo to 2024-03-01 * Fixup for https://bugzil.la/1882754 * Update test expectations
* Upgrade Stylo to 2024-01-16 (#32066)Oriol Brufau2024-04-132-4/+5
| | | | | | | | | | | | | | | * Upgrade Stylo to 2024-01-16 * Fixup for https://phabricator.services.mozilla.com/D187736 * Fixup for https://phabricator.services.mozilla.com/D196415 * Fixup for https://phabricator.services.mozilla.com/D197147 * Fixup for https://phabricator.services.mozilla.com/D196194 * Fixup for https://phabricator.services.mozilla.com/D196195 * Update test expectations
* clippy: Fix `comparison_*` warnings (#32058)eri2024-04-125-78/+92
|
* clippy: Fix question_mark warning (#32051)Oluwatobi Sofela2024-04-111-3/+1
|
* clippy: Fix iter_cloned_collect warning (#32053)Oluwatobi Sofela2024-04-111-5/+1
|
* clippy: Fix `redundant_*` warnings (#32056)eri2024-04-118-73/+68
| | | | | | | * clippy: Fix `redundant_field_names` warnings * clippy: Fix other `redundant_*` warnings * docs: Update docstring comments
* clippy: Fix needless_late_init warning (#32052)Oluwatobi Sofela2024-04-111-4/+3
|
* Implement form-associated custom elements and their ElementInternals (#31980)cathiechen2024-04-1114-147/+1122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * FACEs work, setFormValue test is awful so now has _mozilla backup * 1. Impl Validatable in ElementInternals instead of HTMLElement. 2. Reuse the code in Validatable trait. 3. The form associated custom element is not a customized built-in element. * add some comments * support readonly attribute and complete barred from constraint validation * Addressed the code review comments * Updated the legacy-layout results * Fixed the WPT failures in ElementInternals-validation.html * Addressed the code review comments * Review suggestions * Fixed silly mistakes and update the test result outside elementinternals * update the test results --------- Co-authored-by: Patrick Shaughnessy <pshaughn@comcast.net> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fixed some clippy warnings in components (#32025)komuhangi2024-04-106-18/+15
| | | | | * Fixed some clippy warnings in components * Updated the simplification of bolean expressions in componets/script/dom/range.rs
* clippy: fix warnings in components/script (#32023)Azhar Ismagulova2024-04-093-19/+18
|
* chore: Clean up use of `gfx` and `constellation` types (#31981)Martin Robinson2024-04-091-9/+8
| | | | | | | | | | | | This change contains three semi-related clean ups: 1. the `to_webrender()` and `from_webrender()` functions on Pipeline are turned into more-idiomatic `From` and `Into` implementations. 2. `combine_id_with_fragment_type` now returns a `u64` as that is what is expected for all callers and not a `usize`. 3. The `query_scroll_id` query is removed entirely. The `ExternalScrollId` that this queries is easily generated directly from the node's opaque id. Querying into layout isn't necessary at all.
* Gamepad: Remove GamepadList and fix dropped connection event on startup (#31684)Daniel Adams2024-04-086-133/+76
| | | | | | | | | | | | | | | * Replace GamepadList * Fix initial gamepad connection event from gilrs getting dropped * Fix gamepad reconnection issues, use MutNullableDom * Reduce some repetition in handle_gamepad_events * Address feedback, move some steps to navigator methods * Refactor internal navigator gamepad methods * Add note re: unused gilrs index, adjust navigator gamepad methods
* fix: Handle table.deleteRow with no rows (#32009)shanehandley2024-04-071-7/+20
| | | | | * fix: Handle table.deleteRow with no rows * Respond to review, update legacy layout expectations
* Fixed some clippy warnings by replacing 'match' with 'if' (#32007)komuhangi2024-04-075-71/+57
|
* Clippy: Fix the error of variants having the same prefix. (#31953)Aarya Khandelwal2024-04-055-45/+41
| | | | | | | | | | | | | | | | | | | * fix error: all variants have same prefix * made the suggested changes * fixed errors caused by commit * silenced the clippy warning. * ran ./mach fmt * Update components/script/dom/htmlmediaelement.rs Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> --------- Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
* Show poster over first video frame if available (#32001)eri2024-04-051-5/+22
|
* layout: Add a `FontMetricsProvider` for resolving font-relative units (#31966)Martin Robinson2024-04-043-23/+19
| | | | | | | | | | | | | | | | | | | The only font relative unit that Servo knows how to resolve currently is `rem` (relative to the root font size). This is because Stylo cannot do any font queries. This adds a mechanism to allow this, exposing the ability to properly render `ex` units in Servo. This change only allows resolving some font size relative units thoug, as Servo doesn't collect all the FontMetrics it needs to resolve them all. This capability will be added in followup changes. Some new tests fail: - ex-unit-001.html: This test fails because Servo does not yet have support for setting the weight using @font-face rules on web fonts. - ex-unit-004.html: This test fails because Servo does not yet have support for setting the Unicode range of a web font using @font-face rules. - first-available-font-001.html: This test fails because the above two feature are missing.
* script: Make layout DOM wrappers not generic on layout data (#31994)Martin Robinson2024-04-044-241/+79
| | | | | | | | | Remove the type parameter from the layout DOM wrappers. This is possible now that style and layout data are separate and the `Any` nature of the layout data is exposed in the wrappers. Removing the phantom data member of the wrappers also allows using the default `derive` implementations for things like `Clone`, `Copy`, and `PartialEq`.