Martin Robinson
9517190a60
Split stacking context fragments into sections in layout_2020
...
This allows rendering stacking context content in the proper order. We
also need to add a new pseudo stacking context for atomic inlines in
order to preserve proper rendering order in some cases.
2020-02-17 14:10:03 +01:00
Martin Robinson
4a2787b974
Add initial stacking context paint order support to layout_2020
...
This adds very rudimentary support for paint order in stacking context.
In particular z-index is now handled properly, apart from issues with
hoisted fragments.
2020-02-17 10:05:19 +01:00
Martin Robinson
843df5b529
Add support for a stacking context pass to layout_2020
...
This adds an intermediary data structure that allows the display list
builder to move through the fragment tree in stacking context painting
order. Spatial nodes are built during this phase and all display list
items are added to the end of the display list.
2020-02-14 10:57:45 +01:00
Emilio Cobos Álvarez
1754c832d8
layout_2020: Avoid decomposing mixed length / percentages in intrinsic sizing.
...
As that makes no sense in presence of min / max.
2020-02-12 02:43:23 +01:00
Emilio Cobos Álvarez
f03026b869
layout: Resolve word_spacing ahead of time.
...
It's not possible anymore, in the presence of min() / max(), to split a
<length-percentage> value into a <length> and a <percentage> component.
Tweak word_spacing to do what Gecko does (resolving it in advance).
2020-02-12 02:43:23 +01:00
Emilio Cobos Álvarez
e227715aee
style: Miscellaneous Servo build fixes.
2020-02-12 02:43:23 +01:00
Simon Sapin
53d5e29c7b
Replace iterate_through_fragments
with a callback returning bool
with find
/ Option<T>
2020-02-11 14:02:22 +01:00
Simon Sapin
d353e08529
Deduplicate the loop in iterate_through_fragments
2020-02-11 14:02:22 +01:00
Simon Sapin
ef8c51c4b1
Exit iterate_through_fragments through all recursion levels when the callback says so
2020-02-11 14:02:22 +01:00
Martin Robinson
fa7839270d
Add layout_2020 support for NodeGeometryQuery and ContentBoxQuery
2020-02-11 14:02:19 +01:00
Martin Robinson
63aae0178f
Improve position:fixed support in layout_2020
...
This makes it so that position:fixed elements do not scroll with the
rest of the contents, but does not tackle the rest of the issues with
their positioning.
2020-02-11 10:42:35 +01:00
Martin Robinson
20b8edc625
Clean up BoxFragment display list builder in layout_2020
...
This makes things a big easier to read and will make it easier to add
support for position:fixed.
2020-02-07 14:35:05 +01:00
Martin Robinson
7a5a320d74
Add support for overflow:scroll and overflow:hidden to layout_2020
...
This adds clipping and interactive scrolling support, but scrolling from
script is still not functional.
2020-01-31 17:30:29 +01:00
Simon Sapin
37ccefbe19
Adress review comments
2020-01-25 07:37:28 +01:00
Simon Sapin
632e731760
Render gradients
2020-01-24 14:20:20 +01:00
Simon Sapin
f39c3ff38b
Apply background-clip
to background-color
2020-01-24 14:20:20 +01:00
Simon Sapin
ea4882a1c5
Fix combinations of border-radius
and background-clip
2020-01-24 14:20:20 +01:00
Simon Sapin
9fedade396
Rename clipping_area
to painting_area
...
https://drafts.csswg.org/css-backgrounds/#background-painting-area
2020-01-24 14:20:20 +01:00
Simon Sapin
c8c198a172
Add a display_list::background
module
2020-01-24 14:20:20 +01:00
Simon Sapin
6901bf951a
Make layout_2020::display_list
a directory-module
2020-01-24 14:20:20 +01:00
Martin Robinson
02deb99a05
Use euclid data types for physical structs in layout_2020
...
This removes a bit of duplication and allows layout_2020 to benefit from
a much richer set of utilities.
2020-01-23 15:39:32 +01:00
Martin Robinson
1cd772fe5f
Answer content box queries for layout_2020 for the root element
...
This isn't correct yet, but it is necessary to give a value in order for
scrolling from script to work. Later this should give an accurate
content box response as well as work for non-root elements.
2020-01-21 15:29:23 +01:00
Martin Robinson
27e0400891
Fix an issue with unset_boxes_in_subtree
in layout_2020
...
If the root node of the subtree doesn't have any boxes to unset, we
should exit early instead of unsetting boxes on siblings of the root.
This eliminates an infinite loop in this method, since the siblings of
the root are not in the subtree.
2020-01-21 15:29:23 +01:00
Martin Robinson
8825d588c1
Add initial support for scrollable overflow in layout_2020
...
This still isn't totally correct and non-root scrolling is not handled
at all, but the root frame now scrolls.
2020-01-21 15:29:23 +01:00
bors-servo
1de92906e8
Auto merge of #25512 - servo:background-image, r=nox
...
Render `background-image: url(…)`
… and support most `background-*` properties.
Still to do:
* `background-attachment`
* Gradients
2020-01-17 10:52:38 -05: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
86c028e610
Structify a tuple
2020-01-14 18:46:59 +01:00
Simon Sapin
0340ac6fae
Use mitochondria
2020-01-14 18:46:50 +01:00
Simon Sapin
cac32867ba
Re-comment
2020-01-13 23:13:43 +01:00
Simon Sapin
c72f7894aa
Use a non-repeating display item for background-repeat: no-repeat
2020-01-13 22:54:12 +01:00
Simon Sapin
7c1f2335d4
Add background-repeat
2020-01-13 21:59:46 +01:00
Simon Sapin
6e78cdf0ed
Don’t paint a zero-size background image
2020-01-13 21:59:46 +01:00
Simon Sapin
c73dc885bb
Add background-position
2020-01-13 21:59:46 +01:00
Simon Sapin
b1dcd5ecb6
Add background-size
2020-01-13 21:59:46 +01:00
Simon Sapin
649d3cb6b4
Add background-origin
2020-01-13 21:59:46 +01:00
Simon Sapin
3874946ac6
Add background-clip
2020-01-13 21:59:46 +01:00
Simon Sapin
d8ed710824
Use OnceCell instead of Option
2020-01-13 21:59:46 +01:00
Simon Sapin
252877ac62
Background positioning with initial values
2020-01-13 21:59:46 +01:00
Simon Sapin
c6ba6c40b9
Initial rendering of background-image
2020-01-13 21:59:46 +01:00
Simon Sapin
40453ad7e1
Pass LayoutContext to DisplayListBuilder
2020-01-13 21:59:45 +01:00
Simon Sapin
c8cbc57b76
Copy image-fetching code from Layout 2013
2020-01-13 21:59:45 +01:00
Martin Robinson
ea8c635344
Allow dumping the fragment tree in layout_2020
...
This is done when the dump-flow-tree debug option is passed.
2020-01-13 13:12:52 +01:00
Simon Sapin
87b79985fa
Simplify CommonItemProperties
construction
2020-01-09 17:38:05 +01:00
Simon Sapin
12c18a0e07
Account for border-radius in hit-testing
2020-01-09 17:21:38 +01:00
Simon Sapin
75e1f116e1
Introduce BuilderForBoxFragment
2020-01-09 15:51:41 +01:00
Simon Sapin
c495b5adb2
Move box fragment hit testing to a dedicated display item
2020-01-09 15:49:29 +01:00
Simon Sapin
53fc6143dc
Use the is_contentful field of DisplayListBuilder
2020-01-09 15:21:58 +01:00
Simon Sapin
347d5825d1
Clip background-color to border-radius
2020-01-03 16:58:08 +01:00
Simon Sapin
cbf467b18c
Refactor creation of webrender_api::CommonItemProperties
2020-01-03 16:48:04 +01:00
Simon Sapin
962c85b553
Apply border-radius when painting borders
2020-01-03 15:45:28 +01:00