Commit Graph

9 Commits

Author SHA1 Message Date
Andreas Kling
fe03149a47 LibWeb: Base Layout::TreeBuilder decisions on CSS display property
This is one of many small steps towards being able to remove the ad-hoc
Layout::Node::is_inline() in favor of honoring the CSS display value
everywhere instead.
2022-10-06 15:29:38 +02:00
Andreas Kling
1ab7a8e0db LibWeb: Simplify construction of :before and :after pseudo elements
Let create_pseudo_element_if_needed() take care of inserting the pseudo
elements into the layout tree as well.
2022-10-06 15:29:38 +02:00
Andreas Kling
4fdfaff4ca LibWeb: Split out helper functions in TreeBuilder::create_layout_tree()
Let's make this function a little easier to understand by splitting out
helpers into separate functions.
2022-10-06 15:29:38 +02:00
Andreas Kling
6712bbc0ee LibWeb: Tidy up Layout::TreeBuilder ancestor stack a little bit
- Make it a vector of references since we never put null pointers on
  the ancestor stack.

- Use Vector::in_reverse() to iterate backwards.
2022-04-13 19:52:25 +02:00
Ben Wiederhake
dee26ca5cd LibWeb: Add missing headers 2021-10-20 09:20:18 +01:00
Andreas Kling
85a0772147 LibWeb: Start work towards modern CSS "display" values
Until now, we've internally thought of the CSS "display" property as a
single-value property. In practice, "display" is a much more complex
property that comes in a number of configurations.

The most interesting one is the two-part format that describes the
outside and inside behavior of a box. Switching our own internal
representation towards this model will allow for much cleaner
abstractions around layout and the various formatting contexts.

Note that we don't *parse* two-part "display" yet, this is only about
changing the internal representation of the property.

Spec: https://drafts.csswg.org/css-display
2021-10-06 19:12:52 +02:00
K-Adam
e8d10fb429 LibWeb: Ignore svg elements outside of <svg> when building layout tree
An svg layout element without a `SVGSVGElement` ancestor caused a failed
assertion before, because the svg context does not exist when `paint()`
is called
2021-08-05 20:17:08 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00