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