| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fail the lint job when cargo-clippy reports some warnings
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Remove todo comment
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* clippy: use Option::take instead of mem::replace
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
---------
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This unifies the size resolution into AbsoluteAxisSolver, since it needs
to know the size in order to resolve auto margins correctly anyways.
This will allow adding support for sizing keywords in a follow-up patch.
Also, this avoids doing multiple layouts due to min and max constraints,
improving performance.
Additionally, tables may end up having a custom size, different than
what we would expect by just looking at the sizing properties. This
patch ensures that we resolve margins correctly with the final size,
resulting in 2 tests now passing.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
| |
components\layout_2020\style_ext.rs:320:20 (#33936)
Signed-off-by: Noble <nobleuwuja@gmail.com>
|
|
|
|
|
| |
components\layout_2020\display_list\mod.rs:1365:25 (#33935)
Signed-off-by: Noble <nobleuwuja@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Upgrade Stylo to 2024-10-04
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fixup for https://phabricator.services.mozilla.com/D220285
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fixup for https://bugzilla.mozilla.org/show_bug.cgi?id=1918093
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fixup for https://phabricator.services.mozilla.com/D222817
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fixup for https://phabricator.services.mozilla.com/D222856
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fixup for https://phabricator.services.mozilla.com/D222532
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fixup for https://phabricator.services.mozilla.com/D222533
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fixup for https://phabricator.services.mozilla.com/D222534
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fixup for https://phabricator.services.mozilla.com/D223878
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
---------
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
| |
This was only used for serializing inset properties in getComputedStyle,
but it was unnecessary and the logic was wrong anyways: an `auto` size
doesn't imply that we won't be overconstrained, because it won't become
negative even if the insets are big enough.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
| |
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DOM code (#33894)
* fixed some clippy warnings
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Delete extra file
Signed-off-by: chickenleaf <lashwinib@gmail.com>
* preserved newline in compositionevent.rs
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
* removed the newline in PrototypeList
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* removed the trailing whitespace
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
---------
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
| |
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
| |
Signed-off-by: Delan Azabani <dazabani@igalia.com>
|
|
|
|
|
|
|
|
|
| |
(#33848)
When computing the min-content size of an inline formatting context,
we could allow a soft wrap opportunity at the start of a text run.
This shouldn't happen with `text-wrap-mode: nowrap`.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
| |
It's not really useful to have it.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The result of `inline_content_sizes()` may depend on the block size of
the containing block, so we were always recomputing in case we got
a different block size.
However, if no content has a vertical percentage or stretches vertically,
then we don't need to recompute: the result will be the same anyways.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
| |
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix: Handle inline margins in layout_for_block_content_size()
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Update test expectations
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
---------
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
|
|
|
|
|
| |
This replaces `Au(0)` with `Au::zero()` and other utility functions when possible.
Signed-off-by: hackerbirds <120066692+hackerbirds@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
| |
Adds support for min-content, max-content, fit-content and stretch,
for atomic inlines.
There are some new test failures because we don't support vertical
writing modes nor `transition-behavior:allow-discrete`.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`FlexItem::new()` (#33754)
* Use content_box_sizes_and_padding_border_margin_deprecated() in FlexItem::new()
Signed-off-by: PS Adavize <siyakapromise@gmail.com>
* remove unnecessary variable declaration declaration
Signed-off-by: PS Adavize <siyakapromise@gmail.com>
* Remove redundant variable pbm
Signed-off-by: PS Adavize <siyakapromise@gmail.com>
---------
Signed-off-by: PS Adavize <siyakapromise@gmail.com>
|
|
|
|
|
|
| |
This method should use the writing mode from the containing block,
not the one of the current style.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
| |
Adds support for min-content, max-content, fit-content and stretch,
for floated elements.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BoxFragment::new() had some logic to mark relative positioned boxes with
both insets in the same axis set to something different than `auto` as
overconstrained.
However, this was dead code, since overconstrainment is checked for
getComputedStyle queries, but not for relative positioning.
Also, the logic was wrong: it was detecting vertical overconstrainment
by checking `left` and `bottom` (instead of `top` and `bottom`).
So it can just be removed.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#33688)
* Avoid double negation in is_empty_for_empty_cells()
Signed-off-by: Taym <haddadi.taym@gmail.com>
* Remove more negation
Signed-off-by: Taym <haddadi.taym@gmail.com>
* Fix format
Signed-off-by: Taym <haddadi.taym@gmail.com>
---------
Signed-off-by: Taym <haddadi.taym@gmail.com>
|
|
|
|
|
| |
We need to handle `flex-wrap: wrap-reverse`.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
| |
Anonymous blocks have `height: auto`, so children with a percentage
`height` were considered to have an indefinite height.
However, anonymous blocks need to be skipped for percentage resolution,
so the percentages may actually be definite.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
| |
Improves the instrumentation to skip all function arguments and also add
spans for some layout modes. This is preparation for improving the
performance of flexbox.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
| |
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
After #33577, `get_outer_sizes_from_style()` is only used for column and
cell measures. For these it's expected to ignore sizing keywords like
`min-content`, so rename the function to `get_outer_sizes_for_measurement()`.
Additionally, both callers need the percentage contribution, so include
it in the returned tuple.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of a blocking a layout thread on the generation of WebRender
`FontKey`s and `FontInstanceKey`s, generate the keys ahead of time and
send the font data to WebRender asynchronously. This has the benefit of
allowing use of the font much more quickly in layout, though blocking
display list sending itself on the font data upload.
In order to make this work for web fonts, `FontContext` now asks the
`SystemFontService` for a `FontKey`s and `FontInstanceKey`s for new web
fonts. This should happen much more quickly as the `SystemFontService`
is only blocking in order to load system fonts into memory now. In
practice this still drops layout thread blocking to fractions of a
millisecond instead of multiple milliseconds as before.
In addition, ensure that we don't send font data or generate keys for
fonts that are used in layout but never added to display lists. This
should help to reduce memory usage and increase performance.
Performance of this change was verified by putting a microbenchmark
around `FontContext::create_font` which is what triggered font key
generation.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
CAPMIN is the largest min-content contribution of the table captions.
In Servo, the standard way to compute min/max-content contributions is
`outer_inline_content_sizes()`, so just use that instead of reinventing
the wheel.
This also fixes cyclic percentages to resolve consistently with normal
block boxes.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
| |
We already computed it as part of the row measure.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow callers to start obeying `min-content`, `max-content`,
`fit-content` and `stretch` in follow-up patches.
The old functionality is kept as deprecated methods that we should
eventually remove.
This patch has very little impact on the existing behavior, just some
very minimal implementation of the keywords for css tables.
This also overhauls fixed-layout-2.html since:
- It had code that wasn't doing anything
- It had wrong expecations in prose
- The logic seemed broken in general
- All browsers were failing one testcase
Signed-off-by: Oriol Brufau <obrufau@igalia.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>
|
|
|
|
|
| |
This information is already provided by `get_outer_sizes_from_style()`.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`components/layout_2020/query.rs`. (#33544)
* 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>
|
|
|
|
|
| |
And ensure that the minimum wins for malformed ContentSizes.
Signed-off-by: Oriol Brufau <obrufau@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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of `HTMLCanvasDataSource::Image(None)` (#33519)
* `HTMLCanvasDataSource::Empty` that represent transparent black instead of Image(None)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Fix warning from 3a0d27b2312c6396e85178615290ac2ec3592ce1
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
|
|
|
| |
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This is another step preparing for building Servo without `mach`.
Fixes #33430.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we encountered a preserved line break after some whitespace, we were
including the space in the max-content size of the following line.
So just like `line_break_opportunity()` was already clearing
`self.pending_whitespace.min_content`, `forced_line_break()` needs to
clear `self.pending_whitespace.max_content` too.
Also some cosmetic refactoring.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
| |
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
| |
We were only collapsing the borders from adjacent cells. This patch also
handles the borders from rows, row groups, columns, and column groups.
Additionally, it takes the border style into account in order to decide
which border wins.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
<col> and <colgroup> elements can be used to create extra columns that
have no cell. We were removing these columns and column groups, but in
general we shouldn't do that.
Now we will only remove them if the table has no row nor row group.
matching WebKit and the expectations of some tests. But note that Gecko
and Blink never remove them.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
| |
Bump Stylo to servo/stylo#75 and remove conversions that are no longer
necessary.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
|