Commit graph

47938 commits

Author SHA1 Message Date
Oriol Brufau
c07484fcb6
Update Stylo to 2023-09-01 (#31609)
* Update Stylo to 2023-09-01

* Fixup for https://phabricator.services.mozilla.com/D184929

* Fixup for https://phabricator.services.mozilla.com/D184526

* Fixup for https://phabricator.services.mozilla.com/D184525

* Fixup for https://phabricator.services.mozilla.com/D185154

* Fixup for https://phabricator.services.mozilla.com/D184685

* Fixup for https://phabricator.services.mozilla.com/D185916

* Fixup for https://phabricator.services.mozilla.com/D185492

* Fixup for https://phabricator.services.mozilla.com/D186626

* Update test expectations
2024-03-18 13:52:40 +00:00
sandeep
94c1f2c992
fonts: Consider Tertiary Ideographic Plane to be CJK (#31670)
* added check for Tertiary Ideographic Plane

* added unit test for is_cjk function

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

* fixed formatting

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

* removed for loop assertions & added TIP chars

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

---------

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
Co-authored-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
2024-03-18 11:45:52 +00:00
Mukilan Thiyagarajan
55bb289b30
android: fix broken rendering in emulators (#31727)
Android's OpenGL emulation layer (goldfish-opengl) has pre-processing
logic that looks for samplers of the type `samplerExternalOES` and
does a simple textual [replacement to change the type][1] to `sampler2D`
before compilation. It also [marks the sampler][2] as 'replaced' so
it can emulate the correct type at runtime.

However, this logic can lead to false positives when the sampler is
declared inside conditional macros. Hence, the sampler's type can be
incorrectly marked as `samplerExternalOES` even though the #if, #ifdef
conditional logic would have declared the type as `sampler2D`.
This seems to be a [known limitation][3].

WebRender (in particular the shared.glsl include) has such conditional
declaration of the texture units used from the shaders.
In particular, the sampler [sColor0 here][4] is declared within ifdefs
to have different types depending on the flags enabled, to allow the
shader to work with different image target kinds.

WebRender also maintain two versions of the compiled shaders in its cache:
  1. An unoptimized version with all the conditional logic preserved
     in the source until the shader is compiled at runtime on Android,
     when the shader is actually used.
  2. Multiple optimized versions for combinations of features required
     These versions are produced during Servo [build][5]. Thus the
     optimized versions eliminate most of the conditional declarations
     at build time.

The bug in Servo with current code is because, [by default][6], WebRender
uses the *unoptimized* versions of the shaders. This means the conditional
GLSL source is evaluated at runtime by the Android emulator and thus ends
up with the incorrect type for the sColor0 sampler unit, which breaks the
[texture sampling in the fragment shader][7], causing it to always return
Vec4(0, 0, 0, 1) and rendering all elements on the page black.

This change forces WebRender to use the *optimized* version as a
workaround - the optimized versions have unconditional code for the
sampler declarations so are not susceptible to the emulator issue.

[1]: https://android.googlesource.com/device/generic/goldfish-opengl/+/refs/tags/android-platform-11.0.0_r40/system/GLESv2_enc/GL2Encoder.cpp#1644
[2]: https://android.googlesource.com/device/generic/goldfish-opengl/+/refs/tags/android-platform-11.0.0_r40/system/GLESv2_enc/GL2Encoder.cpp#1673
[3]: https://android.googlesource.com/device/generic/goldfish-opengl/+/refs/tags/android-platform-11.0.0_r40/system/GLESv2_enc/GL2Encoder.cpp#1571
[4]: b36399019c/webrender/res/shared.glsl (L206)
[5]: b36399019c/webrender/build.rs (L289)
[6]: b36399019c/webrender/src/renderer/init.rs (L214)
[7]: b36399019c/webrender/res/composite.glsl (L189)

Fixes #31726.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-18 10:57:42 +00:00
Rosemary Ajayi
3ac0ab2e4e
clippy: Fix some warnings in the script crate (#31719)
* Fix InlineFormatting error

* BoxFrament

* fix clippy error

* clippy:fix clipy errors

* fix clippy errors

* fix clippy errors

* fix clippy errors

* Remove changes to `layout_2020`

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-18 10:05:18 +00:00
Mukilan Thiyagarajan
4bca55e27a
android: add support for x86_64 images (#31725)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-18 09:44:10 +00:00
Tumuhairwe
b2f2ae61db
Updated inconsistent context for crates (#31718) 2024-03-18 08:38:42 +00:00
RustAndMetal
f6a975fc58
clippy: Fix several warnings (#31710)
Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
2024-03-18 08:33:43 +00:00
Rhea-Eve
1ab8fa2895
rustdoc: Fix two warnings in components/layout_2020 (#31712)
* Fix BoxFragment reference.

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

* Fix reference to InlineFormattingContext.

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

* Rewrap lines to avoid long length

* Remove trailing whitesapce

---------

Signed-off-by: Rhea Karty <rheakarty@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-18 08:33:15 +00:00
eri
99ddab43e8
clippy: Fix warnings in generated code (#31721)
* clippy: remove extra static lifetimes in generated code

* clippy: fix return and cast in generated code

* clippy: fix more warnings in codegen

* clippy: fix all errors from generated files
2024-03-17 21:32:47 +00:00
Oriol Brufau
1a46529560
build(deps): bump Stylo from 7dd8840 to 2c775e4 (#31709) 2024-03-17 20:13:05 +00:00
Servo WPT Sync
52c2b1e3a8
Sync WPT with upstream (17-03-2024) (#31715)
* Update raw lags path for WPT import

I forgot to do this in #31616

* Update web-platform-tests to revision b'298d1599dbf6255aea63506daaa1702ff0c4fdc5'

---------

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-03-17 10:51:07 +00:00
Smitty
d2dcb20bea
Implement console.count/countReset (#31635)
* Implement console.count/countReset

* Address review comment

Signed-off-by: syvb <me@iter.ca>

---------

Signed-off-by: syvb <me@iter.ca>
2024-03-17 09:50:40 +00:00
Samson
f98975bbbe
Update raw lags path for WPT import (#31714)
I forgot to do this in #31616
2024-03-17 09:48:12 +00:00
Tumuhairwe
8cfc6a1898
Updated comment with 'layout_traits' to 'script_layout_interface' (#31707)
* Updated comment with 'layout_traits' to 'script_layout_interface'

* Rewrap text

* Remove trailing whitespace

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-15 22:15:14 +00:00
Oriol Brufau
82128d3838
Don't null out the baselines of anonymous tables (#31704) 2024-03-15 20:46:41 +00:00
Richard Dushime
d211cfc978
documentation: Add instructions for creating a shallow clone of the Servo repository (#31697)
* Add support for partial and shallow clones for contributors with limited internet access

* Fix requested changes

* small typo

* Removed Trailing spaces and Fixed req changes

* Small fixes to the new documentation

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-15 19:06:02 +00:00
dependabot[bot]
30db7a9a5f
build(deps): bump tokio-test from 0.4.3 to 0.4.4 (#31703)
Bumps [tokio-test](https://github.com/tokio-rs/tokio) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-test-0.4.3...tokio-test-0.4.4)

---
updated-dependencies:
- dependency-name: tokio-test
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 17:28:20 +00:00
Richard Dushime
8a6481c341
clippy: Fix warnings in components/script (#31700)
* Fix warnings: immediate dereferencing of references and unneeded  statement

* Fix warnings in Components/script
2024-03-15 17:27:50 +00:00
Martin Robinson
47a4ce467f
layout: Add basic support for getClientRects() queries (#31696)
This adds basic support for `getClientRects()` by sharing code with the
implementation of `getBoundingClientRect()`. In addition to sharing
code, it also shares all of the bugs. Primarily, scrolilng positions are
not taken into account when return boundary rectangles.
2024-03-15 17:20:47 +00:00
dependabot[bot]
3f3820b3dc
build(deps): bump tokio-stream from 0.1.14 to 0.1.15 (#31702)
Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.14 to 0.1.15.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.14...tokio-stream-0.1.15)

---
updated-dependencies:
- dependency-name: tokio-stream
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 17:12:15 +00:00
dependabot[bot]
94b68ccb0c
build(deps): bump h2 from 0.3.24 to 0.3.25 (#31701)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.25.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.25/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.24...v0.3.25)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 17:12:05 +00:00
Tumuhairwe
4cd3c056e5
rustdoc: Fix errors in components and ports (#31654)
* Fixed warnings in components/gfx/text/shaping/harfbuzz-rs  components/layout_2020/fragment_tree  ports/servoshell/minibrowser.rs

* Fixed warnings in components/gfx/text/shaping/harfbuzz-rs  components/layout_2020/fragment_tree  ports/servoshell/minibrowser.rs.

* Update minibrowser.rs

Returned "if" back to "iff"

* Update minibrowser.rs

Changed ```BrowserManager``` to ```WebViewManager```

* Update fragment.rs

Changed ```[SequentialLayoutState]``` to ```[crate::flow::float::SequentialLayoutState]```

* Update fragment.rs

Balanced the length of paragraph lines in fragment.rs

* Fix tidy errors

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-15 16:24:11 +00:00
Oriol Brufau
39f660f520
Allow pre-wrap whitespace to hang at the end of the line (#31681)
* Allow pre-wrap whitespace to hang at the end of the line

* Use bitflags
2024-03-15 16:12:41 +00:00
Manuel Rego Casasnovas
ac24cd6139
Update new issue URL in SECURITY.md (#31698)
* Update new issue URL in SECURITY.md

Update URL for new issue so it uses the security template: https://github.com/servo/servo/issues/new?template=security-report.md

* Link to https://github.com/servo/servo/security/advisories/new instead
2024-03-15 15:03:49 +00:00
Oriol Brufau
99c14c83ed
Obey white-space when intrinsically sizing an IFC (#31660)
The old logic was assuming that all whitespace was a break opportunity,
and that no newlines would be preserved.

Note that text shaping considers the advance of a newline to be the same
as a space. This was problematic because if we have a segment with a
preserved space and newline, only the advance of the space should
contrinute to the size of the block container. Therefore, I'm changing
the breaker logic in other to have newline characters in their own
segment.

Then glyph_run_is_whitespace_ending_with_preserved_newline can just be
renamed to glyph_run_is_preserved_newline.

This patch is still not perfect because it doesn't check allow_wrap(),
so `nowrap` is treated like `normal`, and `pre-wrap` like `pre`.
2024-03-15 12:45:23 +00:00
Manuel Rego Casasnovas
74b5f798cd
Add issue templates (#31693)
* Add issue templates

This will allow to label new issues when filled depending on their type.

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/feature_request.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/feature_request.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/feature_request.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/security-report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/security-report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/security-report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Fix typo

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-15 12:18:47 +00:00
Martin Robinson
a8791ddcbc
clippy: Fix remaining warnings in gfx for MacOS (#31669) 2024-03-15 12:14:36 +00:00
eri
cb3ae70340
Add RUSTC env to clippy command (#31694)
* python: add RUSTC env to clippy command

* fix: pass env explicitly
2024-03-15 11:32:43 +00:00
Samson
3fdbde94cf
Escaped reporting (#31691) 2024-03-15 10:58:42 +00:00
Munish Mummadi
55250dd8a6
Fix typo: changed seperator to separator (#31685) 2024-03-15 09:42:32 +00:00
Delan Azabani
884d024957
Add gstreamer plugins good/ugly for better codec support (#31687)
* NixOS: add gst-plugins-{good,ugly} for better codec support

* Add gstreamer plugins good/ugly to all other package lists
2024-03-15 09:05:26 +00:00
Richard Dushime
68b82e6d61
fonts: Add Noto Sans CJK fonts to the Linux fallback list (#31668)
* Add Noto Sans CJK fonts to the fallback list

* Fix test-tidy errors
2024-03-15 05:03:22 +00:00
Oriol Brufau
bc4f1c217d
Implement HTMLStyleElement.disabled attribute (#31682)
https://html.spec.whatwg.org/multipage/#dom-style-disabled
2024-03-14 23:48:29 +00:00
Martin Robinson
ad37a54f59
dependencies: Upgrade to WebRender 0.64 (#31486)
This brings the version of WebRender used in Servo up-to-date with Gecko
upstream. The big change here is that HiDPI is no longer handled via
WebRender. Instead this happens via a scale applied to the root layer in
the compositor. In addition to this change, various changes are made to
Servo to adapt to the new WebRender API.

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-14 17:40:54 +00:00
dependabot[bot]
4597aeae5f
build(deps): bump smallbitvec from 2.5.1 to 2.5.2 (#31674)
Bumps [smallbitvec](https://github.com/servo/smallbitvec) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/servo/smallbitvec/releases)
- [Commits](https://github.com/servo/smallbitvec/compare/v2.5.1...v2.5.2)

---
updated-dependencies:
- dependency-name: smallbitvec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 16:56:57 +00:00
dependabot[bot]
2afc117c44
build(deps): bump system-deps from 6.2.0 to 6.2.1 (#31672)
Bumps [system-deps](https://github.com/gdesmott/system-deps) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/gdesmott/system-deps/releases)
- [Changelog](https://github.com/gdesmott/system-deps/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gdesmott/system-deps/compare/system-deps@6.2.0...v6.2.1)

---
updated-dependencies:
- dependency-name: system-deps
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 16:53:00 +00:00
Delan Azabani
ed99128132
constellation: allow event tracing to be configured with RUST_LOG (#31659) 2024-03-14 12:28:36 +00:00
Oriol Brufau
b30b79a93a
Cleanup UA styles for anonymous table rows and cells (#31661)
These properties were being set to their initial value, this wasn't
needed because they are non-inherited properties and there isn't
anything else setting them.
2024-03-14 11:53:27 +00:00
Martin Robinson
e5fbb3d487
fonts: Add FontIdentifier and LocalFontIdentifier (#31658)
Instead of using a simple `Atom` to identify a local font, use a data
structure. This allows us to carry more information necessary to
identify a local font (such as a path on MacOS). We need this for the
new version of WebRender, as fonts on MacOS now require a path.

This has a lot of benefits:
 1. We can avoid loading fonts without paths on MacOS, which should
    avoid a lot of problems with flakiness and ensure we always load the
    same font for a given identifier.
 2. This clarifies the difference between web fonts and local fonts,
    though there is more work to do here.
 3. This avoid a *lot* of font shenanigans, such as trying to work
    backwards from the name of the font to the path of the font we
    actually matched. In general, we can remove a lot of code trying to
    accomplish these shenanigans.
 4. Getting the font bytes always returns an `Arc` now avoiding an extra
    full font copy in the case of Canvas.
2024-03-14 11:31:00 +00:00
Ngo Iok Ui (Wu Yu Wei)
b1debf2068
fix: missing thread name when spawning (#31656)
* Add missing thread name when spawning

* Update namings
2024-03-14 10:40:58 +00:00
Martin Robinson
78fe461ff2
layout: Properly parent table-row and table-row-group (#31619)
Put table cell content fragments into a hieararchy of fragments that
include their table row and table row group fragments. This ensures that
things like relative positioning and transforms set on rows and row
groups properly affect cells and cell content.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-14 10:33:42 +00:00
Oriol Brufau
0e78c8114b
Allow finishing anonymous inline-table at the end of inline elements (#31650)
This avoids inserting it outside of its parent.
2024-03-14 09:58:00 +00:00
Martin Robinson
871a9bf677
layout: IFCs should not always be marked as containing floats (#31641)
Marking all IFCs as containing floats shouldn't change layout results,
but does prevent parallel layout in some cases. This change fixes an
issue where we were marking all IFCs as containing floats.

Fixes #31540.
2024-03-14 09:55:01 +00:00
Delan Azabani
eaa800c8dd
servoshell: allow event tracing to be configured with RUST_LOG (#31657)
* servoshell: allow event tracing to be configured with RUST_LOG

* Move docs to same file as target prefixes

* Avoid requiring macro callers to use LogTarget trait

* Clean up macro call in app.rs

* Rename macros to reflect value types
2024-03-14 09:27:18 +00:00
Oriol Brufau
f3a73dbed3
End ongoing IFC when inserting anonymous block-level table (#31606)
So that the table appears after preceding inline-level contents.
Fixes #31603.
2024-03-13 21:03:06 +00:00
Aarya Khandelwal
525fc58ed9
rustdoc: Fix warnings in components/layout_2020 (#31647)
* Added a : to make it a clickable link

* changed block_offset_of_parent to parent_offset , to make it a clickable link.
2024-03-13 18:16:31 +00:00
Oluwatobi Sofela
8cbad332c3
rusdoc: Fix idl warning in components/script/dom/bindings (#31643)
* rusdoc: Add valid domstring link

* rustdoc: Replace unused idl link ref
2024-03-13 17:59:27 +00:00
dependabot[bot]
0779af71a0
build(deps): bump bytemuck from 1.14.3 to 1.15.0 (#31645)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.14.3 to 1.15.0.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.14.3...v1.15.0)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-13 17:14:15 +00:00
Aarya Khandelwal
f5a1879bac
rustdoc: Fix warnings in components/layout_2020 (#31640)
* Changed LineItems to LineItem to make it a clickable link

* No variant named Anonymous is present in Fragment.
2024-03-13 13:50:26 +00:00
Martin Robinson
38db1a5ce9
rustdoc: Add some basic Safety sections to unsafe functions (#31639) 2024-03-13 10:44:59 +00:00