We don't need to floor the preferred box sizes to be at least zero,
since `used_size_as_if_inline_element_from_content_box_sizes()` will
take care of applying min and max constraints, and the min has been
floored to be at least zero.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
With the latest release (5.0) of the OpenHarmony SDK
libclang.dll is now available and we can support
building for OpenHarmony from windows hosts.
Other changes required for building OH on windows:
- We can't use the `<target_triple>-clang` wrappers, since
those are bash scripts, which fails on windows when cc-rs
tries to directly call them. However, we already pass all
the required flags the wrapper script would set, so this
is not an issue.
- We need to use posix paths, otherwise the sysroot parameter
will not be applied correctly (by bindgen). It seems to only
cause issues with bindgen in practice, possibly because
bindgen interprets the path with
[`shlex::split`](8a6d851318/bindgen/lib.rs (L312C27-L312C40))
which presumably causes the issues with windows paths.
To be consistent I decided to use posix paths for all paths.
- Fix checks for copying dlls. We need to check the target OS,
not the host OS when determining what libraries to copy.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* frozen array in XRInputSourcesChangeEvent, update o_frozen_array doc
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* simplified changes
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* added tests
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
---------
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* rechecking all file changes and additions
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* added comments with specification links
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* added space before the links
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* modified the doc link format
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* suggested changes + updated interfaces.https.html + updated passing test expectations
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* needed to do an update-manifest
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* updated the idlharness.any.html expectations
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
---------
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
The logic varied quite a bit depending on the case, now it's unified.
This also fixes the following case where the iframe was 150px tall
instead of 50px:
```html
<iframe style="min-width: 400px; max-height: 50px"></iframe>
```
This also modifies video-intrinsic-width-height.html to expect the new
behavior that we share with Blink and WebKit. In fact WebKit already
modified this test but forgot to export the change upstream. Firefox is
different but it was already failing anyways.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Convert settings.gradle to Kotlin Script
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* servoview-local: Convert build.gradle to Kotlin Script
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Convert build.gradle to Kotlin Script
This was a trickier one, as I wanted to maintain compatibility with the rest of the files while facilitating this migration.
Closures are annoying, another annoyance of loosely typed languages in an OOP project.
Migration of child build scripts will require the reverse code and or migration of this scripts functions to kotlin lambdas / functions (which are just jvm functions).
Code based off of the following guide.
https://docs.gradle.org/current/userguide/kotlin_dsl.html#groovy_closures_from_kotlin
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* servoapp: Convert build.gradle to Kotlin Script
Migrated deprecated API usages.
There are two more, but ignored for now.
("splits.density", "capitalize")
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* servoview: Convert build.gradle to Kotlin Script
Migrated deprecated API usages.
There are two more, but ignored for now.
("splits.density", "capitalize")
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* servoview: Replace ResourceGroovyMethods with Kotlin File.walk
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Replace Groovy Closures with Kotlin Lambda types
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Move Utility fields to buildSrc
Using extra fields is quite annoying and makes it hard to maintain
API stability.
"buildSrc" is designed for this task, and thus is being used
for said task.
This means that when editing build.gradle files in an Android Studio,
there is a direct reference to the source of a function.
(Easier time referring to documentation, source of function, etc).
More information here:
https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Sync target SDK to 33
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Make Notification actions immutable.
Otherwise android lint will be upset.
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Move dependencies from servoview to servoapp
ServoView does not use them.
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Add POST_NOTIFICATIONS to manifest
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Add host to intent-filter
Use "*" for any host, lets hope this works.
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Solve ndkBuild tasks not being linked
The problem stems from something something groovy wishy washy unclear
execution order something Kotlin explicit execution order.
Merge tasks exist after the project is evaluated.
The problem is that simply running afterEvaluate causes an
ConcurrentModificationException. This is because of creating a new
task while looping over existing tasks. To remedy this we simply
filter the tasks first, than create and link the new task.
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Add documentation to why some functions are extensions to Project
Signed-off-by: clocks <doomsdayrs@gmail.com>
* android: drop the host directives from AndroidManifest.xml
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
---------
Signed-off-by: clocks <doomsdayrs@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
A recent refactoring (#33531) made a change that resulted in the
`Origin` header including the port even when the default port for a
scheme was used. This made the serialization different from that used
for `rust-url`'s `Origin::ascii_serialization()`, breaking CORS on some
sites. This change makes it so that the serialization is consistent
again.
This change also fixes the visiblity on a few methods in
`http_loader.rs` since visibility needs to be adjusted for testing
anyway.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
A `<video>` element with no source won't have a natural aspect ratio,
but `aspect-ratio: auto` should still fall back to a ratio of 300/150.
`used_size_as_if_inline_element_from_content_box_sizes()` was already
handling this, but other consumers of `preferred_aspect_ratio()` were
wrong. In particular, this resulted in a 0px wide inline-block:
```html
<div style="display: inline-block; border: solid">
<video style="height: 100px; background: cyan"></video>
</div>
```
So this patch moves the fallback into `preferred_aspect_ratio()`.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Some images don't load because we don't support SVG.
In that case this makes the test fail rather than timing out.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Servo was previously using the inverse of the correct scale factor
which could cause the scrolling speed to be 4x too slow on a machine
with scale factor of 2.0
Signed-off-by: Nico Burns <nico@nicoburns.com>
We were following CSS2, which didn't handle `aspect-ratio`.
This patch simplifies the logic and handles it correctly.
Unfortunately this makes 2 tests fail, but I'm pretty sure they aren't
spec-compliant. I'm leaving them as-is for now since they are part of
interop-2021, and Gecko, Blink and WebKit pass them (because of some
non-interoperable incorrect behaviors).
I'm adding a new test that is fully passed by Servo and WebKit.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This removes unused code in order to reduce the number of compiler
warnings on the Android build. Some of this code might be used in the
future and it can be restored from git commit history.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
There is a command-line argument to override the default window size,
but not one for overriding the default screen resolution. This is
important for testing pages that use screen size to have different
behavior.
In addition to adding the new option this change:
- Renames the `--resolution` command-line argument to `--window-size`
to remove ambiguity with the `--screen-size` argument.
- Passes the screen size as device independent (device pixels scaled by
HiDPI factor) to Servo internals. Not only it make it simpler to pass
the `--window-size` override, it makes more sense. Different screens
can have different HiDPI factors and these can be different from the
scale of the window. This makes the screen HiDPI factor totally
independent of the one that Servo uses for the window.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
- We should use the CMake version from the NDK
- ignore errors from unused commandline parameters,
which can easily happen due to --gcc-toolchain, which is added by the
default CMake code when compiling with Clang.
- Previously servo didn't have any CMake dependency projects anymore,
so these issues didn't surface.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* feat: patch for video layout sizes
added rebase from main 2024/10/05
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: eri <epazos@igalia.com>
* feat: take width and height parameters if provided
Signed-off-by: eri <epazos@igalia.com>
* chore: tidy the code and update test expectations
Signed-off-by: eri <epazos@igalia.com>
* feat: handle removing poster
Signed-off-by: eri <epazos@igalia.com>
* chore: update test expectations and remove debug code
Signed-off-by: eri <epazos@igalia.com>
* fix: issues after rebasing to main
Signed-off-by: eri <epazos@igalia.com>
* feat: pass src remove test and tidy
Signed-off-by: eri <epazos@igalia.com>
* chore: clippy fixes
Signed-off-by: eri <epazos@igalia.com>
* chore: update passing test expectations
Signed-off-by: eri <epazos@igalia.com>
* fix object-position-svg test
Signed-off-by: eri <epazos@igalia.com>
* fix unintentional override of video size and resize events
Signed-off-by: eri <epazos@igalia.com>
* change how resize events are sent to better match the spec
Signed-off-by: eri <epazos@igalia.com>
* simplify poster mutation handling
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: eri <eri@inventati.org>
* improved handling of intrinsic sizes
- differentiate between natural size and css size
- presentational attributes
- fallback ratio for video element
- handle more cases where the src/poster are added/removed
- aspect ratio hints
Signed-off-by: eri <epazos@igalia.com>
* update test expectations
Signed-off-by: eri <epazos@igalia.com>
* fix cleaning current frame
Signed-off-by: eri <epazos@igalia.com>
* update test expectations
Signed-off-by: eri <epazos@igalia.com>
* Apply suggestions from code review
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: eri <eri@inventati.org>
* More code review suggestions
Signed-off-by: eri <epazos@igalia.com>
* Prevent aspect-ratio:auto from pulling the ratio from the default object size
As resolved in https://github.com/w3c/csswg-drafts/issues/7524#issuecomment-1204462924
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
---------
Signed-off-by: eri <epazos@igalia.com>
Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Constellation notifies the embedder about history changes.
When we hit a URL that responds with a HTTP 301 response code,
we want to replace the original URL with the final location.
The change boils down to reading the URL from
`Pipeline.url`, which is kept up to date, instead of from
`Pipeline.load_data.url`, which stores the original request.
Fixes#33876
Signed-off-by: rwakulszowa <rwakulszowa1@gmail.com>