Commit graph

36 commits

Author SHA1 Message Date
Simon Sapin
64124f7a5e Layout 2020 skeleton for display: flex, behind a pref 2020-06-04 13:09:57 +02:00
Simon Sapin
c43ab0c267 Rename BoxTreeRoot/FragmentTreeRoot to BoxTree/FragmentTree 2020-05-15 13:25:35 +02:00
Martin Robinson
9c7b1ae715 layout_2020: Add initial support for getComputedStyle
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.
2020-05-11 20:14:01 +02:00
Simon Sapin
7f975c3d5d Remove use of some other unstable features 2020-04-15 15:17:52 +02:00
Anthony Ramine
030a1cf8fb Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutData 2020-04-06 23:06:13 +02:00
Martin Robinson
ac2f402ae0 layout_2020: Stop throwing away hoisted boxes in nested absolutes
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.
2020-03-27 17:46:06 +01:00
Patrick Walton
2ff776b241 Add an ArcRefCell<T> type 2020-03-17 11:15:17 -07:00
Anthony Ramine
c3932185ec Make AbsolutelyPositionedBox be 'static 2020-03-17 11:15:17 -07:00
Martin Robinson
c3b1c92ac1 layout_2020: Paint hoisted positioned fragments in tree order
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.
2020-03-11 12:47:06 +01:00
Fernando Jiménez Moreno
5cbe05366b Add layout debugger support to layout_2020 2020-02-21 11:11:00 +01:00
Simon Sapin
850f52c327 Upgrade to rustc 1.42.0-nightly (3291ae339 2020-01-15) 2020-01-16 08:46:41 +01:00
Simon Sapin
58b7005a9b Make for_maybe_position_relative take care of relative adjustment. 2019-12-13 13:13:50 +01:00
Simon Sapin
f09c14aa6b impl From<&'_ DefiniteContainingBlock> for ContainingBlock 2019-12-10 15:11:53 +01:00
Simon Sapin
fa1adf2ad3 Containing blocks contains styles rather than just a writing mode 2019-12-07 14:25:16 +01:00
Simon Sapin
40ad9a722d Use the WritingMode bitflags from Stylo 2019-12-07 12:45:36 +01:00
Simon Sapin
2c124b9d0b Add inline_size_is_auto 2019-12-03 15:11:35 +01:00
Simon Sapin
6a5b8337a1 Rename IntrinsicSizes to ContentSizes 2019-12-03 15:11:35 +01:00
Simon Sapin
9c5a595044 Add intrinsic size computation for inline formatting contexts 2019-12-02 22:11:54 +01:00
Simon Sapin
aa925a5984 Un-allow and fix warnings in components/layout_2020 2019-12-02 16:32:34 +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
80eec48d37 Use std::mem::take instead of defining it 2019-11-26 15:42:27 +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
Anthony Ramine
b3d30d284e Start implementing text in layout 2020 2019-11-25 10:54:46 +01:00
Anthony Ramine
1446756774 Pass a LayoutContext to TextRun::layout in 2020 2019-11-25 10:54:46 +01:00
Simon Sapin
22f5e07765 2020: define DisplayInside and DisplayOutside enums separately from Stylo 2019-10-24 10:44:31 +02:00
Simon Sapin
cfc3ffcd54 2020: paint background-color 2019-10-24 10:44:31 +02:00
Simon Sapin
e38cc1a549 2020: run layout after box construction 2019-10-24 10:43:08 +02:00
Simon Sapin
1bb85ed05b Make some of layout_2020 private 2019-10-04 17:51:05 +02:00
Anthony Ramine
ec74204fa0 Call BoxTreeRoot::construct from layout_thread_2020 2019-10-04 10:03:42 +02:00
Anthony Ramine
4444c5a2ad Import victor's layout system 🍷 2019-09-11 10:36:30 +02:00
Anthony Ramine
d0d4bb7c99 Kill fragments 2019-09-11 10:06:32 +02:00
Simon Sapin
3e6489f543 Remove layout_2020::display_list, use WebRender display lists instead 2019-09-07 19:38:44 +02:00
Anthony Ramine
053e361e2f Remove more stuff from layout_2020 2019-08-13 13:45:05 +02:00
Anthony Ramine
317d700f5d Remove most of the things in layout 2020
We keep mostly the query system. There is probably more to delete but
that's a good start I think.
2019-07-31 17:09:17 +02:00
Anthony Ramine
4846d76e82 Make layout_2020 be layout_2013 2019-07-31 17:09:16 +02:00
Simon Sapin
2b01c26aa5 Add ./mach build --with-layout-2020
… with corresponding `layout` and `layout_thread` crates,
which for now do nothing.
2019-07-04 18:16:44 +02:00