Commit graph

80 commits

Author SHA1 Message Date
Simon Wülker
3d320fa96a
Update rustfmt to the 2024 style edition (#35764)
* Use 2024 style edition

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reformat all code

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-03 11:26:53 +00:00
Euclid Ye
28cea920ec
layout: Merge BoxFragment::used_overflow into ComputedValuesExt::effective_overflow (#35670) (#35670)
* Update wpt-test



* Merge used_overflow to effective_overflow; remove duplicate call



* Remove more duplicate calls; update effective_overflow logic



* Update reference link&style



* Apply final review suggestions

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-03-02 21:44:59 +00:00
Martin Robinson
6b04bc6263
layout: Take percentage columns into account when sizing table grid min and max (#35167)
The specification doesn't say how to deal with percentages when
determining the minimum and maximum size of a table grid, so follow the
approach that Chromium uses.

Essentially, figure out the "missing" percentage from the non-percentage
columns and then use that to work backwards to fine the size of the
percentage ones.

This change is larger than one might expect, because this percentage
approach shouldn't happen for tables that are descendants of a flex,
grid or table container (except when there is an interceding absolute).
We have to pass this information down when building the box tree. This
will also make it easier to improve propagated text decorations in the
future.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-01-27 15:04:37 +00:00
Oriol Brufau
41e3c321e5
Make sure to cache inline_content_sizes() (#34586)
The refactoring in 264c0f972f stopped
caching the `inline_content_sizes()` calls from:
- `FlexItemBox::layout_for_block_content_size()`
- `IndependentFormattingContext::layout_float_or_atomic_inline()`
- `TaffyContainerContext::compute_child_layout()`

Also, the call from `OutsideMarker::layout()` was never cached.

This patch caches all of them.

It's not clear at all which `inline_content_sizes()` are cached and
which aren't, so I plan to improve the situation in a follow-up.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-12-12 01:37:05 +00:00
Martin Robinson
9d11d584f6
layout: Clean up inline layout data types a bit (#34563)
- Remove the `LayoutBox::InlineBox` variant that was only used for
  inline level boxes. Now they are stored in `LayoutBox::InlineLevel`
  along with other kinds of out-of-flow and atomic inline items.
- Reduce the size of `InlineItem` by 260 bytes per item by using atomic
  indirection / pointers. This adds a bit of overhead to access items in
  exchange for a lot of memory saved.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-12-11 14:40:34 +00:00
Martin Robinson
f5fdbd70d0
layout: Have SameFormattingContextBlock be a LayoutBoxBase (#34530)
This allows `SameFormattingContextBlock` to cache inline content sizes
and will eventually allow it to participate in incremental layout.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-09 06:57:15 +00:00
Martin Robinson
56280c6242
layout: Add initial support for bidirectional text (BiDi) (#33148)
This adds supports for right-to-left text assigning bidi levels to all
line items when necessary. This includes support for the `dir` attribute
as well as corresponding CSS properties like `unicode-bidi`. It only
implements right-to-left rendering for inline layout at the moment and
doesn't include support for `dir=auto`. Because of missing features,
this causes quite a few tests to start failing, as references become
incorrect due to right-to-left rendering being active in some cases,
but not others (before it didn't exist at all).

Analysis of most of the new failures:

```
- /css/css-flexbox/gap-001-rtl.html
  /css/css-flexbox/gap-004-rtl.html
 - Require implementing BiDi in Flexbox, because the start and
   end inline margins are opposite the order of items.

- /css/CSS2/bidi-text/direction-applies-to-*.xht
  /css/CSS2/bidi-text/direction-applies-to-002.xht
  /css/CSS2/bidi-text/direction-applies-to-003.xht
  /css/CSS2/bidi-text/direction-applies-to-004.xht
  - Broken due to a bug in tables, not allocating the
    right amount of width for a column.

- /css/css-lists/inline-list.html
  - This fails because we wrongly insert a soft wrap opportunity between the
    start of an inline box and its first content.

- /css/css-text/bidi/bidi-lines-001.html
  /css/css-text/bidi/bidi-lines-002.html
  /css/CSS2/text/bidi-flag-emoji.html
  - We do not fully support unicode-bidi: plaintext

- /css/css-text/text-align/text-align-end-010.html
  /css/css-text/text-align/text-align-justify-006.html
  /css/css-text/text-align/text-align-start-010.html
  /html/dom/elements/global-attributes/*
  - We do not support dir=auto yet.

- /css/css-text/white-space/tab-bidi-001.html
  - Servo doesn't support tab stops

- /css/CSS2/positioning/abspos-block-level-001.html
  /css/css-text/word-break/word-break-normal-ar-000.html
  - Do not yet support RTL layout in block

- /css/css-text/white-space/pre-wrap-018.html
  - Even in RTL contexts, spaces at the end of the line must hang and
    not be reordered

- /css/css-text/white-space/trailing-space-and-text-alignment-rtl-002.html
  - We are letting spaces hang with white-space: pre, but they shouldn't
    hang.
```

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-08-21 14:28:54 +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
Martin Robinson
66edef8065
layout: Simplify Contents a little (#32487)
Instead of duplicating some of `NonReplacedContents` in `Contents`,
divide it into either replaced and non-replaced content, since this is
how the layout system processes `Contents` always. In addition, stop
using `TryInto` to match replaced or non-replaced contents, as it is
quite confusing to handle an `Err` as a success case.
2024-06-21 10:13:31 +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
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
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
Martin Robinson
f68a2e7743
layout: Ensure empty list items are at least as tall as outside markers (#32152)
While <https://drafts.csswg.org/css-lists/#list-style-position-property> says:

> The size or contents of the marker box may affect the height of the
> principal block box and/or the height of its first line box, and in some
> cases may cause the creation of a new line box; this interaction is also
> not defined.

All other browsers ensure that the first line of list item content is
the same block size as the marker. Doing this is complicated, but we can
ensure that the entire list item is at least as tall as the marker. This
should handle the majority of cases and we can make refinements later
for stranger situations, such as when the marker is very tall.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-04-29 16:58:14 +00:00
Martin Robinson
97376e6d96
layout: Add a basic support for list-style-position: outside (#32114)
This change adds very basic support for `list-style-position`.
Currently, the marker does not do any kind of baseline alignment with
the rest
of the list item contents and it also doesn't force the list item to be
at least as tall as the marker.

This adds a few new failures:

- Four failures because markers do not ensure that list-items have at
least the same block size as they do:
  - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-012.xht
  - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-014.xht
- FAIL [expected PASS]
/css/CSS2/lists/list-style-type-applies-to-012.xht
- FAIL [expected PASS]
/css/CSS2/lists/list-style-type-applies-to-014.xht
- One failure because we don't yet support the `::marker`
pseudo-selector:
- FAIL [expected PASS]
/css/css-position/position-absolute-dynamic-list-marker.html
- One failure because we don't support the list item exception for the
line height quirk:
  - FAIL [expected PASS] /quirks/line-height-in-list-item.tentative.html

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

<!-- Please describe your changes on the following line: -->

Fixes #27383.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #27383.
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-04-22 14:23:35 +00:00
Oriol Brufau
0e78c8114b
Allow finishing anonymous inline-table at the end of inline elements (#31650)
This avoids inserting it outside of its parent.
2024-03-14 09:58:00 +00:00
Oriol Brufau
f3a73dbed3
End ongoing IFC when inserting anonymous block-level table (#31606)
So that the table appears after preceding inline-level contents.
Fixes #31603.
2024-03-13 21:03:06 +00:00
eri
b03411f567
clippy: Fix warnings in components/layout_2020 (#31611)
* clippy: fix warnings in components/layout_2020

* fix: review comments
2024-03-11 14:24:33 +00:00
Martin Robinson
1f23ec2b27
layout: Do not inherit node and fragment flags in anonymous boxes (#31586)
This doesn't really have observable behavior right now, as much as I
tried to trigger some kind of bug. On the other hand, it's just wrong
and is very obvious when you dump the Fragment tree. If you create a
`display: table-cell` that is a child of the `<body>` all parts of the
anonymous table are flagged as if they are the `<body>` element.
2024-03-09 09:13:19 +00:00
Martin Robinson
6d73832009
layout: Do whitespace collapse during breaking and shaping (#31322)
This moves white space collapse to right before breaking and shaping
happens, which is more similar to what happens in legacy layout. This is
the first step toward making this procedure more efficient (avoiding
string copies) and also implementing support for `text-transform`.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-02-13 23:08:00 +00:00
Martin Robinson
cdc3c369f0
layout: Implement support for font fallback (#31254)
This adds an initial implementation of font fallback, on part with the
one used in legacy layout. There are still issues. For instance, font
matching is done per unicode character rather than based on graphemes or
the shape first approach of Chrome. The idea is that these changes can
be made later.
2024-02-11 10:08:49 +00:00
Martin Robinson
094f7845b1
layout: Shape text only once (#31146)
Shape text during InlineFormattingContext construction rather than doing
it twice during fragment tree construction. This is a step on the way
toward proper font fallback.

This also moves all `TextRun` related code into `text_run.rs` to try to
trim down the size of `inline.rs`.
<!-- Please describe your changes on the following line: -->


---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because this should only have
performance impacts.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->
2024-01-25 14:33:47 +00:00
Oriol Brufau
50f56affe3
Lint layout_2020 with clippy (#31169)
cargo clippy --fix -p layout_2020 --allow-dirty --broken-code
2024-01-25 09:03:31 +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
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
Martin Robinson
95e32f8372
Make LineItems a token stream on the root (#30608)
Flattening the LineItem tree into a token stream will allow for handling
the case where an unbreakable line segment spans multiple inline boxes
which might have different hierarchies. This change also fixes the
handling of the second anonymous fragment of a block-in-inline-split.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-10-25 15:54:44 +00:00
Martin Robinson
fd31da9102
Anonymous boxes that wrap inlines should not inherit overflow (#30579)
In legacy layout, anonymous text wrappers were inheriting the `overflow`
and `text-overflow` properties. This results in the creation of extra
clipping for these anonymous wrappers which could clip away floats. We
will likely implement `text-overflow` differently in non-legacy layout.

This change marks all legacy layout pseudo elements as "legacy" and also
adds a new pseudo element for non-legacy layout that does not inherit
`overflow`.

Fixes #30562.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2023-10-19 13:43:55 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Atbrakhi
2b67392fd5
Add initial support for css-text-3 whitespace handling (#29828)
* Add initial support for css-text-3 whitespace handling

This adds initial support for whitespace handling from the CSS
specification for Layout 2020. In general, the basics are covered. Since
test output is very sensitive to whitespace handling, this change
incorporates several fixes:

1. Whitespace is collapsed according to the Phase 1 rules of the
   specification, though language-specific unbreaking rules are not
   handled properly yet.
2. Whitespace is mostly trimmed and positioned according to the Phase 2
   rules, but full support for removing whitespace at the end of lines
   is pending on a temporary data structure to hold lines under
   construction.
3. Completely empty box fragments left over immediately after line
   breaks are now trimmed from the fragment tree.
4. This change tries to detect when an inline formatting context
   collapses through.

Fixes #29994.

Co-authored-by: Mukilan Thiyagarajan <me@mukilan.in>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* Update test results

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <me@mukilan.in>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-07-20 18:34:31 +00:00
Martin Robinson
4f4c2a5922
Remove rayon_croissant and clean up contains_floats (#29960)
Remove rayon_croissant and refactor the way that information about
floats in flows bubbles up. This simplifies the code a good deal and
lets us take advantage of some more optimized functions provided by
rayon. This removes 2 crates from the dependency tree.

In addition, this allows avoiding passing `contains_floats` up from
every box tree construction function. This makes things simpler, but
also opens up the possibility of passing more of these flags up in the
future (such as `contains_counters`).
2023-07-19 07:01:55 +00:00
Pu Xingyu
5c71219819 layout_2020: Check blocks for whether they will establish a formatting context 2023-05-31 23:28:28 +08:00
Martin Robinson
72b5fcd0b6 Combine DOM-related concepts in Layout 2020 into dom.rs 2023-05-13 11:52:59 +02:00
Martin Robinson
72302e2dae Detect body elements during layout
During layout it is often useful, for various specification reasons, to
know if an element is the `<body>` element of an `<html>` element root. There
are a couple places where a brittle heuristic is used to detect `<body>`
elements. This information is going to be even more important to
properly handle `<html>` elements that inherit their overflow property from
their `<body>` children.

Implementing this properly requires updating the DOM wrapper interface.
This check does reach up to the parent of thread-safe nodes, but this is
essentially the same kind of operation that `parent_style()` does, so is
ostensibly safe.

This change should not change any behavior and is just a preparation
step for properly handle `<body>` overflow.
2023-05-04 10:46:27 +02:00
Oriol Brufau
2692426103 Fix text-decoration for block containers in layout-2020
It was only applied to the 1st inline formatting context of a block
container. Other IFCs were created with the Default trait, implying
TextDecorationLine::NONE.
2023-04-26 20:44:01 +02:00
Oriol Brufau
c842023741 Support text-indent in layout-2020
Existing WPT now passing:
  - _mozilla/css/text_indent_a.html
  - css/CSS2/css1/c71-fwd-parsing-002.xht
  - css/CSS2/css1/c71-fwd-parsing-004.xht
  - css/CSS2/floats-clear/floats-138.xht
  - css/CSS2/text/text-indent-007.xht
  - css/CSS2/text/text-indent-008.xht
  - css/CSS2/text/text-indent-010.xht
  - css/CSS2/text/text-indent-019.xht
  - css/CSS2/text/text-indent-020.xht
  - css/CSS2/text/text-indent-031.xht
  - css/CSS2/text/text-indent-032.xht
  - css/CSS2/text/text-indent-043.xht
  - css/CSS2/text/text-indent-044.xht
  - css/CSS2/text/text-indent-055.xht
  - css/CSS2/text/text-indent-056.xht
  - css/CSS2/text/text-indent-067.xht
  - css/CSS2/text/text-indent-068.xht
  - css/CSS2/text/text-indent-079.xht
  - css/CSS2/text/text-indent-080.xht
  - css/CSS2/text/text-indent-091.xht
  - css/CSS2/text/text-indent-092.xht
  - css/CSS2/text/text-indent-103.xht
  - css/CSS2/text/text-indent-104.xht
  - css/CSS2/text/text-indent-112.xht
  - css/CSS2/text/text-indent-113.xht
  - css/CSS2/text/text-indent-115.xht
  - css/CSS2/text/text-indent-applies-to-002.xht
  - css/CSS2/text/text-indent-applies-to-003.xht
  - css/CSS2/text/text-indent-applies-to-005.xht
  - css/CSS2/text/text-indent-applies-to-006.xht
  - css/CSS2/text/text-indent-applies-to-007.xht
  - css/CSS2/text/text-indent-applies-to-008.xht
  - css/CSS2/text/text-indent-applies-to-009.xht
  - css/CSS2/text/text-indent-applies-to-010.xht
  - css/CSS2/text/text-indent-applies-to-011.xht
  - css/CSS2/text/text-indent-applies-to-014.xht
  - css/CSS2/text/text-indent-applies-to-015.xht
  - css/CSS2/text/text-indent-inherited-001.xht
  - css/CSS2/text/text-indent-overflow-001.xht
  - css/CSS2/text/text-indent-overflow-002.xht
  - css/CSS2/text/text-indent-overflow-003.xht
  - css/CSS2/text/text-indent-overflow-004.xht
  - css/CSS2/text/text-indent-wrap-001.xht
  - css/css-text-decor/text-shadow/textindent.html
  - css/css-text/text-indent/text-indent-percentage-001.xht
  - css/css-text/text-indent/text-indent-percentage-002.html
  - css/css-text/text-indent/text-indent-percentage-003.html
  - css/css-text/text-indent/text-indent-percentage-004.html
  - css/css-values/minmax-length-percent-serialize.html
  - css/css-values/minmax-length-serialize.html

Also improvements in:
  - _mozilla/mozilla/calc.html
  - css/css-text/animations/text-indent-interpolation.html
  - css/css-text/inheritance.html
  - css/css-text/parsing/text-indent-computed.html
  - css/css-text/parsing/text-indent-valid.html
  - css/css-transitions/properties-value-implicit-001.html
  - css/css-values/animations/calc-interpolation.html
  - css/css-values/minmax-percentage-serialize.html
  - css/css-values/viewport-units-css2-001.html
  - css/css-variables/variable-substitution-basic.html
  - css/cssom/serialize-values.html

Existing WPT now failing, due to lack of direction, outside list markers,
flex and grid:
  - css/CSS2/text/text-indent-rtl-001.xht
  - css/CSS2/text/text-indent-rtl-002.xht
  - css/css-pseudo/marker-content-023.html
  - css/css-text/text-indent/anonymous-flex-item-001.html
  - css/css-text/text-indent/anonymous-grid-item-001.html

New WPT tests:
 - css/css-text/text-indent/text-indent-length-001.html
 - css/css-text/text-indent/text-indent-length-002.html
   This one fails in layout-2013.
2023-04-25 23:01:07 +02:00
Josh Matthews
260347e5dc Simplify control flow of whitespace handling. 2020-07-27 20:06:55 -04:00
Josh Matthews
d8b4dab4e3 Implement basic white-space: pre support for layout 2020. 2020-07-27 20:06:53 -04:00
Simon Sapin
b91e293819 Add layout support for list markers 2020-07-24 09:31:24 +02:00
Simon Sapin
82e274aec9 Make a bool for display: list-item available to flow box construction 2020-07-23 16:43:57 +02:00
Simon Sapin
5fed956d65 Remove the now single-field Accumulator struct 2020-06-19 15:30:23 +02:00
Anthony Ramine
235df94f2e Compute content sizes lazily in layout 2020 2020-06-18 14:11:02 +02:00
Anthony Ramine
db80b8e3c1 Make IndependentFormattingContext an enum 2020-06-15 18:09:15 +02:00
Anthony Ramine
07d8c28d4a Make outer_inline and outer_inline_and_percentages free functions
They now take a closure that will compute the content sizes on demand.
2020-06-15 18:09:15 +02:00
Simon Sapin
08f008a011 Use the writing mode of the containing block when accessing CSS properties
… and converting them to flow-relative geometric values.

These values are almost always used to size and position a fragment within its containing block, so using the mode of the containing block seems more correct.

Note that the `writing-mode` and `direction` properties are disabled in Servo at the moment, so this PR by itself should have no effect: the writing mode of an element is always the same of that of its containing block since they’re both horizontal rtl.
2020-06-10 09:03:18 +02:00
Anthony Ramine
e975d24c4b Store abspos boxes in a RefCell too
We want to mutate them when lazily computing their content sizes, but they
are behind an Arc for the hoisting infra, so it also needs its own layer
of inner mutability.
2020-06-09 15:13:18 +02:00
Martin Robinson
89855afa4d layout_2020: Tag fragments with their pseudo content type
This will allow us to answer queries and properly handle animations in
the future for fragments generated for pseudo content.
2020-06-06 17:25:08 +02:00
Simon Sapin
fff5cd5142 Owned ServoArc<ComputedValues> in TraversalHandler 2020-06-04 13:19:53 +02:00
Simon Sapin
67d8aa84d2 Anonymous flex item for text directly in a flex container 2020-06-04 13:19:53 +02:00
Anthony Ramine
6fe294fa5b Make LayoutNodeHelpers::text_content return a cow 2020-03-31 15:02:13 +02:00
Fernando Jiménez Moreno
17948f3b39 Propagate text decoration where needed 2020-03-23 11:13:10 +01:00
Patrick Walton
0d6c60f03e Make whitespace preservation computation recursive in order to fix lifetime issues 2020-03-17 20:13:57 -07:00