aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
Commit message (Collapse)AuthorAgeFilesLines
* Update Stylo to 2023-09-01 (#31609)Oriol Brufau2024-03-1812-47/+90
| | | | | | | | | | | | | | | | | | | | | * Update Stylo to 2023-09-01 * Fixup for https://phabricator.services.mozilla.com/D184929 * Fixup for https://phabricator.services.mozilla.com/D184526 * Fixup for https://phabricator.services.mozilla.com/D184525 * Fixup for https://phabricator.services.mozilla.com/D185154 * Fixup for https://phabricator.services.mozilla.com/D184685 * Fixup for https://phabricator.services.mozilla.com/D185916 * Fixup for https://phabricator.services.mozilla.com/D185492 * Fixup for https://phabricator.services.mozilla.com/D186626 * Update test expectations
* clippy: Fix some warnings in the `script` crate (#31719)Rosemary Ajayi2024-03-186-26/+24
| | | | | | | | | | | | | | | | | | | | | * Fix InlineFormatting error * BoxFrament * fix clippy error * clippy:fix clipy errors * fix clippy errors * fix clippy errors * fix clippy errors * Remove changes to `layout_2020` --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix several warnings (#31710)RustAndMetal2024-03-1815-68/+62
| | | Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
* clippy: Fix warnings in generated code (#31721)eri2024-03-171-41/+49
| | | | | | | | | * clippy: remove extra static lifetimes in generated code * clippy: fix return and cast in generated code * clippy: fix more warnings in codegen * clippy: fix all errors from generated files
* Implement console.count/countReset (#31635)Smitty2024-03-173-0/+46
| | | | | | | | | | | * Implement console.count/countReset * Address review comment Signed-off-by: syvb <me@iter.ca> --------- Signed-off-by: syvb <me@iter.ca>
* clippy: Fix warnings in `components/script` (#31700)Richard Dushime2024-03-152-6/+6
| | | | | * Fix warnings: immediate dereferencing of references and unneeded statement * Fix warnings in Components/script
* Implement HTMLStyleElement.disabled attribute (#31682)Oriol Brufau2024-03-142-1/+15
| | | https://html.spec.whatwg.org/multipage/#dom-style-disabled
* dependencies: Upgrade to WebRender 0.64 (#31486)Martin Robinson2024-03-141-1/+1
| | | | | | | | | This brings the version of WebRender used in Servo up-to-date with Gecko upstream. The big change here is that HiDPI is no longer handled via WebRender. Instead this happens via a scale applied to the root layer in the compositor. In addition to this change, various changes are made to Servo to adapt to the new WebRender API. Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* fix: missing thread name when spawning (#31656)Ngo Iok Ui (Wu Yu Wei)2024-03-141-28/+34
| | | | | * Add missing thread name when spawning * Update namings
* rusdoc: Fix `idl` warning in components/script/dom/bindings (#31643)Oluwatobi Sofela2024-03-131-2/+2
| | | | | * rusdoc: Add valid domstring link * rustdoc: Replace unused idl link ref
* rustdoc: Fix warnings in `components/script/dom` (#31632)Azhar Ismagulova2024-03-132-3/+5
| | | | | | | | | | | | | | | * fix: fixed warnings in components/script/dom * fix: resolved comment by setting explicit link to HTMLConstructor * fix: changed the format of WHATWG link * Fix line breaking * Remove trailing white space --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix assorted warnings in `components/` (#31628)eri2024-03-131-1/+1
| | | | | | | * clippy: fix assorted warnings in `components/` * fix: new and default * fix: review comments
* clippy: Fix warnings in `components/shared` (#31627)eri2024-03-122-2/+2
| | | | | | | * clippy: fix warnings in `components/shared` * fix: formatting derive * fix: rename new to default
* Gamepad: Align closer to spec and implement missing slots (#31385)Daniel Adams2024-03-125-38/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement missing gamepad slots, align to spec more - Fixes TODO's from initial gamepad implementation - Adds some missing spec steps * Only handle gamepad events when pref is enabled * Return empty list in getGamepads if document not active * ./mach fmt * Update getGamepads to return an array instead of GamepadList * Add spec link for [[exposed]] slot * Remove failing test expectations for not-fully-active * A few fixes - Change should_notify to has_gesture - Add spec links and TODO to navigator - Remove unneeded clone from GamepadList::list - Move gamepadconnected event firing into has_gesture block * Use queue_with_canceller for tasks and add expects * Explicitly check for gamepad user gesture * Move user gesture check into separate function * Change contains_user_gesture to be a gamepad function * mach fmt * Change axis/button threshold constants to be private to module
* Fix rustdoc errors in `components/script/dom` (#31617)Mucha Naibei2024-03-114-4/+4
| | | | | * Fix rustdoc errors in components/script/dom * Revert if to iff in audiobuffer.rs
* Use get_desired_proto in htmlconstructor (#31600)Samson2024-03-102-42/+15
| | | | | * Use get_desired_proto in htmlconstructor * Update expectations
* fix: resolved warning related to deprecated method ↵Azhar Ismagulova2024-03-081-2/+5
| | | | chrono::NaiveDateTime::from_timestamp_opt (#31593)
* fix: resolved warnings related to deprecated method ↵Azhar Ismagulova2024-03-081-4/+4
| | | | chrono::NaiveDateTime::timestamp_millis (#31584)
* clippy: fix warnings in various modules in components (#31568)eri2024-03-081-4/+4
| | | | | | | | | * clippy: fix warnings in various modules in components * fix: unit tests * fix: build on android * fix: all samplers use new_boxed
* Extract generated finalizers into generic helper functions. (#31569)Josh Matthews2024-03-083-31/+60
|
* Update phf_codegen and phf_shared to 0.11 (#31537)Munish Mummadi2024-03-081-2/+2
| | | | | * Update phf_codegen and phf_shared to 0.11 * Updated the Cargo.lock With ./mach build
* Fix clippy warnings in `components/rand` (#31549)sandeep2024-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | * resolved clippy warnings in components/rand Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local> * replaced new() with default() Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local> * replaced ServoRng::new() with ServoRng::default() Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local> * moved the contents of the new() method into the default() method Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local> --------- Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local> Co-authored-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
* Add basic support for enumerating computed styles (#31499)Oriol Brufau2024-03-061-0/+52
| | | | | | | | | | | * Add basic support for enumerating computed styles The old code was so broken, it was enumerating the style attribute instead of the computed styles. So this patch implements a basic enumeration, but not including custom properties whose computed value is not the guaranteed-invalid value. * Feedback
* Move convert_* functions into gpuconvert.rs (#31521)eri2024-03-067-339/+365
| | | | | * feat: unify convert_* functions across gpu*.rs files #31104 * chore: reorder and format
* Fix "unused import" warning (#31485)Oriol Brufau2024-03-041-1/+0
|
* Add CSSOM support for CSS layers (#31481)Oriol Brufau2024-03-038-3/+206
| | | Instead of just crashing.
* Update gstreamer crates to 0.22 (#31465)Samson2024-03-011-1/+1
|
* script: Implement `<meta http-equiv="refresh">` (#31468)Smitty2024-03-015-9/+185
| | | | | * script: Implement <meta http-equiv="refresh"> * Address review comments
* Update Stylo to 2023-07-23 (#31437)Oriol Brufau2024-02-295-10/+24
| | | | | | | | | | | | | | | | | | | * Update Stylo to 2023-07-23 * to_shmem should be local when working with Stylo * Fixup for https://phabricator.services.mozilla.com/D180769 * Fixup for https://phabricator.services.mozilla.com/D181125 * Fixup for https://phabricator.services.mozilla.com/D181162 * Fixup for https://phabricator.services.mozilla.com/D181798 * Fixup for https://phabricator.services.mozilla.com/D182514 * Fixup for https://phabricator.services.mozilla.com/D182539 * Update test expectations
* fix invalid video poster image loading from panicking (#31447)Sebastian C2024-02-281-2/+2
| | | | | | | | | This fixed #31438. When an image is loaded from cache, it will load a placeholder if the url is not a valid image url. This may be unexpected when using the image cache and specifying UsePlaceholder::No but that has no effect on loading an image not in the cache. Signed-off-by: Sebastian C <sebsebmc@gmail.com>
* webaudio: Throw when setting invalid automationRate on AudioBufferSourceNode ↵Shamir Khodzha2024-02-2810-10/+56
| | | | (#26469)
* Update overrideMimeType and final-charset to match xhr spec (#29812)cybai (Haku)2024-02-281-31/+35
| | | | | | | | | | | * Update overrideMimeType to match xhr spec * Update final-encoding to match xhr spec * Fix an issue and add more comments --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* mach: Do not use unstable rust for `rustfmt` (#31441)Martin Robinson2024-02-281-5/+8
| | | | | | | | | | We can use stable rust if we pass the unstable configuration as command-line arguments to rustfmt itself. This prevents needing to install an unstable rust toolchain. The one downside here is that it doesn't seem that "ignore" is supported so we have to start formatting the files in "third_party." This shouldn't be a huge issue because we don't plan to check much more rust code into those directories.
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove packages that were moved to external repo * Add workspace dependencies pointing to 2023-06-14 branch * Fix servo-tidy.toml errors * Update commit to include #31346 * Update commit to include servo/stylo#2 * Move css-properties.json lookup to target/doc/stylo * Remove dependency on vendored mako in favour of pypi dependency This also removes etc/ci/generate_workflow.py, which has been unused since at least 9e71bd6a7010d6e5723831696ae0ebe26b47682f. * Add temporary code to debug Windows test failures * Fix failures on Windows due to custom target dir * Update commit to include servo/stylo#3 * Fix license in tests/unit/style/build.rs * Document how to build with local Stylo in Cargo.toml
* layout: Add line height from preserved segment breaks in quirks mode (#31419)Martin Robinson2024-02-261-0/+4
| | | | | | | | | | In quirks mode, preserved segment breaks should add line height to lines. This matches the behavior of WebKit and Blink, but not Gecko. This also handles the special-case of `<br>` elements, which are implemented with preserved segment breaks via `white-space: pre-line`. This is an implementation detail though because `<br>` has a special behavior if the line isn't empty -- it doesn't add any line height in this case.
* Rename buffer_source_type to buffer_source (#31426)Taym Haddadi2024-02-266-23/+22
| | | | | | | | | | | | | * Rename buffer_source_type to buffer_source Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Code format Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* WedIDL: bring dom/bindings/typedarray further in line with spec (#31375)Taym Haddadi2024-02-2515-317/+505
| | | | | | | | | | | | | | | | | * WedIDL: bring dom/bindings/typedarray further in line with spec Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Rename HeapBufferSourceTypes to HeapBufferSource Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * fmt code Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Fix crash when closing window containing video element (#31413)Josh Matthews2024-02-233-2/+15
| | | | | * Forbid casting DOM objects when JS runtime is shutting down. * Remove media controls from document when element is removed from the tree.
* script: Do not run layout in a thread (#31346)Martin Robinson2024-02-2312-279/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Do not run layout in a thread Instead of spawning a thread for layout that almost always runs synchronously with script, simply run layout in the script thread. This is a resurrection of #28708, taking just the bits that remove the layout thread. It's a complex change and thus is just a first step toward cleaning up the interface between script and layout. Messages are still passed from script to layout via a `process()` method and script proxies some messages to layout from other threads as well. Big changes: 1. Layout is created in the script thread on Document load, thus every live document is guaranteed to have a layout. This isn't completely hidden in the interface, but we can safely `unwrap()` on a Document's layout. 2. Layout configuration is abstracted away into a LayoutConfig struct and the LayoutFactory is a struct passed around by the Constellation. This is to avoid having to monomorphize the entire script thread for each layout. 3. Instead of having the Constellation block on the layout thread to figure out the current epoch and whether there are pending web fonts loading, updates are sent synchronously to the Constellation when rendering to a screenshot. This practically only used by the WPT. A couple tests start to fail, which is probably inevitable since removing the layout thread has introduced timing changes in "exit after load" and screenshot behavior. Co-authored-by: Josh Matthews <josh@joshmatthews.net> * Update test expectations * Fix some issues found during review * Clarify some comments * Address review comments --------- Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* layout: Add initial support for `text-transform` (#31396)Martin Robinson2024-02-221-1/+1
| | | | | | | | | | | | | This adds basic support for `text-transform` in a way that is more complete than legacy layout. There are still many missing elements of proper `text-transform` support such as: 1. Support for `full-width` and `full-size-kana` 2. Support for grapheme based uppercasing, lowercasing, and capitalization. These are all done per-code point right now. 3. Support for the language-specific `SpecialCasing.txt` cases for case mapping such as the ones for Irish and Turkish. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Revert remaining Stylo changes (#31408)Delan Azabani2024-02-221-1/+1
| | | | | * Revert remaining changes from Stylo split-into-commits branch * Do the minimum amount of formatting to appease mach test-tidy
* layout: Add support for table rows, columns, rowgroups and colgroups (#31341)Martin Robinson2024-02-206-27/+90
| | | | | | | | | | | | | | This adds support for table rows, columns, rowgroups and colgroups. There are few additions here: 1. The createion of fragments, which allows script queries and hit testing to work properly. These fragments are empty as all cells are still direct descendants of the table fragment. 2. Properly handling size information from tracks and track groups as well as frustrating rules about reordering rowgroups. 3. Painting a background seemlessly across track groups and groups. This is a thing that isn't done in legacy layout (nor WebKit)! Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Check for XML and XMLS namespace during 'locating a namespace' (#31374)Keith Yeung2024-02-202-5/+22
| | | | | | | * Check for XML and XMLS namespace during 'locating a namespace' * Address review comments * Remove test expectation in legacy layout meta
* Implement non-XR Gamepad discovery and input (#31200)Daniel Adams2024-02-1711-19/+386
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Create embedder event to send to constellation * Handle gamepad message in constellation, send to script thread * Handle GamepadEvent in script thread and dispatch event to document * Add missing Clones, fix event * Add gamepad task source * Adjust GamepadIndex type, remove unused imports * Add internal getter for gamepads list * Update gamepad new methods * Handle gamepad connect and disconnect events * Proto will be none, no need for HandleObject * Initialize buttons and axes to standard mapping * Adjust update type index types * Update GamepadButton update function * Adjust Gamepad mapping comments to match spec, add update logic * Amend comment * Update button and axis inputs on Updated event * Add GilRs as gamepad backend in servoshell * Add spec links, queue gamepad updates on task source * ./mach fmt * Fix comment length * Split out button init, update spec comments * Move gamepad event handling from document to global * Map and normalize axes/button values * Use std::time for gamepad timestamp * Adjust gamepad handling in event loop * Move button press/touch check into map+normalize function - Small change but is more in line with spec * ./mach fmt * Update comment spec links and warning messages * Doc comments -> regular comments * Add window event handlers for gamepad connect/disconnect * Adjust gamepad disconnect behavior * Add missing TODO's, adjust gamepad/gamepadbutton list methods and formatting * Update button handling from gilrs, add comments * Enable gamepad pref during WPT tests and update expectations * Update WPT expectations in meta-legacy-layout
* WebIDL: Use Uint8ClampedArray instead of raw JSObject in bindings (#31317)Taym Haddadi2024-02-165-55/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WebIDL: Use Uint8ClampedArray instead of raw JSObject in bindings Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * fmt Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * introduce new_initialized_heap_typed_array function Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Remove unsed unsafe_code Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use doc comments for ImageData Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use get_internal instead of acquire_data Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Handle JS errors in ImageData GetData and new_initialized_heap_typed_array Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Fix wrong assert that causes CRASH in test Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Early return for error Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Address review comments Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* style: Remove dependency on servo_url (#31358)Martin Robinson2024-02-1614-60/+87
| | | | | In order for stylo to be a separate crate, it needs to depend on less things from Servo. This change makes it so that stylo no longer depends on servo_url.
* WebIDL: Use ArrayBufferViewU8 instead of raw JSObject in bindings (#31325)Taym Haddadi2024-02-162-6/+7
| | | | | | | | | | | | | | | | | * WebIDL: Use ArrayBufferViewU8 instead of raw JSObject in bindings Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Remove unused imports Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Address review comments Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Support the parsing of image/svg+xml elements (#31318)Keith Yeung2024-02-142-4/+4
| | | | | * Support the parsing of image/svg+xml elements * Update WPT test expectations
* Fix rooting of external array buffer pointer (#31342)Taym Haddadi2024-02-141-3/+5
| | | Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* WebIDL: Use `ArrayBuffer` instead of raw `JSObject` in bindings (#31202)Taym Haddadi2024-02-135-69/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WebIDL: Use ArrayBuffer instead of raw JSObject in bindings Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Convert GPUBufferMapInfo mapping to Arc<Mutex> * Remove #[allow(unsafe_code)] from GPUBuffer * Add doc comments * Implement trace for Arc<Mutex<Vec<T>>> Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use #[no_trace] for GPUBufferMapInfo.mapping * Make create_new_external_array_buffer generic Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Address review comments * Remove HeapTypedArray::new and avoid cloning Arc Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use expect for GetMappedRange and ReadAsArrayBuffer Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use doc comments for FileReaderSyncMethods Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Return for Error::JsFailed GetMappedRange and ReadAsArrayBuffer Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Fix detached_internal implementation and comments Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * format code Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Update expectations --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>