Martin Robinson
e563927718
Layout 2020: Move all Fragment code to the fragment_tree
directory
...
This is a simple code organization change with no behavior change with
the idea of making Layout 2020 easier to understand by new folks to the
project. The idea is that we will have a cleaner separation between the
different parts of layout ie one directory for the fragment tree and one
(currently multiple) directory for the box tree.
2023-06-04 18:12:11 +02:00
Pu Xingyu
4b73436684
layout_2020: Implement automatic minimum size of flex items
...
Implement the algorithm described in
https://drafts.csswg.org/css-flexbox/#min-size-auto .
2023-06-02 08:15:10 +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
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
01905923db
First pass at implementing the Flex Layout Algorithm
...
https://drafts.csswg.org/css-flexbox/#layout-algorithm
2020-06-23 00:41:27 +02:00
Simon Sapin
080f5bb763
An element establishing a formatting context *is* the containing block for its contents
2020-06-23 00:41:26 +02:00
Simon Sapin
51c388fe1c
Rename outer_inline* outside of sizing.rs to outer_inline_content_sizes*
2020-06-19 15:27:33 +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
b53959d23d
Move IndependentFormattingContext::as_replaced to IndependentFormattingContextContents
2020-06-15 18:09:15 +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
67d8aa84d2
Anonymous flex item for text directly in a flex container
2020-06-04 13:19:53 +02:00
Simon Sapin
64124f7a5e
Layout 2020 skeleton for display: flex
, behind a pref
2020-06-04 13:09:57 +02:00
Fernando Jiménez Moreno
17948f3b39
Propagate text decoration where needed
2020-03-23 11:13:10 +01:00
Anthony Ramine
c3932185ec
Make AbsolutelyPositionedBox be 'static
2020-03-17 11:15:17 -07:00
Fernando Jiménez Moreno
a042f85083
Dump box tree state into json files and display it on layout 2020 viewer
2020-02-21 11:11:00 +01:00
Anthony Ramine
abc2c15c28
Store an OpaqueNode in boxes and fragments
2019-12-13 17:59:27 +01:00
Anthony Ramine
47944a39fc
Remove the Node type parameter from Contents
...
We now pass the Node as an argument during DOM traversal in layout.
2019-12-13 17:51:06 +01:00
Simon Sapin
b43a3de51d
Introduce PositioningContext
2019-12-12 15:37:01 +01:00
Simon Sapin
80b2b5fb5e
Fix min/max-content of replaced boxes
2019-12-10 15:11:53 +01:00
Simon Sapin
bf96988260
Add min/max-width/height support for inline-block
...
(… and other non-replaced atomic inline-level boxes.)
2019-12-10 12:36:43 +01:00
Simon Sapin
dd9dfc66e3
Use a new BoxContentSizes
enum instead of Option<ContentSizes>
2019-12-04 15:36:05 +01:00
Simon Sapin
38e8fd1e99
Replace boolean parameters by a new ContentSizesRequest
enum
2019-12-04 15:10:11 +01:00
Simon Sapin
efa1885e1b
Remove IndependentFormattingContext::layout
...
Callers should handle replaced v.s. not separately
2019-12-03 15:11:35 +01:00
Simon Sapin
c056e5b6b0
Finish plumbing intrinsic min/max-content through box construction
2019-12-03 15:11:35 +01:00
Simon Sapin
cfdd23ac16
Add a request_content_sizes
parameter to IndependentFormattingContext::construct
2019-12-03 15:11:35 +01:00
Simon Sapin
4e6e31a76c
Pass a LayoutContext through box construction
2019-12-02 22:26:49 +01:00
Simon Sapin
aa925a5984
Un-allow and fix warnings in components/layout_2020
2019-12-02 16:32:34 +01:00
Anthony Ramine
5a360ac63d
Start supporting images in layout 2020
2019-12-01 10:56:33 +01:00
Anthony Ramine
858bc5aca6
Split FlowChildren in IndependentLayout and FlowLayout
...
The result of doing the layout of an independent formatting context
should be unconcerned with margin collapsing.
2019-11-26 16:36:24 +01:00
Simon Sapin
b2b3ea992c
Make IndependentFormattingContext a struct that owns styles
...
… and has a private enum for its contents.
Privacy forces the rest of the code to go through methods
rather than matching on the enum,
reducing accidental layout-mode-specific behavior.
2019-11-26 15:42:27 +01:00