aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* make ContainingBlock use Au for inline_size and block_size (#31370)atbrakhi2024-02-201-5/+5
|
* make size of DefiniteContainingBlock use app units (#31369)atbrakhi2024-02-171-3/+4
|
* Compile Servo with the latest version of rust stable (#30831)Martin Robinson2023-12-061-1/+0
| | | | | | | | | | | | | | | | This completes the transition to compiling Servo with rust stable. Some nightly-only features are still used when compiling the `script` and `crown` crates, as well as for some style unit tests. These will likely break with newer compiler versions, but `crown` can be disabled for them conditionally. This is just the first step. This has some caveats: 1. We need to disable setting up the special linker on Linux. The -Z option isn't supported with stable rust so using this is out -- meanwhile we can't be sure that lld is installed on most systems. 2. `cargo fmt` still uses some unstable options, so we need to rely on the unstable toolchain just for running `fmt`. The idea is to fix this gradually.
* Add initial support for table box tree construction (#30799)Martin Robinson2023-12-051-0/+1
| | | | | | | | | | | | 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>
* Layout 2020: Rename `flow_relative` types to `Logical...` (#30324)Martin Robinson2023-09-121-2/+2
| | | | | | This makes the names of flow relative geometry consistent with what is used in the style crate and removes them from a module. With this change it's more obvious what makes these types different from the ones in `euclid`.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-2/+2
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-5/+0
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Use std::cell::OnceCell and remove mitochondria dependency (#30207)Martin Robinson2023-08-251-0/+1
| | | | | `OnceCell` is now part of the standard library and we'll be able to use it once we upgrade rust. For now we can use the version that's shipped behind a feature flag in rust. This removes a dependency on one crate.
* Layout 2020: Move all Fragment code to the `fragment_tree` directoryMartin Robinson2023-06-041-2/+2
| | | | | | | | 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.
* Combine DOM-related concepts in Layout 2020 into dom.rsMartin Robinson2023-05-131-4/+1
|
* Detect body elements during layoutMartin Robinson2023-05-041-0/+1
| | | | | | | | | | | | | | | | | 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.
* Add layout support for list markersSimon Sapin2020-07-241-0/+1
|
* Add an implementation of the core float and clear placement logic in layoutPatrick Walton2020-07-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2020, not yet wired to the rest of layout. This commit implements an object that handles the 10 rules in CSS 2.1: https://www.w3.org/TR/CSS2/visuren.html#float-position The implementation strategy is that of a persistent balanced binary search tree of float bands. Binary search trees are commonly used for implementing float positioning; e.g. by WebKit. Persistence enables each object that interacts with floats to efficiently contain a snapshot of the float list at the time that object was laid out. That way, incremental layout can invalidate and start reflow at any point in a containing block. This commit features extensive use of [QuickCheck](https://github.com/BurntSushi/quickcheck) to ensure that the rules of the CSS specification are followed. Because this is not yet connected to layout, floats will not actually be laid out in Web pages yet. Note that unit tests as set up in Servo currently require types that they access to be public. Therefore, some internal layout 2020 types that were previously private have been made public. This is somewhat unfortunate. Part of #25167.
* Layout 2020 skeleton for `display: flex`, behind a prefSimon Sapin2020-06-041-0/+1
|
* Rename BoxTreeRoot/FragmentTreeRoot to BoxTree/FragmentTreeSimon Sapin2020-05-151-1/+1
|
* layout_2020: Add initial support for getComputedStyleMartin Robinson2020-05-111-0/+2
| | | | | | | This implementation is more-or-less on par with the one from layout_2013 and in some cases better. There are still some cases where we don't return the correct "resolved value," but this is enough to test animations and transitions.
* Remove use of some other unstable featuresSimon Sapin2020-04-151-2/+0
|
* Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutDataAnthony Ramine2020-04-061-1/+1
|
* layout_2020: Stop throwing away hoisted boxes in nested absolutesMartin Robinson2020-03-271-2/+0
| | | | | | | We were previously throwing away some boxes hoisted to containing blocks for all descendants when they were contained by absolutes. This prevents panics in existing web platform tests that would otherwise be triggered by the addition of the `unreachable!` statement.
* Add an `ArcRefCell<T>` typePatrick Walton2020-03-171-0/+1
|
* Make AbsolutelyPositionedBox be 'staticAnthony Ramine2020-03-171-0/+1
|
* layout_2020: Paint hoisted positioned fragments in tree orderMartin Robinson2020-03-111-0/+2
| | | | | | | | | | | | | | | | | | | Instead of painting hoisted position fragments in the order to which they are hoisted, paint them in tree order and properly incorporate them into the stacking context. We do this by creating a placeholder fragment in the original tree position of hoisted fragments. The ghost fragment contains an atomic id which links back to the hoisted fragment in the containing block. While building the stacking context, we keep track of containing blocks and their children. When encountering a placeholder fragment we look at the containing block's hoisted children in order to properly paint the hoisted fragment. One notable design modification in this change is that hoisted fragments no longer need an AnonymousFragment as their parent. Instead they are now direct children of the fragment that establishes their containing block.
* Add layout debugger support to layout_2020Fernando Jiménez Moreno2020-02-211-0/+5
|
* Upgrade to rustc 1.42.0-nightly (3291ae339 2020-01-15)Simon Sapin2020-01-161-1/+0
|
* Make `for_maybe_position_relative` take care of relative adjustment.Simon Sapin2019-12-131-30/+0
|
* impl From<&'_ DefiniteContainingBlock> for ContainingBlockSimon Sapin2019-12-101-0/+10
|
* Containing blocks contains styles rather than just a writing modeSimon Sapin2019-12-071-5/+4
|
* Use the WritingMode bitflags from StyloSimon Sapin2019-12-071-3/+5
|
* Add inline_size_is_autoSimon Sapin2019-12-031-0/+1
|
* Rename IntrinsicSizes to ContentSizesSimon Sapin2019-12-031-1/+1
|
* Add intrinsic size computation for inline formatting contextsSimon Sapin2019-12-021-0/+1
|
* Un-allow and fix warnings in `components/layout_2020`Simon Sapin2019-12-021-15/+1
|
* Split FlowChildren in IndependentLayout and FlowLayoutAnthony Ramine2019-11-261-1/+1
| | | | | The result of doing the layout of an independent formatting context should be unconcerned with margin collapsing.
* Use std::mem::take instead of defining itSimon Sapin2019-11-261-9/+0
|
* Make IndependentFormattingContext a struct that owns stylesSimon Sapin2019-11-261-85/+4
| | | | | | | | … 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.
* Start implementing text in layout 2020Anthony Ramine2019-11-251-0/+1
|
* Pass a LayoutContext to TextRun::layout in 2020Anthony Ramine2019-11-251-4/+15
|
* 2020: define DisplayInside and DisplayOutside enums separately from StyloSimon Sapin2019-10-241-3/+1
|
* 2020: paint background-colorSimon Sapin2019-10-241-0/+1
|
* 2020: run layout after box constructionSimon Sapin2019-10-241-1/+1
|
* Make some of layout_2020 privateSimon Sapin2019-10-041-21/+22
|
* Call BoxTreeRoot::construct from layout_thread_2020Anthony Ramine2019-10-041-11/+12
|
* Import victor's layout system 🍷Anthony Ramine2019-09-111-0/+148
|
* Kill fragmentsAnthony Ramine2019-09-111-6/+0
|
* Remove layout_2020::display_list, use WebRender display lists insteadSimon Sapin2019-09-071-4/+0
|
* Remove more stuff from layout_2020Anthony Ramine2019-08-131-4/+0
|
* Remove most of the things in layout 2020Anthony Ramine2019-07-311-37/+0
| | | | | We keep mostly the query system. There is probably more to delete but that's a good start I think.
* Make layout_2020 be layout_2013Anthony Ramine2019-07-311-0/+60
|
* Add `./mach build --with-layout-2020`Simon Sapin2019-07-041-0/+3
… with corresponding `layout` and `layout_thread` crates, which for now do nothing.