aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/construct.rs
Commit message (Collapse)AuthorAgeFilesLines
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-9/+11
| | | | | * strict imports formatting * Reformat all imports
* Add initial support for css-text-3 whitespace handling (#29828)Atbrakhi2023-07-201-153/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Remove rayon_croissant and clean up `contains_floats` (#29960)Martin Robinson2023-07-191-80/+39
| | | | | | | | | | | 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`).
* layout_2020: Check blocks for whether they will establish a formatting contextPu Xingyu2023-05-311-2/+4
|
* Combine DOM-related concepts in Layout 2020 into dom.rsMartin Robinson2023-05-131-4/+2
|
* Detect body elements during layoutMartin Robinson2023-05-041-5/+4
| | | | | | | | | | | | | | | | | 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.
* Fix text-decoration for block containers in layout-2020Oriol Brufau2023-04-261-3/+6
| | | | | | 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.
* Support text-indent in layout-2020Oriol Brufau2023-04-251-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Simplify control flow of whitespace handling.Josh Matthews2020-07-271-60/+78
|
* Implement basic white-space: pre support for layout 2020.Josh Matthews2020-07-271-14/+37
|
* Add layout support for list markersSimon Sapin2020-07-241-2/+45
|
* Make a bool for `display: list-item` available to flow box constructionSimon Sapin2020-07-231-10/+45
|
* Remove the now single-field `Accumulator` structSimon Sapin2020-06-191-15/+7
|
* Compute content sizes lazily in layout 2020Anthony Ramine2020-06-181-107/+16
|
* Make IndependentFormattingContext an enumAnthony Ramine2020-06-151-4/+4
|
* Make outer_inline and outer_inline_and_percentages free functionsAnthony Ramine2020-06-151-11/+11
| | | | They now take a closure that will compute the content sizes on demand.
* Use the writing mode of the containing block when accessing CSS propertiesSimon Sapin2020-06-101-5/+30
| | | | | | | | … 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.
* Store abspos boxes in a RefCell tooAnthony Ramine2020-06-091-6/+12
| | | | | | 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.
* layout_2020: Tag fragments with their pseudo content typeMartin Robinson2020-06-061-99/+70
| | | | | This will allow us to answer queries and properly handle animations in the future for fragments generated for pseudo content.
* Owned `ServoArc<ComputedValues>` in `TraversalHandler`Simon Sapin2020-06-041-19/+9
|
* Anonymous flex item for text directly in a flex containerSimon Sapin2020-06-041-0/+24
|
* Make LayoutNodeHelpers::text_content return a cowAnthony Ramine2020-03-311-1/+7
|
* Propagate text decoration where neededFernando Jiménez Moreno2020-03-231-7/+35
|
* Make whitespace preservation computation recursive in order to fix lifetime ↵Patrick Walton2020-03-171-25/+45
| | | | issues
* Wrap `BlockLevelBox` and `InlineLevelBox` with `AtomicRefCell`Patrick Walton2020-03-171-72/+72
|
* Make AbsolutelyPositionedBox be 'staticAnthony Ramine2020-03-171-4/+4
|
* Store an OpaqueNode in boxes and fragmentsAnthony Ramine2019-12-131-3/+9
|
* Remove the Node type parameter from ContentsAnthony Ramine2019-12-131-32/+72
| | | | We now pass the Node as an argument during DOM traversal in layout.
* Introduce BlockLevelJobAnthony Ramine2019-12-131-55/+64
|
* Upgrade rayon_croissant to 0.2.0Simon Sapin2019-12-121-15/+15
|
* Disable use of rayon with `--layout-threads 1` instead of panickingSimon Sapin2019-12-101-23/+31
|
* Fix a “Accessing content size that was not requested” panicSimon Sapin2019-12-101-3/+3
| | | | | | Percentage `width` are treated as `auto` for the purpose of min/max-content computation, so they also need to be considered when testing “wether width is auto”
* Use a new `BoxContentSizes` enum instead of `Option<ContentSizes>`Simon Sapin2019-12-041-18/+13
|
* Replace boolean parameters by a new `ContentSizesRequest` enumSimon Sapin2019-12-041-47/+44
|
* Review nitsSimon Sapin2019-12-041-2/+1
|
* Finish plumbing intrinsic min/max-content through box constructionSimon Sapin2019-12-031-22/+46
|
* Add box construction for 'inline-block'…Simon Sapin2019-12-031-29/+27
| | | | … and other atomic inline-level boxes.
* Add content sizes computation for block containersSimon Sapin2019-12-031-20/+52
|
* Add a `Target` struct for `mapfold_reduce_into` callSimon Sapin2019-12-031-17/+21
|
* Add a `request_content_sizes` parameter to ↵Simon Sapin2019-12-031-34/+19
| | | | `IndependentFormattingContext::construct`
* Pass a LayoutContext through box constructionSimon Sapin2019-12-021-11/+12
|
* Add intrinsic size computation for inline formatting contextsSimon Sapin2019-12-021-0/+1
|
* Make InlineLevelBox::Atomic store an IndependentFormattingContextAnthony Ramine2019-12-011-4/+8
|
* Fix an unimplemented in layout 2020Anthony Ramine2019-12-011-1/+1
|
* Use std::mem::take instead of defining itSimon Sapin2019-11-261-3/+2
|
* Make IndependentFormattingContext a struct that owns stylesSimon Sapin2019-11-261-14/+10
| | | | | | | | … 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.
* 2020: define DisplayInside and DisplayOutside enums separately from StyloSimon Sapin2019-10-241-2/+0
|
* Handle inline-block as block for now in layout 2020Anthony Ramine2019-10-111-5/+3
| | | | That makes Servo not panic when loading servo.org.
* Remove a wrong assertionAnthony Ramine2019-10-081-5/+0
|
* Handle anonymous style in end_inline_formatting_contextAnthony Ramine2019-09-231-15/+19
|