Commit graph

45810 commits

Author SHA1 Message Date
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
Martin Robinson
c56a814806 Add a compositor-side scroll tree
This will allow the compositor to properly chain scrolling requests up
when a node has reached the extent of the scroll area. This fixes
scrolling on servo.org.
2023-05-19 09:05:48 +02:00
Alex Touchet
651bfb9bde De-dupe httpdate and tokio-util 2023-05-18 23:37:52 -07:00
michaelgrigoryan25
93819dc542 Patch: Applied code patches for clippy warnings 2023-05-19 08:01:38 +04: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](https://github.com/servo/servo/actions/runs/5010809452/jobs/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](https://github.com/servo/servo/actions/runs/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
Martin Robinson
6e2d1bdc79 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.
2023-05-18 09:08:43 +02:00
bors-servo
c7f8a6ecb5
Auto merge of #29747 - mrobinson:workspace-dependencies, r=mukilan
Start the transition to workspace dependencies

This will ultimately make it simpler to update crate dependencies and reduce duplication when specifying requirements. Generally, this change does not touch dependencies that are only used by a single crate. We could consider moving them to workspace dependencies in the future.

<!-- 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 do not change behavior.

<!-- 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 07:03:30 +02:00
bors-servo
e09f85e17b
Auto merge of #29746 - servo:always-run-layout-2020-in-main-workflow, r=atbrakhi
Run the Layout 2020 tests in main workflow

Also fix report_aggregated_expected_results.py which was reporting an error when there were no failing tests. This is more commonly an issue with Layout 2020 because if runs fewer tests and was causing builds to show up as failing even when they were not.

---
<!-- 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 change the build infrastructure.

<!-- 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-17 14:45:28 +02:00
Martin Robinson
2f4c47bfe7 Start the transition to workspace dependencies
This will ultimately make it simpler to update crate dependencies and
reduce duplicate when specifying requirements. Generally, this change
does not touch dependencies that are only used by a single crate. We
could consider moving them to workspace dependencies in the future.
2023-05-17 11:59:35 +02:00
Martin Robinson
8522647555 Run the Layout 2020 tests in main workflow
Also fix report_aggregated_expected_results.py which was reporting an
error when there were no failing tests. This is more commonly an issue
with Layout 2020 because if runs fewer tests and was causing builds to
show up as failing even when they were not.
2023-05-17 11:25:03 +02:00
bors-servo
68879b883d
Auto merge of #29740 - mrobinson:refactor-2020-layout-for-scroll-tree, r=mukilan
Refactor Layout 2020 layout for a compositor-side scroll tree

This change refactors how layout is done in Layout 2020 in preparation for a compositor-side scroll tree:

1. Now the SpatialId and ClipId of each fragment is stored separately. This will allow storing a scroll node id instead of only the handle to the WebRender spatial node.
2. Separate out stacking context tree construction and display list building. This change will make it possible to eventually build the stacking context tree without the full display list if we find that necessary. For instance, this might be useful to cache containing block boundaries.
3. Add a `DisplayList` struct that stores both the WebRender display list builder and the compositor info. This exposes the API to the layout thread for display list building.

In addition, this change adds a lot of missing documentation.  This should not change behavior.

<!-- 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 do not change behavior.

<!-- 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-17 10:59:18 +02:00
Martin Robinson
b60e105526 Refactor Layout 2020 layout for a compositor-side scroll tree
This change refactors how layout is done in Layout 2020 in preparation
for a compositor-side scroll tree:

1. Now the SpatialId and ClipId of each fragment is stored separately.
   This will allow storing a scroll node id instead of only the handle
   to the WebRender spatial node.
2. Separate out stacking context tree construction and display list
   building. This change will make it possible to eventually build the
   stacking context tree without the full display list if we find that
   necessary. For instance, this might be useful to cache containing
   block boundaries.
3. Add a `DisplayList` struct that stores both the WebRender display
   list builder and the compositor info. This exposes the API to the
   layout thread for display list building.

In addition, this change adds a lot of missing documentation.  This
should not change behavior.
2023-05-17 10:46:27 +02:00
Oriol Brufau
773ddf31fe style: Support the type() function in image-set
Differential Revision: https://phabricator.services.mozilla.com/D109201
2023-05-17 02:12:40 +02:00
Oriol Brufau
7567ddd262 style: Hide -moz-outline-radius behind a pref
This property does nothing since bug 315209 got implemented.

Every single user that I checked was doing the same math by hand, so
hooray for good defaults :-)

Differential Revision: https://phabricator.services.mozilla.com/D112253
2023-05-17 02:12:40 +02:00
Oriol Brufau
90a2687545 style: Add a CSS error to the console when using non-featureless :host selectors
(which would never match by definition).

Differential Revision: https://phabricator.services.mozilla.com/D111610
2023-05-17 02:12:40 +02:00
Oriol Brufau
7425f2d922 style: Enable forced-colors in UA and chrome always
Differential Revision: https://phabricator.services.mozilla.com/D112069
2023-05-17 02:12:40 +02:00
Oriol Brufau
b5dcb5c961 Further changes required by Servo 2023-05-17 02:12:21 +02:00
Oriol Brufau
e23a8bf0ad style: Add attribute names to the bloom filter
Safari does this. This reduces the runtime in the example linked from
comment 0 quite a lot (40ms on a local opt build, from ~130ms on a
release nightly build).

I added a pref because there's a slight chance of performance
regressions on pages that do not use attribute selectors, as we're now
doing more unconditional work per element (adding the attributes to the
bloom filter). But the trade-off should be worth it, I think.

Differential Revision: https://phabricator.services.mozilla.com/D111689
2023-05-16 23:40:23 +02:00
Oriol Brufau
a7ca8022d3 style: [css-pseudo] Use 'white-space: pre' by default in ::marker
Differential Revision: https://phabricator.services.mozilla.com/D107359
2023-05-16 23:40:23 +02:00
Oriol Brufau
d8993eef7e Further changes required by Servo 2023-05-16 23:40:17 +02:00
Oriol Brufau
743f213c25 style: Move moz-control-character-visibility out of mako, and remove support for gecko_pref_controlled_initial_value
No behavior change, just cleanup. Actually seem this technically _adds_ some code even
though it's a cleanup, but that's mostly because of the wrapping of the
derive list.  The resulting code is simpler (more in-line with our usual
things, so I think it's an improvement).

Differential Revision: https://phabricator.services.mozilla.com/D111551
2023-05-16 23:17:16 +02:00
Oriol Brufau
fac547276f style: Remove various image-orientation related prefs
These shipped in 77.

Differential Revision: https://phabricator.services.mozilla.com/D111550
2023-05-16 23:16:24 +02:00
Oriol Brufau
693c2f0d27 style: Remove -moz-proton-infobars media query support
Differential Revision: https://phabricator.services.mozilla.com/D110963
2023-05-16 23:15:26 +02:00
Oriol Brufau
b40f4b6fec style: Clean up text-justify, and make distribute a parse-time alias
Since it's simpler, as discussed in the CSSWG issue.

Differential Revision: https://phabricator.services.mozilla.com/D111346
2023-05-16 23:14:19 +02:00
Oriol Brufau
bbc03a2577 style: Enable Proton Urlbar
Differential Revision: https://phabricator.services.mozilla.com/D110998
2023-05-16 23:13:14 +02:00
Oriol Brufau
7bb15f19f1 style: Remove dead prefers-color-scheme: no preference code
It was removed in bug 1643656.

Differential Revision: https://phabricator.services.mozilla.com/D111461
2023-05-16 23:12:19 +02:00
Oriol Brufau
3da3d76a08 style: Clean up NPAPI plugin fallback behavior
Similifies use of EventStates and ObjectType/FallbackType enums since most states they represented are no longer valid with the removal of NPAPI plugins.  The state machine for (unsupported) plugin elements is now much simpler but still distinguishes between HTML fallbacks, fallbacks leading to a "BROKEN" state (e.g. failing to load the image the element refers to), and fallbacks that would simply lead the element to occupy an empty region.  The last type of fallback is behind a pref "layout.use-plugin-fallback" and is disabled by default.

Simplifying the state machine allows us to clean up nsObjectLoadingContent.  We also update many of the enums which refered to plugins, which would otherwise get confusing.

Differential Revision: https://phabricator.services.mozilla.com/D107158
2023-05-16 23:03:45 +02:00
Oriol Brufau
f44a6909df style: Reduce boilerplate needed to add system-metric media features
There's no reason we can't just query LookAndFeel and we need to use
sSystemMetrics. In the past, LookAndFeel queries were not cached, but
this is no longer the case, so perf wise should be pretty equivalent.

Note that we don't need the NS_SUCCEEDED checks because the default
value from GetInt if the platform doesn't support it is 0 anyways.

Differential Revision: https://phabricator.services.mozilla.com/D110805
2023-05-16 23:02:50 +02:00
Oriol Brufau
3d9eabcccb style: Convert proton pref checks from @supports rules to media features
This means that dynamic changes will be handled correctly, we can use
StaticPrefs, etc.

Differential Revision: https://phabricator.services.mozilla.com/D110816
2023-05-16 23:01:29 +02:00
Oriol Brufau
7c26fb82b1 style: add an appearance type that forces a dropshadow on menus on Windows, and uses SetWindowRgn to clip the popup to the border radius
Differential Revision: https://phabricator.services.mozilla.com/D109833
2023-05-16 23:00:33 +02:00
Oriol Brufau
8a16ba74ec Further changes required by Servo 2023-05-16 22:58:48 +02:00