Commit graph

306 commits

Author SHA1 Message Date
Gregory Terzian
379bbb41dd
Dom: Re-implement ReadableStream Part 1 : Default Reader and Controller (#34064)
* Re-implement readablestream: basics and default reader and controller

---------

Co-authored-by: Jason Tsai <jason@pews.dev>
Signed-off-by: Wu Wayne <yuweiwu@pm.me>

Add remaining WebIDLs of ReadableStream (#32605)

* Add Reader's WebIDL files

* Add necessary methods in ReadableStream.webidl

Signed-off-by: Wu Wayne <yuweiwu@pm.me>

Create safe wrapper for JSFunctions (#32620)

* Create safe wrapper for JSFunctions

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Add assert to check if the  name ends in a null character

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Create macro to wrap unsafe extern "C" function calls

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove WRAPPER_FN

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Add macro example documentation

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use  C-string literals

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Ensure name is Cstr type

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Scope #[allow(unsafe_code)]

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Wu Wayne <yuweiwu@pm.me>

Start implementation of default controller and reader

Start implementation of default controller and reader

* implement basic internal slots, with todos

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* enum for controller

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* re-implement native controller methods

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add calling into pull algo

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* more details on chunk enqueuing

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add fulfill read request, clean-up warnings

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* read request and reader typing

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* allow for more than one non-native underlying source type

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add todo for should pull

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add underlying source dom struct container

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* remove rc around source type

* add default controller init in stream constructor

* setup source container with prototype of source dict

* clean-up docs, dispatch of controller in pull algo call

* turn off SM streams

* remove prototype setting on underlying source container

* fix read request promise resolving

* tidy

* clean-up js conversions in read req handlers

* add queue with sizes concept

* use dom in pull promise handlers

* Demonstrate using dictionary as callback this object.

* move value with size to a struct

* fmt

* put readable stream state in a cell

* nits in expectations

* remove allow unroot by passing read result directly to promise resolving

* tidy

* root default controller inside call_pull_if_needed

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Wu Wayne <yuweiwu@pm.me>

ReadableStream: implement Cancel and Locked (#33136)

* implement Locked

* implement Cancel and close

Signed-off-by: Wu Wayne <yuweiwu@pm.me>

Add GetPromiseIsHandled and SetAnyPromiseIsHandled to Promise

Signed-off-by: Taym <haddadi.taym@gmail.com>

mach fmt

Signed-off-by: Taym <haddadi.taym@gmail.com>

Readablestream default controller: get desired size (#33497)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

stream: implement controller close (#33498)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

implement stream default controller error (#33503)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

Readablestream default controller: enqueue (#33528)

* Implement ReadableStreamDefaultControllerMethods::Enqueue

Signed-off-by: Wu Wayne <yuweiwu@pm.me>

* Add spec comments

Signed-off-by: Wu Wayne <yuweiwu@pm.me>

---------

Signed-off-by: Wu Wayne <yuweiwu@pm.me>

readablestream default controller: fulfill read requests (#33542)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

Fix extract_size_algorithm (#33561)

Signed-off-by: Wu Wayne <yuweiwu@pm.me>

Readablestream default controller: use strategy size (#33551)

* readablestream default controller: use strategy size, fallible enqueue

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

docs

* readablestream default controller: clear strategy size

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* prevent potential re-borrow panics when calling into the strategy size

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* document readablestream constructor

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

Readablestream: impl default controller should pull, start algo (#33586)

* implement should-pull algo for default controller

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add start algorithm setup for default controller

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

implement promise native handling for start and pull algorithms (#33603)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

Implement ReadableStreamDefaultReader (#33160)

* Implement ReadableStreamDefaultReader

 Make the stream mutable
 readable-stream-reader-generic-release
 Proper error types when releasing
 Closed
 Cancel

Signed-off-by: Taym <haddadi.taym@gmail.com>

* follow the spec more closely

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>

Implement ReadableStreamDefaultReader read (#34007)

* Implement ReadableStreamDefaultReader read

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Perform readRequest’s error steps with stream.stored_error

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>

Improve ReadableStreamDefaultReader close (#34014)

* improve ReadableStreamDefaultReader close

Signed-off-by: Taym <haddadi.taym@gmail.com>

* remove resolve_closed_promise

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>

Use Rc<Box<[u8]>> for queue to optimize get_in_memory_bytes

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>

* Improve read_a_chunk and stop_reading implemntation (#34077)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Implement ReadableStreamDefaultReader::Constructor  (#34056)

* Implement ReadableStreamDefaultReader::Constructor

Signed-off-by: Taym <haddadi.taym@gmail.com>

* make start_reading returns ReadableStreamDefaultReader

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Fix can_gc
Signed-off-by: Taym <haddadi.taym@gmail.com>

* Add canGc to ReadableStream::GetReader

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Readablestream fix CanGc (#34080)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* correct ReadableStream::error_native implementation and fix clippy warnings (#34088)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* turn assertion of stream present on controller on a early return with false (#34097)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Fix already mutably borrowed crash (#34105)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Refactor `get_in_memory_bytes` to return `Option<Vec<u8>> and avoid `unreachable!` panic (#34123)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Set ReadableStream ReadableStreamDefaultReader in start_reading (#34125)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Fix  Unhandled rejection with value: object `TypeError: stream is not locked` (#34204)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Fix  assert!(self.is_readable()) crash in ReadableStream::close (#34207)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix call to to_js_object in underlying source algos (#34098)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* do not assume presence of a stream when performing pull steps (#34244)

* do not assume presence of a stream when performing pull steps

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add doc comments

Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* gracefully handle failure of underlying source algorithms (#34243)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* ensure result of calling start algo is an object (#34245)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* return js failed error if underlying source constructor threw (#34246)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Use JSVal for ValueWithSize::value (#34259)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix release reader lock, (#34255)

fix setting stream on controller in new,
fix matching fallthrough,
reduce visibility of controller error method

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* in stream cancel, reject promist if locked (#34271)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Fix UnderlyingSourceContainer::call_start_algorithm (#34277)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* implement controller cancel steps, fix stream cancel method (#34301)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix conditional in perform pull steps (#34324)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* set reader closed promise to one resolved with undefined if stream closed on init (#34321)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix init of stream and controller (#34323)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Stream: Fix reborrow in controller enqueue, and fix error and exception handling. (#34338)

* fix re-borrow in controller enqueue

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* do not call to_jsval on JSFailed error in enqueue

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix error and exception handling in controller enqueue

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* remove TODO about correctness of stored error, since this was done as part of the switch to a js val.

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Stream: Fix incorrect "this" object in underlying source callbacks (#34368)

* in controller close, throw type error if stream cannot be closed

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* store original js object for underlying source, for use as this object in callbacks

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix conditional logic in enqueue to ensure pull is called into (#34375)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Stream: Fix bytelength queueing strategy (#34376)

* fix handling of value that is not an object in bytelength queuing strategy

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* return type error if strategy size call fails, to prevent panic because no exception is pending

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* set correct  default count queuing size strategy (#34389)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* use proto in stream constructor (#34441)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix edge cases in get_desired_size (#34440)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Stream: fix algo and strategy calls error handling. (#34424)

* fix error handling in cancel steps

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* in pull steps, reject promise if pull algo throws

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* if start algorithm fails, rethrow the error

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* when the strategy size fails, directly get the pending exception and use it to error the stream

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* add error handling to enqueue value with size

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* when enqueueing a value errors, ensure we error and stream with the same error used to throw an exception

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix native use of streams (#34468)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Implement readablestreamdefaulttee (#34405)

* Implement readablestreamdefaulttee

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Create UnderlyingSourceType::Tee each stream

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Use Dom instead of DomRoot

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Queue a microtask for readRequest chunk steps

Signed-off-by: Taym <haddadi.taym@gmail.com>

* fix create_readable_stream

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Remove unnecessary Rc

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Use correct doc link

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Add #[allow(crown::unrooted_must_root)]

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Fix crash in ClosedPromiseRejectionHandler

Signed-off-by: Taym <haddadi.taym@gmail.com>

* reflect TeeReadRequest and TeeUnderlyingSource
Signed-off-by: Taym <haddadi.taym@gmail.com>

* fix can_gc

Signed-off-by: Taym <haddadi.taym@gmail.com>

* reflect tee source, and fix use of mutable dom for tee source and request

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* Fix typo that resolves multiple test failures in 'Tee' tests

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Fix readable-streams/tee.any.js test

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Align ReadableStreamDefaultReader with spec and fix additional tests in default-reader.any.js (#34531)

And fix crate::DomTypeHolder usage

* Align ReadableStreamDefaultReader with spec and fix additional tests in default-reader.any.js

Signed-off-by: Taym <haddadi.taym@gmail.com>

* make reader rooted in Constructor and acquire_default_reader

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Remove spaces

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Streams: fetch stream chunks should be uint8 arrays (#34553)

* fetch stream chunks should be uint8 arrays

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* fix clippy

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Update wpt test for ReadableStream reimplementation (#34579)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Fix ignore_malloc_size_of in readablestream tee (#34578)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Remove incorrect use of handle array, fail test safely by giving only one reason (#34560)

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Update more wpt test for ReadableStream reimplementation (#34598)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Fix doc and rename Tee to DefaultTee (#34612)

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix: Address review comments

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Update response-stream-with-broken-then.any.js.ini test expectation

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix reflect_dom_object can_gc

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Fix compositeReason for DefaultTeeUnderlyingSource (#34627)

* Fix compositeReason for DefaultTeeUnderlyingSource

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Update test

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

* Last fixes stream (#34636)

* remove now unsused from_js method of readable stream

* fix documenation of error steps

* return type error instread of panicking on a todo, when trying to construct a stream of type bytes

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>

* fix crown rooting related errors (#34662)

Signed-off-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Wu Wayne <yuweiwu@pm.me>
Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
2024-12-17 21:14:00 +00:00
Josh Matthews
bc2def0582
script: Add stub interface for AbortController. (#34519)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: syvb <me@iter.ca>
2024-12-10 07:31:04 +00:00
Ville Lindholm
bc7fe41a02
Add XPath parser/evaluator (#34463)
* Add XPath parser/evaluator

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* Correctly annotate XPathEvaluator IDL

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: have bindings pass in `can_gc`

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add docstrings

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: implement PartialEq for Value for readability

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add docstrings for CoreFunctions

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: simplify node test code

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add unit tests for string handling xpath functions

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* put xpath features behind dom.xpath.enabled pref

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review] remove rstest and insta dev-deps

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* update wpt test expectations

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: tweak metadata files

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* update wpt test expectations AGAIN

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

---------

Signed-off-by: Ville Lindholm <ville@lindholm.dev>
2024-12-08 02:01:50 +00:00
atbrakhi
1591a3b506
Add webgpu feature flag (#34444)
* Move script gpu files into webgpu folder

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* Modify gpu webidls

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* move gpu realted webidl

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* add webgpu feature to script

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* add dummy implementation for gpucanvascontext

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* fmt

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* add skip-if CARGO_FEATURE_WEBGPU

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* Move NavigatorGPU and workerNavigator GPU to webgpu idl

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* fmt and cleanup

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* review fix

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* enable webgpu by default and also some fmt fix

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* Add pref back, fix imports, small cleanups

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2024-12-05 16:07:27 +00:00
Ngo Iok Ui (Wu Yu Wei)
e061a59f03
script: add PointerEvent (#34437)
* Add PointerEvent webIDL

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>

* Implement all new methods

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>

* Cleanup warnings

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>

* Update wpt meta

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>

* Update interface list

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>

* Update manifest

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>

* Update doc links

Signed-off-by: Wu Wayne <yuweiwu@pm.me>

---------

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>
Signed-off-by: Wu Wayne <yuweiwu@pm.me>
2024-12-02 11:53:29 +00:00
atbrakhi
d2d3407501
Move script gpu files into webgpu folder (#34415)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2024-11-28 14:24:15 +00:00
Gae24
c9e3d3e25e
Implement DataTransfer and related interfaces (#34205)
* add datatransfer interfaces

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* implement DataTransfer interface

implemented Constructor, setter and getter for drop_effect and effect_allowed, Items and SetDragImage

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* implement DataTransferItem interface

Implemented Kind, Type, GetAsString, GetAsFile.
Marked DataTransfer as weakReferenceable to access its field
inside DataTransferItemList and DataTransferItem.
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* implement DataTransferItemList interface

implemented Lenght, Getter, Add, Remove, Clear
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* added DataTransfer's old interface

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* DataTransfer: implemented GetData, SetData, SetData

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* set Weakref to DataTransfer in DataTransferItemList and DataTransferItem

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* DataTransfer: implemented Types and Files

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* cleanup get_data, set_data, clear_data

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix clippy warning

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* add drag data store

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix DataTransfer's Types() behaviour

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* DataTransferItem: use the underlying drag data store

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix DataTransferItemList's getter and remove

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix clippy warnings

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update test expectations

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2024-11-25 10:49:04 +00:00
Josh Matthews
3faed9b921
Filter out webidl files based on special comments, and feature-gate webxr interfaces. (#34348)
* Filter out webidl files based on skip-if directives.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Don't build XR functionality without webxr feature.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix tidy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Adjust imports for file movement.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Clean up webxr module import.

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-11-24 18:01:35 +00:00
chickenleaf
257f4b84db
DOMRectList interface implementation (#34025)
* rechecking all file changes and additions

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* added comments with specification links

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* added space before the links

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* modified the doc link format

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* suggested changes + updated interfaces.https.html + updated passing test expectations

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* needed to do an update-manifest

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* updated the idlharness.any.html expectations

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-11-01 15:58:30 +00:00
Martin Robinson
3b5dc069ae
dom: Stub out the IntersectionObserver interface (#33989)
This is the first step toward implementing the IntersectionObserver
interface. It adds stubs which are exposed when a preference is turned
on. This is enough to get some sites with `IntersectionObserver` to
start working.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-25 09:26:47 +00:00
Daniel Adams
fc0d4d8157
crypto: Begin SubtleCrypto implementation (#33628)
* Update IDLs and Bindings conf

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add AES crate

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement DOM interfaces

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* IDL tidy

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove deriveKey from inRealms for now until implemented

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix CryptoKey rustdoc comments

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Move string constants to top of file

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Use properly rooted CryptoKey

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Code clarity

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Rework NormalizedAlgorithm to not hold a DOMString

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add Rustdoc for CryptoKey interface

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Move ignore mallocsizeof to rand crate, remove from crypto

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update cargo lock

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix key handling, implement exportKey with JWK TODO

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Use create_buffer_source, remove aes dep from libservo

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix crash when running in worker

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Move CryptoKey and SubtleCrypto behind pref for now

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Readd timeout expectation

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-10-08 03:51:08 +00:00
Daniel Adams
f8e0fde044
webxr: Implement reference space reset events (#33460)
* Initial interface implementation

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add event handler

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update FakeXRDevice interface

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement reset event

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Downcast bounded spaces

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update webxr commit

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Adjust DomRoot usage

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update manifest

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-17 02:22:15 +00:00
Daniel Adams
c028b5c299
webxr: Implement XRBoundedReferenceSpace (#33176)
* Implement XRBoundedReferenceSpace

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update interfaces

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing pref condition on IDL interface

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-25 23:53:39 +00:00
Daniel Adams
5520a9eb50
webaudio: Implement IIRFilterNode (#33001)
* Basic IIRFIlterNode bindings

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add constructor to BaseAudioContext

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update IDL and use statements

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update non-crashing test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Tidy

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Optimize error checks

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Pass context channel count to servo-media

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update legacy expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add IIRFilterNode in interfaces.html

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update MANIFEST

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-12 00:27:54 +00:00
Samson
b8cf0cf9af
webgpu: Implement proper async pipeline creation and GPUPipelineError (#32636)
* Add GPUPipelineError

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Proper GetBindGroupLayout

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Proper Create*PipelineAsync

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixups

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* more good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-08 11:48:43 +00:00
Chocolate Pie
92866ab911
enhance: Add support for unsafe-eval and wasm-unsafe-eval (#32893)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
2024-08-01 17:26:44 +00:00
Daniel Adams
2c17de7fa7
Gamepad: Implement GamepadHapticActuator (#32046)
* Implement Servo side of GamepadHapticActuator

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Get build working

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Create effect handling on embedder side

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update tracing for GamepadHapticEffect

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update gilrs to point to commit with effect complete event

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement playing and preempting haptic effects

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update IDL to add trigger rumble

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update WPT expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Handle stopping haptic effects from reset()

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* ./mach fmt, fix test-tidy issues

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add extra validity checks for trigger rumble

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Retrieve supported haptic effects from embedder

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link, pin gilrs commit

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* servoshell cargo formatting

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix Cargo.toml

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Additional comments, realm proof, naming

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* ./mach fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update gilrs rev to gilrs-core 0.5.12 release

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement sequence ids for gamepad haptic promises

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Take playing effect promise instead of cloning

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement listener for reset function

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix Cargo.lock

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Restructure IPC listeners, add comments, handle visibility change

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Check that haptic effect still exists before handling ff completion event

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Visibility steps, add InRealm bindings for promises

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add Gamepad EmbedderMsg arms to egl servo_glue

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-07-20 06:29:27 +00:00
Ngo Iok Ui (Wu Yu Wei)
40bac8c3df
script: document.visibilityState and document.hidden (#32635)
* Squashed commit of the following:

commit 5e0ea9996cb0d8137c3e1cd04487a1065b61289d
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 11 13:37:51 2024 +0900

    Move lint to new_inherited

    Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

commit a8cbfb1eef2650d153ef41c232d9e80e1118fc37
Merge: b819968f3e 7a33f8f008
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 11 13:32:18 2024 +0900

    Merge branch 'main' into visibility

commit b819968f3eaa361c8a2cf3af679943ae2065ab32
Merge: eda2ec4c22 1c6b74e1f1
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 9 14:26:43 2024 +0900

    Merge branch 'main' into visibility

commit eda2ec4c225c63236d6851ea525455cad8874ce5
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Thu Jul 4 14:25:05 2024 +0900

    Include page-visibility tests to wpt

commit 9da7b4ee39b141e59e4a21a64445c4b08499463f
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 4 12:50:40 2024 +0900

    Add TODO comment for future update

commit 11f55fea3ead0c8fa07f16557a63cc6a77c15c3f
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Wed Jul 3 11:01:51 2024 +0900

    Add spaces between steps

commit 408c3e51f25867e85f894cd77a6355bc32f2aa00
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 18:33:53 2024 +0900

    Update MANIFEST.json

commit 679fe4ffdd28554b11b4018395fac22a08ccbc34
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 18:27:02 2024 +0900

    Add VisibilityStateEntry to mozilla/interfaces.html

commit 4a456a2b4a473fa795274edf56ecf660616f90eb
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 14:28:11 2024 +0900

    Update meta results

commit cd191447ff61de392526e00c13f765c2df7a269e
Merge: 7ff480a698 ad01342f00
Author: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
Date:   Tue Jul 2 13:47:49 2024 +0900

    Merge branch 'main' into visibility

commit 7ff480a698413ac5526edfb1b8731373bb9d04ae
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 13:12:44 2024 +0900

    Update description text of update_visibility_state

commit 0e496b7bce4fd5476a1919737b00e8f0c9e2fdc8
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 12:59:40 2024 +0900

    Add specification link to VisibilityStateEntry methods

commit 3e4a061450621bd17f19ff81099dd4daaeaea478
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 12:31:53 2024 +0900

    Add descriptive text to each step

commit 8bbdfcae97db5002b09e5f5ecec6ae80d080dc95
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 19:15:34 2024 +0900

    mach fmt

commit dc1c7a4aec6aba56af7afcfee6feadbee242a643
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 19:01:00 2024 +0900

    Add update_visibility_state

commit 6aa18143319044dc084a9585ab064cd853bccc21
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 16:06:25 2024 +0900

    Add VisibilityStateEntry.webidl

commit 638ae3cd563004334d35cc3fbdc1f918d29833d0
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Fri Jun 28 13:39:29 2024 +0900

    Add visibilityState and hidden in Document.webidl

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Move creation into reflect call

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2024-07-12 08:32:25 +00:00
Mukilan Thiyagarajan
a730469b70
script: Implement the FontFaceSet DOM API (#32576)
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>
2024-06-26 09:44:47 +00:00
Gregory Terzian
3d78d60619
implement basic infra for ResizeObserver (#31108) 2024-06-17 16:44:07 +00:00
Samson
794110ebe5
webgpu: Move errorscopes to WGPU thread (#32304)
* Prepare errorscopes logic in wgpu_thread

* remove scope_id from ipc

* new GPUErrors per spec

* remove cotent timeline error_scope

* fixup poperrorscope types

* device_scope -> gpu_error and nice errors

* Handle errors detection more elegantly

* good expectations

* new expectations

* Make error_scope.errors Vec as per spec
2024-05-22 16:47:35 +00:00
Samson
8bc49299c8
Revert "script: implement AbortController (#31361)" (#32243)
This reverts commit 7fce850cff.
2024-05-07 06:23:14 +00:00
Smitty
7fce850cff
script: implement AbortController (#31361)
* 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>
2024-05-04 15:00:01 +00:00
cathiechen
4e4a4c0a28
Implement form-associated custom elements and their ElementInternals (#31980)
* 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>
2024-04-11 13:17:11 +00:00
Daniel Adams
e38b34a629
Gamepad: Remove GamepadList and fix dropped connection event on startup (#31684)
* 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
2024-04-08 09:43:48 +00:00
cathiechen
cb275e086c
Implement StaticRange (#31809)
* Add DOM interface for AbstractRange

* Add DOM interface for StaticRange

* Update WPT tests for StaticRange-constructor.html

* Fix formatting

* Add AbstractRange & StaticRange in interfaces.html

* rebased the code and fixed the failures

Signed-off-by: Cathie Chen <cathiechen@igalia.com>

* update the expected result in idlharness.window.js.ini file

* Addressed the code review comments

* updae the test result of legacy layout

---------

Signed-off-by: Cathie Chen <cathiechen@igalia.com>
Co-authored-by: Nipun Garg <nipung271@gmail.com>
2024-03-22 15:02:01 +00:00
eri
a8170966ec
Move convert_* functions into gpuconvert.rs (#31521)
* feat: unify convert_* functions across gpu*.rs files #31104

* chore: reorder and format
2024-03-06 16:48:34 +00:00
Oriol Brufau
06aeeeb1f3
Add CSSOM support for CSS layers (#31481)
Instead of just crashing.
2024-03-03 12:47:39 +00:00
Martin Robinson
9c0561536d
script: Do not run layout in a thread (#31346)
* 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>
2024-02-23 08:14:10 +00:00
Samson
8436002383
Support Namespace const in webidl (#30492)
* Add TestNS with const

* Implement namespace const in codegen
2023-10-04 11:29:54 +00:00
Samson
d22d97f8c8
Add GPUSupportedFeatures and update GPUSupportedLimits (#30359)
* GPUSupportedFeatures

* New supported limits

* Update expectations
2023-09-14 13:23:12 +00:00
Samson
e0a6281e73
Impl Setlike and Maplike (#30237)
* MallocSizeOf for Index{Set, Map}

* like as iterable in WebIDL

* Codegen magic for like interfaces

* TestBinding for like

* Test for Setlike and Maplike test bindings

* Some fixes

* Switch to any.js

* nit

* Keep order
2023-09-06 13:08:45 +00:00
Samson
71e0372ac1
Upgrade whole webgpu stack (#29795)
* Allow noidl files in script/dom/webidls

* Upgrade wgpu to 0.16 and refresh whole webgpu implementation

* Update WebGPU test expectations

* misc

* MutNullableDom -> DomRefCell<Option<Dom for GPUTexture

* Direct use of GPUTextureDescriptor

* Remove config from GPUCanvasContext

* misc

* finally blue color

* gpubuffer "handle" error

* GPU object have non-null label

* gpu limits and info

* use buffer_size

* fix warnings

* Cleanup

* device destroy

* fallback adapter

* mach update-webgpu write webgpu commit hash in file

* Mising deps in CI for webgpu tests

* Updated expectations

* Fixups

* early reject

* DomRefCell<Option<Dom -> MutNullableDom for GPUTexture
2023-08-20 23:16:46 +00:00
Emilio Cobos Álvarez
349edff768
It was removed from the spec and it's disabled everywhere.
This also removes the meta viewport support (which was implemented on top), but that also had a single test and is disabled everywhere, so I'm not too concerned, it can be implemented again if / when needed.
2023-06-30 16:28:21 +02:00
Kunal Mohan
7f53339d78 Implement GPUUncapturedErrorEvent 2020-08-11 14:24:58 +05:30
Alan Jeffrey
c4dd171dfb Add XRLayerEvent 2020-08-05 18:07:54 -05:00
Alan Jeffrey
d255dc9f7b Add a dummy implementation of all the XR Layer types 2020-08-04 15:10:01 -05:00
Kunal Mohan
aff22db33f Implement GPURenderBundleEncoder and GPURenderBundle 2020-07-24 12:45:23 +05:30
bors-servo
086556e706
Auto merge of #27026 - CYBAI:dynamic-module, r=jdm
Introduce dynamic module

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25439
- [x] There are tests for these changes
2020-07-19 09:29:50 -04:00
CYBAI
0c7f08f743 Introduce DynamicModuleOwner dom struct 2020-07-18 00:43:32 +09:00
Kunal Mohan
0dc1514d57 Implement Async Error reporting for WebGPU and update wgpu-core 2020-07-16 23:21:09 +05:30
Josh Matthews
84efd56e57 dom: Add WebRTC transceiver stubs. 2020-07-14 12:48:45 -04:00
Fernando Jiménez Moreno
c0fb6c8d23 Implement MediaDevices.enumerateDevices() 2020-07-10 13:18:26 +02:00
Manish Goregaokar
6143173858 Add MediaStreamTrackAudioSourceNode 2020-07-02 13:26:55 -07:00
Manish Goregaokar
bc2267fb77 Add MediaStreamAudioSourceNode 2020-07-02 13:26:55 -07:00
Manish Goregaokar
6a001e7523 Add MediaStreamAudioDestinationNode 2020-07-02 13:26:55 -07:00
bors-servo
4b034ede46
Auto merge of #26752 - ferjm:datachannel, r=Manishearth
WebRTC data channels support

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #26212

This depends on https://github.com/servo/media/pull/350 and contains the basic pieces to make a  simple test like https://ferjm.github.io/samples/src/content/datachannel/basic/ work
2020-06-30 13:53:32 -04:00
Fernando Jiménez Moreno
f5c930087e Implement ondatachannel event 2020-06-29 16:53:48 +02:00
Fernando Jiménez Moreno
84598a5173 Introduce RTCError and RTCErrorEvent 2020-06-29 16:53:47 +02:00
Fernando Jiménez Moreno
4e6d3e7cec WebRTCDataChannel initial support 2020-06-29 16:53:47 +02:00