aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
Commit message (Collapse)AuthorAgeFilesLines
...
* 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`.
* Fixed some clippy warning by adding default implementations (#31989)komuhangi2024-04-049-65/+22
| | | | | | | | | | | * Fixed some clippy warning by adding default implementations * Updated PR that adds default implementation of structs * Clean up and extend `Default` implementations --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* webgpu: Implement onSubmittedWorkDone (#31772)Samson2024-04-042-4/+42
| | | | | | | | | | | | | | | | | | | | | | | * Implement onSubmittedWorkDone * Use rust closures for callback & actually remove entries from hashmap. * Remove hashmap * Fix warnings * Update expectations * clean flaky crashes * re * Update components/script/dom/gpuqueue.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* script: Split style and layout data in DOM nodes (#31985)Martin Robinson2024-04-043-114/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change splits the style and layout data in DOM nodes that is populated by style and layout passes. This makes Servo's data design more like Gecko's. This allows: 1. Removing the various `StyleAndLayout` data structures used by layout. 2. Removing the `GetStyleAndLayoutData` and `GetStyleAndOpaqueLayoutData` traits. Accessing style and layout data are now just functions on the `LayoutNode` and `ThreadSafeLayoutNode` traits. 3. Styling now doesn't populate layout data. This is is postponed until layout itself. 4. Allows the DOM wrappers to no longer have to be generic over the layout data. This data was already stored using `std::any::Any` and the new code just makes layout responsible for downcasting. Cleaning up the generic type parameter in the DOM wrappers can happen in a followup change. The main benefit to all of this is that we should be able to remove unsafe creation of `ServoLayoutNode` in layout and `TrustedLayoutNodeAddress` entirely, because `ServoLayoutNode` will be able to be passed directly from script to layout. In addition, this removes one more abstraction layer from the layout DOM wrappers, making the code a lot more understandable. Note: This increases the measured size of DOM types, but the same data is stored. It's simply that before that data was stored behind a heap pointer.
* clippy: Fix `vec_box` warnings in `components/script` (#31986)Oluwatobi Sofela2024-04-031-0/+12
| | | | | | | | | | | | | | | * clippy: Fix vec_box warnings * refactor: Allow heap values to stay boxed * refactor: Move comments above allow directives * Apply suggestions from code review Adjust comments slightly --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix `toplevel_ref_arg` warning in `components/script` (#31984)Oluwatobi Sofela2024-04-031-3/+2
| | | | | * clippy: Fix toplevel_ref_arg warnings * refactor: Make the let binding more idiomatic
* clippy: Fix several warnings in `components/script/dom/bindings` (#31945)Azhar Ismagulova2024-04-034-5/+6
| | | | | | | | | * clippy: fix several warnings in components/script/dom/bindings * fix: allow non_canonical_clone_impl in components/script/dom/bindings * chore: removed unnecessary curly braces * fix: removed vtable_address_comparisons allow
* clippy: Fix option_map_or_none warnings (#31983)Oluwatobi Sofela2024-04-032-2/+2
|
* script: Reduce the use of `unsafe` in LayoutDom (#31979)Martin Robinson2024-04-0317-80/+78
| | | | | | | | | | | | | Remove the use of unsafe code in the layout wrappers of the DOM. The main change here is that `unsafe_get()` no longer needs to be an unsafe method, which allows us to transitively remove or reduce unsafe blocks from callers. The function itself is not renamed, because it's still a bit dangerous to start removing the layers of abstraction from actual DOM nodes. In addition `init_style_and_opaque_layout_data` can be merged into `initialize_data`, which removes one more unsafe method. Finally, a "Safety" section is added to some unsafe methods.
* clippy: Allow `too_many_arguments` for existing functions (#31974)eri2024-04-0225-44/+70
| | | | | * Allow `too_many_arguments` for existing functions * fix: Surround ASCII with code block in rustdoc
* clippy:partialeq_to_none (#31972)Yashasvi Chaudhary2024-04-021-1/+1
|
* clippy: Fix search_is_some warnings (#31971)Oluwatobi Sofela2024-04-023-12/+6
|
* clippy: Fix filter_next warnings (#31965)Oluwatobi Sofela2024-04-014-14/+7
|
* clippy: Fix let_and_return warnings (#31964)Oluwatobi Sofela2024-04-018-31/+17
|
* clippy: Allow `too_many_arguments` for all functions (#31962)komuhangi2024-04-0122-0/+50
| | | | | This is the start of preventing this in the future. Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Update webidl and implement setter for the files property of a file input ↵shanehandley2024-04-012-1/+8
| | | | | | | (#31934) The files attribute was previously readonly, but was later updated to allow mutation via input.files = ... see https://github.com/whatwg/html/issues/2861
* clippy: fixed various clippy warnings in `components/scripts` (#31960)Rosemary Ajayi2024-04-017-7/+7
| | | | | | | | | * fixed various clippy warnings * fixed various clippy warnings * fixed various clippy warnings * fixed various clippy warnings
* clippy: Fix a few problems in `components/script` (#31961)Rosemary Ajayi2024-04-012-2/+2
| | | | | * fixed various clippy warnings * fixed various clippy warnings
* clippy: Fix a few problems in `components/scripts` (#31959)Rosemary Ajayi2024-04-015-6/+6
| | | | | * fixed various clippy warnings * fixed various clippy warnings
* clippy: Fix a few problems in `components/script/dom` (#31955)Rosemary Ajayi2024-03-315-9/+7
| | | | | | | * fixed various clippy warnings * fixed various clippy warnings * fixed various clippy warnings
* clippy: Fix various clippy problems in `components/scripts/dom` (#31910)Rosemary Ajayi2024-03-313-3/+3
| | | | | | | | | | | | | | | | | * boxing is unnecessary * boxing is unnecessary * boxing is unnecessary * boxing is unnecessary * fix * fix * fix * Update globalscope.rs
* fixed various clippy warnings (#31954)Rosemary Ajayi2024-03-316-6/+6
|
* Fixed some clippy warnings in components/script (#31950)komuhangi2024-03-312-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixd some clippy warnings in components/script * Update node.rs Removed the ```# Safety ``` section. * Update shadow_root.rs Removed the ``` # Safety ``` section from components/script/layout_dom * Updated fixes to some clippy warnings in components/script * Revert "Updated fixes to some clippy warnings in components/script" This reverts commit 2a37c3dec8e68df132e788663567a0db94e0edb4. * Updated fixes to clippy warnings in components/script * Revert "Updated fixes to clippy warnings in components/script" This reverts commit 5780dc3a0a8d51d4b36f56c095d0cc6c63c0cb36. * Revert "Revert "Updated fixes to some clippy warnings in components/script"" This reverts commit 98c411354a0ed00ad8e43e8d1be06d1a7007d244. * Revert "Updated fixes to some clippy warnings in components/script" This reverts commit 2a37c3dec8e68df132e788663567a0db94e0edb4. * Update shadow_root.rs (Ignore change) * Update node.rs (Ignore changes) * Updated fixes to clippy warnings in components/script * Removed trailing white space in componets/script/layout_dom_root.rs * Revert "Removed trailing white space in componets/script/layout_dom_root.rs" This reverts commit 1976fd040565c7624338fa904e527c5f9f0fd1ab. * Revert "Updated fixes to clippy warnings in components/script" This reverts commit 5c71b925fb8dd833243eb4e1ca99b80359596f51. * Updated fixes to clippy warnings in components/script including review suggestions.
* Update Stylo to 2023-10-16 (#31932)Oriol Brufau2024-03-3010-13/+29
| | | | | | | | | | | | | | | | | | | | | | | * Update Stylo to 2023-10-16 * Fixup for https://phabricator.services.mozilla.com/D185154 * Fixup for https://phabricator.services.mozilla.com/D188216 * Fixup for https://phabricator.services.mozilla.com/D185677 * Fixup for https://phabricator.services.mozilla.com/D188566 * Fixup for https://phabricator.services.mozilla.com/D188727 * Fixup for https://phabricator.services.mozilla.com/D189475 * Fixup for https://phabricator.services.mozilla.com/D189521 * Fixup for https://phabricator.services.mozilla.com/D188812 * Fixup for https://phabricator.services.mozilla.com/D189484 * Update test expectations
* clippy: Fix `from_over_into` warnings (#31946)eri2024-03-304-24/+24
|
* clippy: Fix `match_like_matches` warnings (#31947)eri2024-03-305-54/+34
| | | | | | | | | * clippy: Fix `match_like_matches` warnings * Fix link to custom element state in specification. --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* fix: remove unused imports in components/script (#31943)Azhar Ismagulova2024-03-292-2/+0
|
* layout: Remove LayoutRPC and query layout via the `Layout` trait (#31937)Martin Robinson2024-03-294-65/+78
| | | | | | | | | | | | | | | | | Instead of the tricky `LayoutRPC` interface, query layout using the `Layout` trait. This means that now queries will requires calling layout and then running the query. During layout an enum is used to indicate what kind of layout is necessary. This change also removes the mutex-locked `rw_data` from both layout threads. It's no longer necessary since layout runs synchronously. The one downside here is that for resolved style queries, we now have to create two StyleContexts. One for layout and one for the query itself. The creation of this context should not be very expensive though. `LayoutRPC` used to be necessary because layout used to run asynchronously from script, but that no longer happens. With this change, it becomes possible to safely pass nodes to layout from script -- a cleanup that can happen in a followup change.
* clippy: Fix a variety of warnings in components/script/dom (#31894)Ekta Siwach2024-03-2910-43/+45
|
* clippy: Fix needless_lifetimes warnings (#31933)Oluwatobi Sofela2024-03-2911-16/+16
|
* clippy: Fix option_as_ref_deref warnings (#31936)Oluwatobi Sofela2024-03-297-31/+17
|
* clippy: Fix len_zero warnings (#31935)Oluwatobi Sofela2024-03-295-7/+7
|
* clippy: Fix needless_borrow warnings in components/script (#31928)Azhar Ismagulova2024-03-2919-32/+32
|
* fix: remove unused imports (#31929)Azhar Ismagulova2024-03-282-3/+0
|
* clippy: Fix some warnings in `script/dom` (#31915)Ekta Siwach2024-03-283-9/+5
| | | | | | | | | | | * fixed some clippy warnings * resolved conflict * updated texttracklist.rs --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: remove unneeded return statements (#31923)Azhar Ismagulova2024-03-288-16/+12
|
* clippy: Fix manual_map warnings (#31922)Oluwatobi Sofela2024-03-288-51/+34
|
* clippy: Fix mem_replace_with_default warnings (#31921)Oluwatobi Sofela2024-03-285-12/+5
|
* clippy: Fix various clippy warnings in `components/scripts/dom/bindings` ↵Rosemary Ajayi2024-03-282-3/+3
| | | | | | | (#31901) * single-character string constant used as pattern * singuse of with literal radix of 16
* clippy: Fix another set of clippy problems in `components/script/dom` (#31909)Rosemary Ajayi2024-03-285-19/+19
| | | | | | | | | * a reference to a reference * length comparison to zero * length comparison to zero * length comparison to zero
* clippy: Fix another batch of clippy warnings in `components/scripts` (#31912)Rosemary Ajayi2024-03-282-10/+10
| | | | | | | * boolean can be simplified * boolean can be simplified * boolean can be simplified
* clippy: Fix more clippy warnings in `components/scripts/dom` (#31914)Rosemary Ajayi2024-03-285-11/+11
| | | | | * refrence to a reference * refrence to a reference
* clippy: Fix a few clippy problems in `components/scripts/dom` (#31905)Rosemary Ajayi2024-03-283-12/+10
| | | | | * option_as_ref_deref * fix
* fix redundant closures in component/script/dom (#31917)Ekta Siwach2024-03-2826-44/+35
| | | | | | | | | | | | | * fixed unnecessary conversions * resolved conflicts * resolved conflicts * fix redundant closures in component/script/dom * resolved conflicts * fixed formatting