Commit graph

45636 commits

Author SHA1 Message Date
Mukilan Thiyagarajan
84d13eacbd Count post-cargo build steps in elapsed time 2023-05-21 16:13:36 +05:30
Mukilan Thiyagarajan
6abee33f91 Print message when packaging macos dylibs 2023-05-21 16:13:36 +05:30
Mukilan Thiyagarajan
df71aa2f1e Avoid relinking plugin dylibs
The `copy_dependencies` logic is invoking
`change_non_system_libraries_path` with absolute paths
to gstreamer *plugin dylibs*.

`change_non_system_libraries_path` skips editing links
in servo binary to relocatable dylibs, but the since the
plugins have absolute paths, they are treated as
'non-relocable' and it will try to edit the *non-existent*
(since plugins are loaded dynamically) link in servo bin.

These unnecessary calls to change_link_name is cause
of the slowness identified in #29764

This PR fixes the issue by ensuring plugins are not
included in the call to change_non_system_libraries_path

Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
2023-05-21 16:13:36 +05:30
bors-servo
1bb713521b
Auto merge of #29374 - jdm:get-cx-cleanup, r=mrobinson
Assert if DomObject::global is called outside of a JS realm

To avoid crashing in https://github.com/servo/servo/issues/27037, we need to progressively add `InRealm` or `AlreadyInRealm` arguments higher up in the call stack. These changes assert that DomObject::global is only called inside of a realm, which is preferable to segfaulting in the JS engine. Making this a compile-time error requires changing lots of `.global()` callsites, but this PR removes a bunch that are now unnecessary.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix (partially) #27037
- [x] There are tests for these changes
2023-05-21 04:05:58 +02:00
bors-servo
608b1d17a9
Auto merge of #29422 - fabricedesre:update-tungstenite, r=jdm
Update tungstenite

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

Update tungstenite to current version. As a nice side effect this removes a bunch of other old crates.

---
<!-- 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

<!-- 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-05-21 01:57:57 +02:00
Josh Matthews
dcf02caf81 Enter realms when creating special same-origin iframes. 2023-05-20 18:32:08 -04:00
Fabrice Desré
0d0540fc95 Update tungstenite 2023-05-20 21:55:00 +00:00
Josh Matthews
02a280dbe1 Enter realms when processing pre-sequential events. 2023-05-20 17:14:45 -04:00
bors-servo
bc8cea2495
Auto merge of #29759 - atouchet:hhpd, r=jdm
De-dupe httpdate and tokio-util

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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-05-20 21:32:49 +02:00
Josh Matthews
864e072d5c Enter realms more consistently during the script event loop. 2023-05-20 14:30:22 -04:00
Josh Matthews
9ea1399c30 Fix formatting. 2023-05-20 11:05:10 -04:00
Josh Matthews
5e5669b945 Remove unused argument from AlreadyInRealm::assert. 2023-05-20 11:05:09 -04:00
Josh Matthews
fca5833e21 Remove global argument from Promise::new_in_current_realm. 2023-05-20 11:05:09 -04:00
Josh Matthews
f79e1e327d Make GlobalScope.get_cx a static method. 2023-05-20 11:05:09 -04:00
bors-servo
1a648d1e27
Auto merge of #29760 - servo:mrego-contributing-coc, r=jdm
Update link to CoC

None
2023-05-20 16:51:19 +02:00
bors-servo
4998c65c42
Auto merge of #29761 - fabricedesre:no-wedriver-warning, r=mrobinson
Fix compiler warning introduced in 4aa8a1c418

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

Make the compiler happy.

---
<!-- 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 this is just fixing a compiler warning

<!-- 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-05-20 07:45:01 +02:00
The Capyloon Team
da9796f7e3 Fix compiler warning introduced in 4aa8a1c418 2023-05-20 02:03:58 +00:00
bors-servo
2426a38a4d
Auto merge of #29748 - Loirooriol:sync, r=mrobinson
Backport several style changes from Gecko

<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- 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-05-19 22:49:36 +02:00
Oriol Brufau
dbb92b99ad Update test expectations 2023-05-19 21:35:06 +02:00
Manuel Rego Casasnovas
6f750d97e7
Update link to CoC 2023-05-19 19:09:45 +02:00
Oriol Brufau
f42e2fb08f Avoid complaints from ./mach test-tidy 2023-05-19 19:06:09 +02:00
Oriol Brufau
aea14a2470 Further changes required by Servo 2023-05-19 19:06:09 +02:00
Oriol Brufau
1cc44bd065 style: Will-change should only create stacking contexts / containing blocks / etc if the property it'd change would apply
As per https://drafts.csswg.org/css-will-change/#will-change.

> If any non-initial value of a property would cause the element to
> generate a containing block for absolutely positioned elements,
> specifying that property in will-change must cause the element to
> generate a containing block for absolutely positioned elements.

But in this case the transform property wouldn't apply to the element so
there's no reason to create a stacking-context.

Differential Revision: https://phabricator.services.mozilla.com/D114121
2023-05-19 19:06:09 +02:00
Oriol Brufau
60867bbe7e style: Remove unused NS_CHANGE_COLOR_IF_SAME_AS_BG
It was introduced in bug 1024930, but it is unused since.

Differential Revision: https://phabricator.services.mozilla.com/D114389
2023-05-19 19:06:09 +02:00
Oriol Brufau
516c7a304a style: Use saturating addition for math-depth
Differential Revision: https://phabricator.services.mozilla.com/D114070
2023-05-19 19:06:08 +02:00
Oriol Brufau
43cec05c04 style: Don't allow whitespace between media query operator delim tokens
Differential Revision: https://phabricator.services.mozilla.com/D113648
2023-05-19 19:06:08 +02:00
Oriol Brufau
fb9d8ddc73 style: Make sure to consume the flusher when we hit the cascade data cache
So that sheets are properly marked as committed. The issue is that we
have this "committed" optimization, to avoid doing work if somebody adds
and removes an stylesheet without us flushing in the meantime:

  https://searchfox.org/mozilla-central/rev/f018480dfed4fc583703a5770a6db9ab9dc0fb99/servo/components/style/stylesheet_set.rs#308-319

The "committed" bit is set when we consume the flusher (in each(..)).

However when we hit the cache, before this patch, we wouldn't consume
it, which means that we may fail to do some full rebuilds even though we
need them.

Fix it by making sure we call each() in that case.

We add a test (the test would show a red square before this patch, and a
lime square with the fix).

Differential Revision: https://phabricator.services.mozilla.com/D113206
2023-05-19 19:06:08 +02:00
Oriol Brufau
90781493fc style: Make the -moz-toolbar-prefers-color-scheme a tri-state
This will allow detecting the system theme, which allows fixing some of
the blocked bugs.

Note that when using the system theme we will still match light or dark
appropriately, so this shouldn't change behavior just yet.

Differential Revision: https://phabricator.services.mozilla.com/D113516
2023-05-19 19:06:08 +02:00
Oriol Brufau
ab445a02b0 style: Implement accent-color in nsNativeBasicTheme
This is a new addition for CSS UI Level 4:

  https://drafts.csswg.org/css-ui-4/#widget-accent

I want to provide feedback on some spec issues, and thought it was a
kinda neat thing to prototype (it also makes testing contrast and such
with random GTK themes easier).

For now enable for Nightly only.

Differential Revision: https://phabricator.services.mozilla.com/D112312
2023-05-19 19:06:08 +02:00
Oriol Brufau
373d22119f Further changes required by Servo 2023-05-19 19:06:08 +02:00
Oriol Brufau
69fc5ca9fd style: Garbage-collect event state bits
We had about 9 gaps / unused bits. I moved the devtools ones at the end
because I think we should be able to remove them (but separate bug).

Differential Revision: https://phabricator.services.mozilla.com/D113365
2023-05-19 19:06:07 +02:00
Oriol Brufau
54965bbcb9 style: Fix whitespace handling in clamp() parsing
We should just restore the state when seeing whitespace and an unknown
token like when we do when finding any other token a few lines below.

This is not an issue for most callers (it's only an issue for clamp())
because the other callers use either `parse_comma_separated()` (for
min/max), or `parse_nested_block()` (for parens / nested calc()).

Both of those functions restrict the input in such a way that
is_exhausted returns true (a few lines above) and thus we parse
successfully.

Differential Revision: https://phabricator.services.mozilla.com/D112681
2023-05-19 19:06:07 +02:00
Oriol Brufau
d12cb17d73 style: -moz-toolbar-prefers-color-scheme for dark theme detection
This adds a new @media query -moz-toolbar-prefers-color-scheme which works like
prefers-color-scheme but is set based on the browser theme rather than the OS
theme. The background colour of the toolbar is used to determine the theme
dark/light preference. This will be used for in-content common.css pages and
other UI elements that include that stylesheet in the browser-chrome through
shadow DOM.

The end result is that about: pages, infobars, and modals will now "match" the
browser theme (just light/dark mode, not LWT theming support).

Differential Revision: https://phabricator.services.mozilla.com/D111486
2023-05-19 19:06:07 +02:00
Oriol Brufau
29bca57333 Further changes required by Servo 2023-05-19 19:05:24 +02:00
bors-servo
71c5bb02b4
Auto merge of #29754 - mrobinson:organize-python-by-platform, r=mukilan
Start organizing platform-specific Python code

This starts to split platform-specific Python code into its own module, which should help to tidy up our mach commands and make things more reusable. This is step one toward fixing #25335.

<!-- 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 do not require tests because they just change mach scripts.

<!-- 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-05-19 13:09:29 +02:00
Martin Robinson
5be14ecc3c Start organizing platform-specific Python code
This starts to split platform-specific Python code into its own module,
which should help to tidy up our mach commands and make things more
reusable.
2023-05-19 13:08:43 +02:00
Alex Touchet
651bfb9bde De-dupe httpdate and tokio-util 2023-05-18 23:37:52 -07:00
bors-servo
42332e5888
Auto merge of #29751 - mrobinson:smoketest-panic, r=mukilan
Thread panics should be a hard-fail in smoketests

This prevents, for instance, a script thread panic from hanging Servo and means those kind of panics won't cause CI to hang.

Fixes #29749.

<!-- 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 #29749.
- [x] These changes do not require tests because they fix a test issue.

<!-- 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-05-19 03:52:08 +02:00
bors-servo
41007c56c4
Auto merge of #29756 - servo:fix-nightly-linux-build, r=jdm
Use Python 3.9 on linux workflows

It looks like the system python 3.8 has older 'ssl' module which is now causing [recent Linux nightly builds](8981025230) to fail:

```
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

  File "/home/runner/work/servo/servo/python/servo/package_commands.py", line 559, in upload_nightly
    import boto3
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/boto3/__init__.py", line 17, in <module>
    from boto3.session import Session
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/boto3/session.py", line 17, in <module>
    import botocore.session
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/session.py", line 26, in <module>
    import botocore.client
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/client.py", line 15, in <module>
    from botocore import waiter, xform_name
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/waiter.py", line 18, in <module>
    from botocore.docs.docstring import WaiterDocstring
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/docs/__init__.py", line 15, in <module>
    from botocore.docs.service import ServiceDocumenter
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/docs/service.py", line 14, in <module>
    from botocore.docs.client import ClientDocumenter, ClientExceptionsDocumenter
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/docs/client.py", line 17, in <module>
    from botocore.docs.example import ResponseExampleDocumenter
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/docs/example.py", line 13, in <module>
    from botocore.docs.shape import ShapeDocumenter
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/docs/shape.py", line 19, in <module>
    from botocore.utils import is_json_value_header
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/utils.py", line 37, in <module>
    import botocore.httpsession
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/botocore/httpsession.py", line 45, in <module>
    from urllib3.contrib.pyopenssl import (
  File "/home/runner/work/servo/servo/python/_virtualenv3.8/lib/python3.8/site-packages/urllib3/contrib/pyopenssl.py", line 43, in <module>
    import OpenSSL.SSL  # type: ignore[import]
  File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1553, in <module>
    class X509StoreFlags(object):
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1573, in X509StoreFlags
    CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
```

This PR upgrades to python 3.9 from 3.8 (default on 20.04) as upgrading 'ssl' using pip doesn't  work.  ssl on PyPi only works with Python 2 (ssl is now a builtin module since Python 3).

---
<!-- 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 the change was validated with a [manual run](5014885132)

<!-- 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-05-19 00:10:22 +02:00
bors-servo
7443ac9944
Auto merge of #29753 - michaelgrigoryan25:master, r=jdm
Update: Bump webdriver version to 0.48

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

These changes bump the `webdriver` crate from version 0.44 to 0.48. There are compilation issues which will need to be addressed accordingly.

---
<!-- 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 #29742 (GitHub issue number if applicable)

<!-- Either: -->
- [X] These changes may require some additional tests

<!-- 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-05-18 21:52:39 +02:00
michaelgrigoryan25
5bb72970e8 Update servo-tidy.toml 2023-05-18 19:09:43 +04:00
bors-servo
44be28900e
Auto merge of #28587 - yvt:fix-location-target, r=mrobinson
Make `Location` operate on the correct objects

This PR updates the implementation of the "[`Location`-object navigate][1]" algorithm to use the correct browsing context as the source browsing context for navigation. This affects the determination of a referrer and referrer policy and the treatment of `javascript:` URLs.

This PR also fixes the derivation of a `Location` object's [relevant `Document`][2] to match the specified behavior.

[1]: https://html.spec.whatwg.org/multipage/#location-object-navigate
[2]: https://html.spec.whatwg.org/multipage/#relevant-document

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes
2023-05-18 16:33:16 +02:00
Mukilan Thiyagarajan
49aa0b6e06 Use Python 3.9 on linux workflows
It looks like the dist-packages of python 3.8
on the runner has an older version of ssl package
which is now causing nightly builds to fail.
2023-05-18 19:44:37 +05:30
michaelgrigoryan25
ba07eab022 Update servo-tidy.toml 2023-05-18 18:05:16 +04:00
yvt
b0a99c8c67 Make Location operate on the correct objects
This PR updates the implementation of the "Location-object navigate"
algorithm to use the correct browsing context as the source browsing
context for navigation. This affects the determination of a referrer and
referrer policy and the treatment of javascript: URLs.

This PR also fixes the derivation of a Location object's relevant
Document to match the specified behavior.
2023-05-18 15:41:08 +02:00
bors-servo
afcd6c4c5f
Auto merge of #29637 - AnthonyJ3:Use-same-origin-as-default-credential-mode-for-RequestInit-fix, r=mukilan
Use same-origin as default credential mode for RequestInit fix

<!-- Please describe your changes on the following line: -->
- Updated the default credential mode from omit to same-origin as per: https://github.com/whatwg/fetch/pull/1153
- Deleted instances of fallback credentials
---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #29633  (GitHub issue number if applicable)
- [X] There are tests for these changes
2023-05-18 14:16:45 +02:00
michaelgrigoryan25
4aa8a1c418 Update: Bumped webdriver version to 0.48 2023-05-18 13:48:19 +04:00
bors-servo
918557ad6d
Auto merge of #29752 - mrobinson:fix-29741-by-extending-request-builder, r=mukilan
Fix 29741 by extending request builder

Extend RequestBuilder to include ResponseTainting and used said functionality to set response_tainting to `::CorsTainting` in `cors_preflight_fetch()`.

---
<!-- 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 #29741
<!-- 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-05-18 10:45:00 +02:00
Iver Småge men bærbar
ed239931bb use response tainting::cors in cors preflight 2023-05-18 09:33:56 +02:00
Iver Småge men bærbar
5adff93054 add response tainting to request builder 2023-05-18 09:33:56 +02:00