aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/table/construct.rs
Commit message (Collapse)AuthorAgeFilesLines
* Don't trim leading whitespace of anonymous table cells (#31803)Oriol Brufau2024-03-211-8/+19
| | | | | | A sequence of whitespace shouldn't generate an anonymous table row/cell, but we can't just throw away the leading whitespace, because afterwards we may encounter some other content, and then the leading whitespace should appear in the cell (noticeable with e.g. `white-space: pre`).
* rustdoc: Correct unresolved link to `handle_cell. (#31708)Aarya Khandelwal2024-03-191-1/+1
|
* layout: Properly parent table-row and table-row-group (#31619)Martin Robinson2024-03-141-11/+21
| | | | | | | | Put table cell content fragments into a hieararchy of fragments that include their table row and table row group fragments. This ensures that things like relative positioning and transforms set on rows and row groups properly affect cells and cell content. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* clippy: Fix warnings in `components/layout_2020` (#31611)eri2024-03-111-2/+2
| | | | | * clippy: fix warnings in components/layout_2020 * fix: review comments
* layout: Do not inherit node and fragment flags in anonymous boxes (#31586)Martin Robinson2024-03-091-21/+22
| | | | | | | 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.
* layout: Fix the pseudo for anonymous tables (#31578)Martin Robinson2024-03-081-3/+1
| | | | | | | Anonymous tables should not use legacy pseudos, as the legacy layout engine had them inherit lots of random properites that lead to bad layout in the new layout engine. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Properly propagate text decoration values in tables (#31487)Martin Robinson2024-03-041-15/+28
| | | | Instead of just taking the value from the ancestor outside the table, combine the values when constructing the table.
* layout: Add support for table rows, columns, rowgroups and colgroups (#31341)Martin Robinson2024-02-201-21/+341
| | | | | | | | | | | | | | This adds support for table rows, columns, rowgroups and colgroups. There are few additions here: 1. The createion of fragments, which allows script queries and hit testing to work properly. These fragments are empty as all cells are still direct descendants of the table fragment. 2. Properly handling size information from tracks and track groups as well as frustrating rules about reordering rowgroups. 3. Painting a background seemlessly across track groups and groups. This is a thing that isn't done in legacy layout (nor WebKit)! Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Start work on table row height and vertical-align (#31246)Martin Robinson2024-02-101-1/+22
| | | | | | | | | This implements a very naive row height allocation approach. It has just enough to implement `vertical-align` in table cells. Rowspanned cells get enough space for their content, with the extra space necessary being allocated to the last row. There's still a lot missing here, including proper distribution of row height to rowspanned cells. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Lint layout_2020 with clippy (#31169)Oriol Brufau2024-01-251-13/+9
| | | cargo clippy --fix -p layout_2020 --allow-dirty --broken-code
* layout: Convert layout internal display to inline for replaced elements (#31133)Martin Robinson2024-01-231-1/+1
| | | | | | Replaced elements should never be able to have a layout internal display, according to the specification. This change makes it so that the used value of replaced element's display is always inline, as the specification says.
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-3/+3
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* layout: Add *very* basic support for table layout (#31121)Martin Robinson2024-01-191-14/+46
| | | | | | | | | | | | | | | | | | | | | * layout: Add *very* basic support for table layout This is the first step to proper table layout. It implements a naive layout algorithm, notably only taking into account the preferred widths of the first table row. Still, it causes some float tests to start passing, so turn on the `layout.tables.enabled` preference for those directories. Co-authored-by: Oriol Brufau <obrufau@igalia.com> * Address review comments * Fix a crash with rowspan=0 * Turn on pref and update results for `/css/css-tables` and `/css/CSS2/tables` --------- Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Add support for table fixups (#30868)Martin Robinson2023-12-221-39/+288
| | | | | | | | | | | | | | | | 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>
* Add initial support for table box tree construction (#30799)Martin Robinson2023-12-051-0/+439
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>