Commit graph

10187 commits

Author SHA1 Message Date
bors-servo
11559eb8f8
Auto merge of #29465 - 2shiori17:issue-29388, r=jdm
Implement Headers.prototype.getSetCookie

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29388

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-03-28 04:10:37 +02:00
2shiori17
b6e4e44ccf Fix return value of concept-header-list-get to Option<Vec<u8>> 2023-03-26 19:57:39 +09:00
2shiori17
e4a4f60c53 Fix concept-headers-append 2023-03-26 00:54:04 +09:00
Delan Azabani
557ce73f5f add spec issue as todo in [[OwnPropertyKeys]] trap 2023-03-23 19:15:20 +08:00
Delan Azabani
c831a136b2 clarify and test interactions with indexed access 2023-03-23 18:07:50 +08:00
Delan Azabani
fb2acb0b02 clarify todos about exposed objects 2023-03-23 18:07:46 +08:00
Delan Azabani
b1f78d8a3d fix attrs in descriptor for @@toStringTag property 2023-03-23 18:07:44 +08:00
Delan Azabani
dd905d8434 clean up spurious changes and todos with no action needed 2023-03-23 18:07:39 +08:00
Delan Azabani
65da7b668b clean up lints and tidy errors 2023-03-23 18:07:36 +08:00
Delan Azabani
9a8a5bdbf7 make ownPropertyKeys trap return @@toStringTag key
This fixes the failures in the “[[OwnPropertyKeys]]” subtest.
2023-03-23 18:07:11 +08:00
Delan Azabani
bbaacb7b2d make getOwnPropertyDescriptor trap accept @@toStringTag key
This fixes the failures in the “[[Get]]” and “[[Delete]]” subtests.
2023-03-23 18:07:08 +08:00
Delan Azabani
33387eb75a make getOwnPropertyDescriptor trap accept integer indices
Several /webidl/ecmascript-binding/window-named-properties-object.html
subtests, including the “[[GetOwnProperty]]” and “[[HasProperty]]”
subtests, expect iframe.contentWindow.Window.prototype[0] to return an
element with id “0”.

This commit makes the getOwnPropertyDescriptor trap accept property
keys that are integer indices, by converting them to a DOMString just
like we would for a property key that is a JSString.
2023-03-23 18:07:05 +08:00
Delan Azabani
9a3d6969c9 migrate use of deprecated RUST_JS_{IS,TO}_STRING 2023-03-23 18:07:02 +08:00
Delan Azabani
8814e4bb4f fix failures in [[DefineOwnProperty]] subtest
Calling throw_type_error in the [[DefineOwnProperty]] trap (and
returning false) makes the internal method throw a TypeError, which
means both Object#defineProperty and Reflect#defineProperty will throw
a TypeError, but we actually want the latter to return false.

This commit makes the trap set ObjectOpResult to a TypeError (and
return true), making the internal method return false per the spec [1]
and in turn allowing Reflect#defineProperty to return false.

[1] https://webidl.spec.whatwg.org/#named-properties-object-defineownproperty
2023-03-23 18:06:58 +08:00
Delan Azabani
1f74d4c75b revert: Introduce Untransplantable trait to indicate transplantability at the type level
(8f7b0cff87f0eab921e13e6990d76e12935e8675)
2023-03-23 18:06:17 +08:00
Delan Azabani
4c7f198ee2 apply yvt/servo/fix-named-window-getter 2023-03-23 18:02:35 +08:00
Delan Azabani
fd1de05592 apply pylbrecht/servo/named.window.getter (closes #27952) 2023-03-23 18:01:26 +08:00
bors-servo
d5b910ee86
Auto merge of #29384 - sagudev:idl, r=jdm
Update WebIDL.py

Update WebIDL.py to latest version from mozilla-central.
There were two major changes:
- [Rename legacy extended attributes in webidls](55dac83d9a) [bug 1631581](https://bugzilla.mozilla.org/show_bug.cgi?id=1631581)
- [removal of ReadableStream from WebIDL](https://phabricator.services.mozilla.com/D143074), which was solved with porting reverted removal patch (2801cc82b0)

WebIDL.Parser now has `use_builtin_readable_streams` field by default set to `true` (to use SM readable stream implementation), which could help with #29088.

My try build: 4216638911

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-03-22 02:23:01 +01:00
2shiori17
80a140e82f Add comments for concept-headers-append 2023-03-21 17:15:57 +09:00
2shiori17
74ecc2bd64 Remove net from dependencies 2023-03-20 22:12:50 +09:00
2shiori17
68472fabf8 Fix dom-headers-get 2023-03-11 20:15:14 +09:00
2shiori17
7d1d387f3d Fix header ordering 2023-03-11 20:05:32 +09:00
2shiori17
b5b6225850 Fix concept-headers-append 2023-03-11 17:32:38 +09:00
2shiori17
ee1f241231 Implement concept-header-list-sort-and-combine 2023-03-06 23:34:04 +09:00
2shiori17
4ee3f575f6 Implement Headers.prototype.getSetCookie 2023-03-05 11:35:46 +09:00
bors-servo
37f26f5250
Auto merge of #29451 - servo:fix-blob-slice-text, r=Loirooriol
script: fix BorrowError in (new Blob).slice(0,0).text()

When getting the text of a sliced Blob, we call GlobalScope.get_blob_url_id, which borrows the blob_state field mutably and calls the get_blob_size method (aka [Blob#size](https://w3c.github.io/FileAPI/#dfn-size)), which tries to borrow the same field immutably, causing a panic.

This patch inlines the relevant parts of get_blob_size into get_blob_url_id, so we can reuse the mutable borrow.

* /FileAPI/Blob-methods-from-detached-frame.html was 4/4 FAIL, will be 4/4 PASS once #29396 also lands
* /fetch/api/basic/scheme-blob.sub.any.html was CRASH, now 10/17 PASS and 7/17 FAIL
* /fetch/api/basic/scheme-blob.sub.any.worker.html was CRASH, now 10/17 PASS and 7/17 FAIL

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29450

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
2023-03-02 17:04:58 +01:00
2shiori17
247a4778ee Make HTMLInputElement.list an HTMLDataListElement
Signed-off-by: 2shiori17 <98276492+2shiori17@users.noreply.github.com>
2023-03-02 19:22:28 +09:00
2shiori17
b6d3ff97de Implement URLSearchParams's size
Signed-off-by: 2shiori17 <98276492+2shiori17@users.noreply.github.com>
2023-03-02 12:21:08 +09:00
Delan Azabani
55203d7918 script: fix BorrowError in (new Blob).slice(0,0).text() 2023-03-01 20:16:39 +08:00
Fabrice Desré
fec4c589b2 Switch to the sha2 crate for SRI digests.
This removes one (simple) use of OpenSSL
2023-02-24 18:38:06 -08:00
sagudev
ee7c393773 Fix Codegen 2023-02-20 06:16:13 +01:00
sagudev
42d8269ac9 ReadableStream WebIDL.py patch 2023-02-20 06:15:54 +01:00
sagudev
55dac83d9a Rename legacy extended attributes in webidls
https://github.com/whatwg/webidl/pull/870
2023-02-19 14:05:45 +01:00
sagudev
2acdeabaf5 Update ply 2023-02-19 13:38:01 +01:00
sagudev
4d393612b4 Update WebIDL 2023-02-19 13:36:13 +01:00
sagudev
6f563830d1 Fix WebIDL.py patches 2023-02-19 13:35:58 +01:00
bors-servo
a01035e6fd
Auto merge of #29361 - federicomenaquintero:selectors-shmem-feature, r=delan
Add a "shmem" feature to selectors to avoid publishing that dependency

<!-- Please describe your changes on the following line: -->

Hopefully as a way to help #29105, this PR adds a `shmem` feature to the selectors crate.  This is so that the crate can be released with that feature off by default, as the `ToShmem` derives are only of interest to Servo, I think.

All the places where servo's source code includes the selectors crate are made to turn on this feature.
2023-02-15 10:26:18 +01:00
bors-servo
02de93dc38
Auto merge of #29354 - ben-freist:dom-drop-impl-worklet, r=delan
#26488 Move worklet drop implementation into single droppable member

Signed-off-by: Benjamin Freist <bfreist@soundhound.com>

<!-- Please describe your changes on the following line: -->
Hey @jdm ,
is this issue still free? I would like to start contributing to servo.
This patch is straight from PR 28302, I thought it would be good to start with a small part, I hope that's ok.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they will be checked by the compiler.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-02-14 23:43:47 +01:00
Federico Mena Quintero
8a0810ee74 */Cargo.toml: use the shmem feature for the dependency on the selectors cratre 2023-02-14 13:05:59 -06:00
Benjamin Freist
10ef6cdb38 26488 Move worklet drop implementation into single droppable member
Signed-off-by: Benjamin Freist <bfreist@soundhound.com>
2023-02-13 20:23:34 +01:00
yvt
effd5a3107 fix(script): request animation ticks if Animations::pending_events is not empty
Fixes the test case `/_mozilla/css/css-transition-cancel-event
.html`, which was failing under a specific circumstance.

The observed sequence of events during the failing test run looks like
this:

1. Transitions start in `div1` and `div2`.

2. `div1` generates a `transitionend` event.

3. The `transitionend` event handler removes `div2` from DOM, cancelling
   its ongoing transition.

4. `div2` is supposed to generate a `transitioncancel` event in a timely
   manner, which it does not. The test fails as a result.

What is going on here? Here's a possible explaination:

1. During one invocation of `ScriptThread::handle_msgs`...

2. In step 2, `ScriptThread::update_animations_send_events` -> `Document
   ::update_for_new_timeline_value` detects the completion of the
   transition, and in response, pends the `transitionend` event.

3. In step 3, `ScriptThread::update_animations_send_events` ->
   `Animations::send_pending_events` calls the `transitionend` handler.

4. The `transitionend` event handler removes `div2`, thereby cancelling
   its ongoing transition and triggering a reflow.

5. Reflow takes place. During this, `Animations::do_post_reflow_update`
   -> `Animations::handle_canceled_animations` pends the
   `transitioncancel` event (precursor to step 4).

6. Having discovering that there was no running animation, `Animations::
   do_post_reflow_update` calls `self.update_running_animation_presence
   (_, false)`, which sends `AnimationState::NoAnimationsPresent`.

7. The invocation of `ScriptThread::handle_msgs` ends, and another
   starts. It blocks waiting for events.

8. Meanwhile, the compositor receives `AnimationState::
   NoAnimationsPresent` and stops further generation of animation ticks.

9. With no events to wake it up, the script thread is stuck waiting
   despite having the pending `transitioncancel` event (step 4).

The HTML specification [says][1] that "an event loop must continually
run [...] as long as it exists" and does not say it can block if there
is nothing to do. Blocking is merely optimization in a user agent
implementation. Pending animation-related events must be processed every
time a "rendering opportunity" arises unless the user agent has a reason
to believe that it "would have no visible effect".

Skipping the processing of animation-related events would have visible
effect if such events are indeed present. The correct implementation in
Servo, therefore, would be to request more animation ticks so that such
events are processed in a subsequent tick.

[1]: https://html.spec.whatwg.org/multipage/#event-loop-processing-model
2023-02-10 14:44:27 +01:00
yvt
af1b0b0f14 fix(script): update animation timeline before processing pending events
This commit reverses the order of the `send_pending_events` and
`update_animation_timeline` calls in `ScriptThread::update_animations_
send_events` so that animation-related events pended by the latter are
processed by the former.

The new calling order is more compliant with the "update animations and
send events" algorithm steps from [the Web Animations specification][1].

The old implementation was prone to blocking for an indefinite period
while holding pending events. Due to complex interaction with other
events and timing behavior, I was only able to reproduce the problem
under the following conditions:

- *The `maybe_observe_paint_time` call in `LayoutThread::compute_abs_
  pos_and_build_display_list` is removed from the code*. While
  performance events may seem irrelevant to the issue, they would
  bombard the script thread with events. *Any* extra messages received
  would unblock the event loop and prevent the manifestation of the
  issue. (But, of course, we aren't supposed to count on that to avoid
  the issue.)

- Servo is running in a headless mode, which somehow makes it less
  likely for the script thread to receive a `TickAllAnimations` event
  after sending `AnimationState::NoAnimationsPresent`.

With the above conditions met and the stars aligned, you can reproduce
the problem by running the WPT test `/css/css-transitions/events-001.
html`.

[1]: https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events
2023-02-10 12:42:51 +01:00
Martin Robinson
423cc34cb0 Bump euclid to 0.22
- Also updates raqote to latest with an upgrade of font-kit to 0.11
  applied on as a patch
- Update lyon_geom to the latest version

Major change:

- All matrices are now stored in row major order. This means that
  parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
  so `then()` is used and the order of operations changed.
2023-01-26 08:59:21 +01:00
bors-servo
f70857906d
Auto merge of #29250 - fabricedesre:no-deprecated-symbol-to-jsid, r=delan
Replace use of the deprecated RUST_SYMBOL_TO_JSID by SymbolId

<!-- Please describe your changes on the following line: -->

A simple replacement of a deprecated function, according to changes in https://github.com/servo/mozjs/pull/315

That removes the only build warning I saw when doing a clobber.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ X] `./mach build -d` does not report any errors
- [X ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ X] These changes do not require tests because no behavior change is expected.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-01-18 18:05:12 +01:00
bors-servo
a8db596d1e
Auto merge of #29236 - servo:application-json, r=jdm
Allow displaying content with "application/json" mime type

For me this allows the WPT test
performance-timeline/tentative/include-frames-one-remote-child.sub.html
to match expected results. The wptserver is sending a 404 JSON response
because the URL that the test requests is not found.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29136.
- [x] There are tests for these changes.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-01-17 19:13:38 +01:00
The Capyloon Team
a9c0479a48 Replace use of the deprecated RUST_SYMBOL_TO_JSID by SymbolId 2023-01-16 19:14:01 +00:00
Martin Robinson
0d7284dc34 Allow displaying content with "application/json" mime type
For me this allows the WPT test
performance-timeline/tentative/include-frames-one-remote-child.sub.html
to match expected results. The wptserver is sending a 404 JSON response
because the URL that the test requests is not found.
2023-01-16 10:21:41 +01:00
Martin Robinson
e68ebd2617 Stringify unknown JavaScript objects in global exception handlers
When turning DOM exceptions into `ErrorInfo` always try to stringify
the JavaScript value, even if it's an object that isn't a `DOMException`
or native exception.  This means that exceptions that extend the `Error`
prototype are now stringified. The result is that test output for WPT
global assertion failures is more useful. For instance for the test
include-frames-from-child-same-origin-grandchild.sub.html:

Before:
```
uncaught exception: unknown (can't convert to string)
```

After:
```
uncaught exception: Error: assert_equals: expected 4 but got 3
```
2023-01-12 19:57:51 +01:00
bors-servo
1a60636274
Auto merge of #29229 - servo:intermittent-video-poster, r=jdm
Fix intermittency when loading poster images

Wait until a poster image is cached to in order to unblock document load. If not, the document may continue loading before the image is ready to use, leading to intermittency in test output. Now load is unblocked when getting the ImageResponse from the cache, which allows the code to properly unblock the load when the entire load fails or succeeds.

This reveals several false passes in the `object-view-box` test suite which were very flaky.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29204.
- [x] These changes fix #29188.
- [x] These changes fix #29179.

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-01-12 02:04:09 +01:00
Martin Robinson
c021df027a Fix some build warnings
- Mark some instances of unused fields and variables as as allowed,
  when they are used for memory management.
- Remove the use of some deprecated function.s

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2023-01-11 12:50:36 +01:00