This is part of the future work of implementing LazyDOMString as
outlined in issue #39479.
We use str() method or direct implementations on DOMString for these
methods. We also change some types.
This is independent of https://github.com/servo/servo/pull/39480
Signed-off-by: Narfinger Narfinger@users.noreply.github.com
Testing: This is essentially just renaming a method and a type and
should not change functionality.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
From IndexedDB spec, when we check whether a key path is valid, we have
to check whether it is an ECMAScript identifier name. We have not yet
implemented this logic, and always return true.
This patch uses the function `js::rust::wrappers::JS_IsIdentifier` to
achieve this checking.
Testing: Pass WPT tests that were expected to fail.
Fixes: #25324
---------
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
`convert_value_to_key` returns a `ConversionResult` now, so keys can be
considered "Invalid" rather than throwing an exception.
Testing: WPT
Unblocks: #38288
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
The current implementation of evaluate_key_path_on_value was translated
from gecko, and it is incomplete. The unimplemented part occurs many
crashes in WPT tests.
This PR re-implements it according to the spec. It should eliminate many
crashed WPT tests, and increase the code readability.
Testing: Update WPT test expectation
Fixes: #38817 partially, and #25325
---------
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
Uses clipped time to convert dates that are stored as `f64`s into JS
values.
Testing: WPT
Fixes: #25327
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
- Use sqlite instead of heed. (one indexed database = one sqlite
database)
- Implement the backend for indexes
- Use keyranges where needed (as specified by the spec)
- Implement `getKey`
- Fix channel error messaging (led to a bunch of changes to how async
requests are handled)
Note: `components/net/indexeddb/engines/sqlite/serialize.rs` is unused;
I can delete it if needed.
Testing: Switching to sqlite eliminated many panics (exposing some new
failures).
Fixes: #38040
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This PR removes `jsstring_to_str`, which is replaced with
`jsstr_to_string`, and updates `mozjs` to
6f3dcb99a7.
Given that servo now always replaces unpaired surrogate since
https://github.com/servo/servo/pull/35381, the internal conversion
function `jsstring_to_str` is functionally the same as `jsstr_to_string`
from `mozjs`. This PR removes `jsstring_to_str` and replaces with
`jsstr_to_string` with conversions to `DOMString` where necessary.
Testing: Passes all unit test. No regression was found in WPT test (see
try run: https://github.com/minghuaw/servo/actions/runs/16821156583)
---------
Signed-off-by: minghuaw <wuminghua7@huawei.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
- Dates are now serialized as f64s (like how firefox does it)
- Array buffers are serialized with structured cloning (this is not the
most correct/efficent way to serialize them, however it is currently
better than not supporting array buffers at all)
- Array types are still unimplemented.
Testing: WPT
Fixes: Some panicking
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
A lot of shared functions were scattered around the dom files; I moved
them into `indexed_db.rs` for clarity.
Fixes: Nothing to my knowledge, just a cleanup
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>