Move `--flavor` to a new "Packaging options" group, so that
we can only apply the flavor option to the commands that support it.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Fix table track constraindness
Only as size that isn't `auto` and doesn't contain percentages can constrain
a table track (https://drafts.csswg.org/css-tables/#constrainedness).
However, in a bunch of cases we were only checking for `auto`.
Also, we were allowing the inline-size of a cell to constrain both its
column and row. Using the block-size of the row makes more sense.
The spec doesn't define constrainedness for rows, though.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Apply suggestions from code review
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
---------
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
We have improved the logic for computing intrinsic sizes, and apparently
we are no longer getting a `ContentSizes` whose `min_content` is greater
than the `max_content`.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* ohos: Support product flavors
Support different product flavors (e.g. with different signing
configurations) by supporting --flavor on ohos.
The flavor influences the package path for OH packages, so
allow the flavor parameter on build + package + install
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Fix smoketest
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* Improve readability of code
Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>
* Fix style issue
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
---------
Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This is done by no longer forwarding compositor-bound messages through
SystemFontService and making `FontContext` non-generic:
- Messages from the `FontContext` to the `Compositor` no longer need to be
forwarded through the `SystemFontService`. Instead send these messages
directly through the script IPC channel to the `Compositor`.
- Instead of adding a mock `SystemFontServiceProxy`, simply implement a
mock `SystemFontService` on the other side of an IPC channel in the
`font_context` unit test. This allows making `FontContext`
non-generic, greatly simplifying the code. The extra complexity moves
into the unit test.
These changes necessitate adding a new kind of `FontIdentifier`,
`FontIdentifier::Mock` due to the fact that local fonts have
platform-specific identifiers. This avoids having to pretend like the
system font service can have web fonts -- which was always a bit of a
hack.
These two changes are combined into one PR because they both require
extensive and similar chages in the font_context unit test which
dependended on the details of both of them.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This makes the determination of whether or not to use fast shaping
platform independent. Previously it was less stringent for Windows,
leading to using it in cases where a font had a GSUB or GPOS table --
which broke proper shaping.
In addition, the test is made platform independent and expanded to be
more complete.
Finally, comments are added indicating that "fast shaping" will be
removed.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This changes modifes the way that font data is sent over IPC channels.
Instead of serializing the data or sending it via IPC byte senders, font
data is copied into shared memory and a copy of the handle is sent over
the channel.
There is also the idea of sending the file handle of the on disk data of
system fonts. This could be implemented as a further followup once there
is an abstraction in `ipc-channel` over file handles.
To accomplish this, a `FontData` abstraction is added, which also allows
caching an in-memory shared `Arc<Vec<u8>>` version of the data (neeeded
by some APIs). This could also be a place for caching font tables in the
future.
Finally, the `FontCacheThread` is renamed to the `SystemFontService`
while the proxy for this is now named `SystemFontServiceProxy`.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Changes:
- Add prebuilt artifacts for OpenHarmony and test github attestions
(https://github.com/servo/mozjs/pull/501)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
The current implementation has 3 main issues related to HiDPI:
1. When the window moves from a screen with scale factor of 1.5 to one
with 1 and back to 1.5, the minibrowser toolbar actually ends up
being scaled by a factor of 2.25 instead of 1.5. This is because we
currently use the [set_pixels_per_point] method on egui's Context,
but calling this with a value of `ppp` will modify egui's internal
'zoom factor' to be:
```
zoom_factor = ppp / native_points_per_pixel.
```
where `native_points_per_pixel` is the window system scale factor.
The idea is egui can calculate the final scale factor for translating
its logical points to physical pixels as:
```
points_per_pixel = zoom_factor * native_points_per_pixel
```
where zoom_factor is a factor used for Ctrl+Plus, Ctrl+Minus
behaviour. The problem is when we handle the ScaleFactorChanged winit
event due to window moving between screens, the
`native_points_per_pixel` still has the value of the previous
screen's native scaling factor and not the current screen's factor.
This seems to be the case even if we pass the ScaleFactorChanged
event to egui before we call `set_pixels_per_point`.
2. The egui logic for handing Ctrl+Plus, Ctrl+Minus and Ctrl+0 doesn't
interact well with servoshell's device-pixel-ratio CLI argument which
allows the user to override the HiDPI factor. For example, Ctrl+0
will cause egui to reset the zoom_factor to 1.0 instead of the
override we wanted. Another issue is egui's Ctrl+Plus/Ctrl+Minus
will scale the minibrowser in increments of 0.10 whereas
Servo's own page zoom doesn't (it keeps multiplying by 1.1, so the
actual increments are 0.1, 0.21. 0.33 etc)
3. The inital window size calculation on Linux currently assumes a scale
factor of 1.0. This means the window doesn't have the expected
default logical size of 1024*740 on HiDPI systems. On a screen with
HiDPI factor of 1.5, the logical window size ends up being 682x493.
This change addresses all 3 issues:
For 1, switch to the `set_zoom_factor` method of egui context
to avoid the issue with scaling by incorrect native_points_per_pixel.
To allow for the device-pixel-ratio override to work, we calculate the
actual zoom_factor as `device-pixel-ratio / window's scaling factor`.
For 2, disable egui's handling of Ctrl+Plus, Ctrl+Minus, Ctrl-0
shortcuts. It is unclear whether the current behaviour of scaling
both the toolbar and the web page was intentional, or just an accident.
This behaviour is also different from other browser where page zoom
doesn't scale the GUI, so it doesn't seem like a regression to me.
For 3, use LogicalSize type of winit which lets the physical size
calulation to be handled by winit using the windows's actual HiDPI
factor instead of hardcoded 1.0.
[set_pixels_per_point]: 1603f05818/crates/egui/src/context.rs (L1886)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Implement outerText on HtmlElement
Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* Fixed some innerText/outerText bugs
Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
* Unified innerText/outerText handling outside of Layout
Before these 2 were treated separately and only within
Layout would they end up calling the same method, now
they are already unified within HTMLElement
Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
* Address a few nits
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Added innerText support for `inline-flex`
Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
---------
Signed-off-by: Shane Handley <shanehandley@fastmail.com>
Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Shane Handley <shanehandley@fastmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Bundle resource files into the .hap, so they are available
as files in the application sandbox, instead of included
into the shared library.
This should slightly reduce the binary size in debug and
release mode.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* Use linkrelations for all linkable elements
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Document LinkRelations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Rename linkrelations.rs -> links.rs
This module is supposed to include general-purpose link
related stuff.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Parse all "rel" keywords
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
25372340 added back and forward apis to the ohos servoshell.
157e28c5 vendored the ohos demo ArkTS app into the servo repo,
but did not include the back and forward buttons, which
were added in the meantime.
This commit adds the missing back and forward buttons to the ArkTS code.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Update condition handling for exposing values
- Let Guard take a list of conditions
- Check for secure context condition when exposing constructor
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update WPT expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Python tidy
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Make interfaces test run in secure context
Signed-off-by: Daniel Adams <msub2official@gmail.com>
---------
Signed-off-by: Daniel Adams <msub2official@gmail.com>
For the sizing properties.
We don't actually support them yet, just treating them as
the initial value.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* `descriptor` -> `configuration` to match spec
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Support more `TextureFormat`s in `GPUCanvasContext.configure()`
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This change adds support for `position: relative` to table `<caption>`.
In addition to adjusting their position according to inset values, table
captions must also establish containing blocks for descendants that are
absolutely positioned.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Add a profiling build profile in Cargo
Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Redefine the profiling profile in terms of release
Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Remove the other profiles added for testing
Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Enable ThinLTO, like we do in production profiles
Signed-off-by: Delan Azabani <dazabani@igalia.com>
---------
Signed-off-by: Delan Azabani <dazabani@igalia.com>
This also makes a couple small improvements:
- Rename `IntrinsicSizes` to `NaturalSizes` which reflects more
modern spec language.
- Move the conversion of Stylo's `ImageRendering` to WebRender's
version to a `ToWebRender` trait implementation.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>