Commit graph

14 commits

Author SHA1 Message Date
Delan Azabani
1b1f79305e
flex: handle ‘align-self: [ first | last ]? && baseline’ (#32787)
* flex: handle ‘align-self: baseline’

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* FIXME: css/css-flexbox/align-items-baseline-overflow-non-visible.html

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Fix baseline selection

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Fix baseline calculation with padding/border/margin

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Fix compile errors and warnings

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Implement ‘align-self: last baseline’

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Fix bug where non-baseline-aligned items affected max baseline

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Update expectations

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Rename method

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-18 07:03:29 +00:00
atbrakhi
a3bb8048fc
use au in inline (#32728)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2024-07-09 19:18:59 +00:00
石蕊 (Pi-Cla)
f29dd64a7b
Fix more clippy (#32740) 2024-07-09 04:47:43 +00:00
Martin Robinson
89944bd330
layout: Improve layout of table captions (#32695)
- Instead of treating captions as a `BlockFormattingContext`, treat it as
  a `NonReplacedFormattingContext`, which allows reusing flow layout for
  captions -- fixing some issues with sizing.
- Pass in the proper size of the containing block when laying out,
  fixing margin calculation.
- Follow the unspecified rules about how various size properties on
  captions affect their size.
- Improve linebreaking around atomics, which is tested by
  caption-related tests. This fixes intrinsic size calculation regarding
  soft wrap opportunities around atomic and also makes the code making
  these actual soft wrap opportunities a bit better.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-08 12:58:38 +00:00
Martin Robinson
4e79ac5701
layout: Allow rendering LineItems independent of inline box (#32666)
Refactor inline layout to allow rendering line items in the second stage
to be rendered in any order, independent of their parent inline box.
This will allow line items to be reordered, effectively allowing the
splitting of inline boxes, for the purposes of BiDi and any other inline
reordering feature.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-07-03 15:15:31 +00:00
atbrakhi
044ab3eeab
fix clippy warning (#32667) 2024-07-02 14:59:46 +00:00
Martin Robinson
adc0fc984d
layout: Make geom.rs logical geoemetry types more ergonomic (#32633)
Make using the logical geometry types more ergonomic by having them all
implement `Copy` (at most 4 64-bit numbers), similar to what `euclid`
does. In addition add an implementation of `Neg` for `LogicalVec` and
`LogicalSides` as it will be used in upcoming table implementation code.
2024-06-28 08:20:50 +00:00
atbrakhi
26c585a0c5
use app unit in box_fragement (#32349) 2024-06-21 14:54:21 +00:00
Martin Robinson
44064b1439
layout: Add very basic support for showing text in input boxes (#32365)
This only paints text in input fields. Selection and cursor are still
not painted.

In addition to adding this feature, the change also updates the
user-agent.css with the latest from the HTML specification. Extra
padding and extraneous settings (such as a bogus line-height and
min-height) are also removed from servo.css. This leads to some new
passes.

There are some new passes, this introduces failures as inserting text
reveals issues that were hidden before. Notably:

- failures in `/html/editing/editing-0/spelling-and-grammar-checking/`:
  We do not support spell-checking.
- Most of the rest of the new failures are missing features of input
  boxes that are also missing in legacy layout.
2024-06-20 10:13:50 +00:00
Martin Robinson
cd2ab36759
Rename gfx to fonts (#32556)
This crate only takes care of fonts now as graphics related things are
split into other crates. In addition, this exposes data structures at
the top of the crate, hiding the implementation details and making it
simpler to import them.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-19 20:26:19 +00:00
Martin Robinson
e74075255b
layout: Flatten inline box storage in InlineFormattingContexts (#32539)
This accomplishes two things:

1. Makes it easier to iterate through all inline formatting context
   items.
2. Will make it possible to easily move back and forth through the tree
   of inline boxes, in order to enable reordering and splitting inline
   boxes on lines -- necessary for BiDi.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-19 08:51:10 +00:00
Martin Robinson
70982dfa5a
layout: Allocate inline box start space on segment (#32486)
Instead of allocating the inline padding and border space on the line,
allocate it on the segment -- which where the inline box start goes.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-18 16:19:00 +00:00
Martin Robinson
bae9f6d844
layout: Linebreak the entire InlineFormattingContext at once (#32483)
Instead of linebreaking inside each single-font text segment, linebreak
the entire inline formatting context at once. This has several benefits:

1. It allows us to use `icu_segmenter` (already in use from style),
   which is written against a newer version of the Unicode spec --
   preventing breaking emoji clusters.
2. Opens up the possibility of changing the way that linebreaking and
   shaping work -- eventually allowing shaping across inline box
   boundaries and line breaking *after* shaping.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-13 20:12:14 +00:00
Martin Robinson
48ab8d8847
layout: Add a InlineFormattingContextBuilder (#32415)
The main change here is that collapsed and `text-transform`'d text is
computed as it's processed by DOM traversal. This single transformed
text is stored in the root of the `InlineFormattingContext`.

This will eventually allow performing linebreaking and shaping of the
entire inline formatting context at once. Allowing for intelligent
processing of linebreaking and also shaping across elements. This
matches more closely what LayoutNG does.

This shouldn't have any (or negligable) behavioral changes, but will
allow us to prevent linebreaking inside of clusters in a followup
change.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-03 14:46:53 +00:00
Renamed from components/layout_2020/flow/inline.rs (Browse further)