Commit graph

26370 commits

Author SHA1 Message Date
Martin Robinson
7964a4f582
Unfork and upgrade jemallocator (#30963)
This dependency was forked in ##20641 in order to fix the Android build.
Years have gone by and it's quite likely that many things have changed
in the Android toolchain and these dependencies. We can sort out this
issue when getting the Android build working -- or if all else fails,
disable jemalloc for Android. In the meantime, unfork the dependency and
upgrade it.

Fixes #20645.
2024-01-01 19:32:45 +00:00
Samson
e79171ec01
Update WebGPU CTS (#30954)
* Update WebGPU CTS to ae15a59832

* Add internal to GPUErrorFilter to make more test work

* No crash in CreateRenderBundleEncoder

* getCompilationInfo

* Update expectations
2023-12-28 17:32:21 +00:00
Martin Robinson
bd052f536e
bhm: Fix a warning in the Linux sampler (#30924)
Use curly braces instead of an explicit drop to control the end of a
borrow.
2023-12-28 11:20:47 +00:00
Samson
7973cb6458
Update wgpu to 0.18.1 (#30926)
* Update wgpu to 0.18.1

* Fix webgpu code

* tidy
2023-12-25 07:11:37 +00:00
Martin Robinson
df157dcc03
dependencies: Update to latest version of unwind-sys (#30923)
This allows us to remove the dependency on the git version of
`unwind-sys` necessary for allowing compilation on Fedora 39.
2023-12-23 15:56:09 +00:00
Martin Robinson
81f5157522
Add support for table fixups (#30868)
This adds support for fixing up tables so that internal table elements
that are not properly parented in the DOM have the correct box tree
structure according to the CSS Table specification [1]. Note that this
only comes into play when building the DOM via script, as HTML 5 has its
own table fixups that mean that the box tree construction fixups here
are not necessary.

There are no tests for this change. In general, it's hard to write tests
against the shape of the box tree, because it depends on the DOM. We
plan to test this via WPT tests once layout is complete.

1. https://drafts.csswg.org/css-tables/#table-internal-element

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2023-12-22 12:11:58 +00:00
Martin Robinson
709d00583f
layout: Make all word separators justification opportunities (#30866)
This change adapts both layout and legacy layout to the specification
which gives a list of word separators to use as justification
opportunities.
2023-12-21 22:49:24 +00:00
Martin Robinson
74798c4b7b
layout: Add support for text-align-last (#30905)
This change adds support for `text-align-last` as well as ensuring that
it also applies to lines before forced line breaks. Two tests start to
fail because they rely on right-to-left text to pass:

 - /css/css-text/text-align/text-align-last-010.html.ini
 - /css/css-text/text-align/text-align-last-011.html.ini
2023-12-21 14:45:34 +00:00
Martin Robinson
d007d265bd
Fix the unwind-sys build on latest Fedora (#30906)
The libunwind library version installed includes an rc number. The
latest released version of the `unwind-sys` crate doesn't handle this
properly, so rely on the latest commit in the upstream repository.
2023-12-21 14:37:00 +00:00
atbrakhi
a9bf29cf8a
Fix crash caused by arithmetic underflow in layout2020 (#30897)
* fix crash caused by arithmetic underflow

* add WPT crash test to avoid regressions

* update manifest

* apply martin's patch

* remove wpt test
2023-12-21 09:16:23 +00:00
Martin Robinson
abb017b854
script: Allow moving back to non-quirks mode (#30898)
The code in script is written so that the document itself can move from
quirks to non-quirks mode, but this is never communicated to layout --
meaning quirky layout keeps happening. This is an issue when rewriting
the entire document with `document.write()` which is what some WPT tests
do to test quirks mode behavior.
2023-12-21 08:14:00 +00:00
Lucas Montenegro
256ab5353b
These changes fix #30843 (#30888)
Signed-off-by: Lucas Fabián Montenegro <40044087+lucasMontenegro@users.noreply.github.com>
2023-12-20 05:57:48 +00:00
Alex Touchet
e4aed3d06a
Update branch name to main (#30877) 2023-12-16 09:32:20 +00:00
Martin Robinson
ccf0b739df
Add basic support for text-align: justify (#30807)
This also enables parsing of `text-justify` for non-legacy layout,
though only None is supported (disabling justification).
2023-12-15 14:00:13 +00:00
Martin Robinson
569c4a8823
Integrate hyper_serde into Servo source (#30803)
hyper_serde changes very infrequently and typically only in order to
upgrade Servo dependencies. crates.io lists hyper_serde as having no
dependents, and its integration will not prevent releasing new versions.
Integrating it will both reduce the number of repositories we have to
maintain as well as making it easier to upgrade Servo dependencies.
2023-12-14 11:43:10 +00:00
Delan Azabani
17f3c45d4f
Add initial support for offscreen rendering (#30767)
* Offscreen rendering

* shared memory case never actually rendered to backbuffer

* fix compile errors (in theory) when gl crate feature disabled

* update doc comments

* remove dark CentralPanel border covering edges of viewport

* clear to transparent, to avoid pink artifacts

* fix mouse input for browser being consumed by egui

* avoid destroying OpenGL resources unless resizing window

* clean up compositing::gl

* fix flickering around edges after resizing window

* unset invalidate_last_render_target after invalidating

* fix incorrect DRAW_FRAMEBUFFER name when blitting

* bind the widget surface fbo before painting egui

* make composite_specific_target take CompositeTarget, not Option

* compositing: remove cargo feature “gl”

* capitalise FBO in bind log message

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

* capitalise FBO in drop log message

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

* rename RenderTargetInfo fields and use OnceCell for next field

* rename RenderTargetInfo.read to read_back_from_gpu

* document servo_framebuffer_id in Minibrowser::update

* rename needs_fbo to use_offscreen_framebuffer

* capitalise FBO in unbind log message

* clarify the purpose of Minibrowser::on_event

* fix unused_must_use warning

* reduce nesting in Minibrowser::update

* use implicit format argument in panic

* store Minibrowser.widget_surface_fbo as glow type

* explain why servo_framebuffer_id is None in first call site

* rename output_framebuffer_id to offscreen_framebuffer_id

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-12-13 02:49:25 +00:00
Delan Azabani
97e6c72f57
Add multiview feature flag in compositing and constellation (#30840) 2023-12-12 08:50:58 +00:00
Delan Azabani
8a226fdb19
constellation: notify embedder when events are hit-tested to browsers (#30841)
* constellation: notify embedder when events are hit-tested to browsers

* fix compile error in libsimpleservo

* impl From<&CompositorEvent> for CompositorEventVariant

* remove msg temporaries in Constellation::forward_event

* use single wildcard arm in EventDelivered case in handle_servo_events
2023-12-12 06:36:27 +00:00
atbrakhi
a315bec4ed
Use app units in replaced elements (#30825)
* use app_units in replaced elements

* fmt

* remove from_f32_px

* fix typo
2023-12-11 11:30:37 +00:00
Samson
e2743c6141
Bump mozangle to 0.5.0 (#30546)
* Update mozangle to version 0.5

* Update webglshader CompileOptions and BuiltInResources

* Update webglshader.rs

* Update webglshader.rs
2023-12-08 11:15:01 +00:00
Martin Robinson
7e82c5c957
Compile Servo with the latest version of rust stable (#30831)
This completes the transition to compiling Servo with rust stable. Some
nightly-only features are still used when compiling the `script` and
`crown` crates, as well as for some style unit tests. These will likely
break with newer compiler versions, but `crown` can be disabled for them
conditionally. This is just the first step.

This has some caveats:

1. We need to disable setting up the special linker on Linux. The -Z
   option isn't supported with stable rust so using this is out --
   meanwhile we can't be sure that lld is installed on most systems.
2. `cargo fmt` still uses some unstable options, so we need to rely on
   the unstable toolchain just for running `fmt`. The idea is to fix this
   gradually.
2023-12-06 17:36:07 +00:00
atbrakhi
9028c90332
Generalize LengthPercentageOrAuto impl to Generic Type (#30824)
* Generalize LengthPercentageOrAuto impl to Generic Type

* review fix
2023-12-06 10:20:43 +00:00
Martin Robinson
8ded1072ce
Re-use the TextMetrics data structure in the Layout 2020 fragment tree (#30823)
This data structure has all of the metrics needed to render a font and
is in `Au`. We'll need more of these metrics for implementing
`vertical-align` and its use doesn't increase the size of the Fragment
tree (as the BoxFragment is still larger). In addition, this will be
helpful when switching layout to `Au`.
2023-12-06 09:52:23 +00:00
Martin Robinson
f0b4162328
Add initial support for table box tree construction (#30799)
This is the first part of constructing the box tree for table layout. No
layout is actually done and the construction of tables is now hidden
behind a flag (in order to not regress WPT).  Notably, this does not
handle anonymous table part construction, when the DOM does not reflect
a fully-formed table. That's part two.

Progress toward #27459.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Manish Goregaokar <manishsmail@gmail.com>
2023-12-05 11:10:45 +00:00
Joshua Holmes
c909c64378
Fix typing issues in flex layout (#30784)
* Use `Option` instead of `Result` when passing optional values into vector

Also renames vector and adds comment for clarity, just in case that's helpful

Signed-off-by: Joshua Holmes <joshua.phillip.holmes@gmail.com>

* Replace use of Option with new enum, , when seperating flex content

Signed-off-by: Joshua Holmes <joshua.phillip.holmes@gmail.com>

* Move global  function body into the  method

Signed-off-by: Joshua Holmes <joshua.phillip.holmes@gmail.com>

---------

Signed-off-by: Joshua Holmes <joshua.phillip.holmes@gmail.com>
2023-12-04 10:02:07 +00:00
Samson
604979e367
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins

* Use crown instead of script_plugins

* crown_is_not_used

* Use crown in command base

* bootstrap crown

* tidy happy

* disable sccache

* Bring crown in tree

* Install crown from tree

* fix windows ci

* fix warning

* fix mac

libscript_plugins.dylib is not available anymore

* Update components/script/lib.rs

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

* Update for nightly-2023-03-18

Mostly just based off https://github.com/servo/servo/pull/30630

* Always install crown

it's slow only when there is new version

* Run crown test with `mach test-unit`

* Small fixups; better trace_in_no_trace tests

* Better doc

* crown in config.toml

* Fix tidy for real

* no sccache on rustc_wrapper

* document rustc overrides

* fixup of compiletest

* Make a few minor comment adjustments

* Fix a typo in python/servo/platform/base.py

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

* Proper test types

* Ignore tidy on crown/tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-12-01 15:50:52 +00:00
Martin Robinson
20a73721de
Remove a comment that is no longer valid (#30806)
The update of `max_block_size` here no longer happens.
2023-12-01 12:48:22 +00:00
Martin Robinson
cdbd60fe53
Extend character-based soft wrap prevention to before atomics (#30800)
The changes in #30740, fixed an issue where certain characters should
prevent line break opportunity after atomics. This change extends that
to also apply to before atomics, which is what the specification says
should happen.
2023-12-01 09:26:49 +00:00
Martin Robinson
f1c291853e
Stop sending " " to linebreaker for replaced content (#30740)
We previously sent a " " to the linebreaker in order to ensure that the
next text had a soft wrap opportunity at the start. Calling `next(" ")`
without waiting until the returned index was 1, violated some
invariants of linebreaker ultimately causing a panic.

Instead of using the linebreaker for this, simply keep a flag in the
IFC layout state, which avoids the problem entirely.

Fixes #30703.
2023-11-30 14:46:14 +00:00
Martin Robinson
a05598402e
Add initial support for sticky positioning for non-legacy layout (#30686)
* Add initial support for sticky positioning for non-legacy layout

Many tests still fail for a variety of reasons. One of the primary ones
is that CSSOM currently does not return correct values for elements
positioned by sticky nodes. This requires changes to WebRender to work
properly.

* Fix an assertion failure in the legacy layout sticky code
2023-11-29 09:03:24 +00:00
Oriol Brufau
27056eb93a Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
1ada5e9605 style: Add a query-selector fast path for attribute selectors in the rightmost compound
Differential Revision: https://phabricator.services.mozilla.com/D180553
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
de9fb7983a style: Speed up / specialize attribute selector-matching
Inline the attribute lookup code, and only branch on the attribute selector
type if we have found an attribute.

Differential Revision: https://phabricator.services.mozilla.com/D180531
2023-11-24 08:57:14 +01:00
Oriol Brufau
8c5a028955 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
e59c71d8ef style: Remove unused TElement::has_attr
Differential Revision: https://phabricator.services.mozilla.com/D180530
2023-11-24 08:57:14 +01:00
Oriol Brufau
29f6170564 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
3da2db1c53 style: Remove the never_matches field from attr selectors
It's an extra branch which in practice we almost never take, plus extra
checks during parsing.

Differential Revision: https://phabricator.services.mozilla.com/D180529
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
54a783db17 style: Add a way to optimize the "attribute in no namespace exists" check
Go through the slow path by default. No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D180528
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
c36a22a97f style: Don't recompute quirks mode -> case sensitivity over and over
The only reason we pass the quirks mode around is to compute the case
sensitivity, but we can just pass the later.

Differential Revision: https://phabricator.services.mozilla.com/D180527
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
5b184f448b style: Fix style invalidation on layer rule insertion
Layer insertion may change the order of styles, so we may need to fully
invalidate.

Without this change, bug 1838045 makes
layer-statement-before-import.html fail.

Differential Revision: https://phabricator.services.mozilla.com/D180929
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
50d7f882dd style: Container units should prevent us from sharing style by rule node
At least when the containers are different.

For now check that by doing a somewhat simplified test (checking
sibling-ness).

The new flag can be useful to optimize container query restyles on
resizes too, in the future.

Differential Revision: https://phabricator.services.mozilla.com/D179268
2023-11-24 08:57:14 +01:00
Ting-Yu Lin
07d6ec5d4b style: Remove obsolete comment to add use counter for developing CSS properties
The CSS properties in the list are all shipped. Since we still don't support use
counter for developing CSS properties since this bug opens, I assume this
feature is not critical. Hence the removal of the comment.

Differential Revision: https://phabricator.services.mozilla.com/D180771
2023-11-24 08:57:14 +01:00
Oriol Brufau
c1a622cf01 Further changes required by Servo 2023-11-24 08:57:14 +01:00
David Shin
ae5e0d49d8 style: Move ANCHORS_RELATIVE_SELECTOR out of nsINode flags
Move the flag to ComputedValueFlags, like `CONSIDERED_RELATIVE_SELECTOR`.

Differential Revision: https://phabricator.services.mozilla.com/D180726
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
9321265b38 style: Clean up Context::for_non_inherited_property
We don't ever check the particular property, so it can just be a
boolean.

Differential Revision: https://phabricator.services.mozilla.com/D180680
2023-11-24 08:57:14 +01:00
Oriol Brufau
1ad176f1bc Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
3da0e44d98 style: Fix rebase conflict with bug 1837664 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
77c541b38a style: Do not snap -webkit-text-stroke-width to dev pixels
Introduce LineWidth (which doesn't snap) and let BorderSideWidth
wrap it and actually do the snapping.

Differential Revision: https://phabricator.services.mozilla.com/D180688
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
127e00e48a style: Improve border-image shorthand serialization, and annotate more passes 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
78f8d575b7 style: Don't allow to share style by rule node for links
(Regardless of visitedness)

Differential Revision: https://phabricator.services.mozilla.com/D180353
2023-11-24 08:57:14 +01:00