Commit graph

159 commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
ef16c5844f Rustfmt recent changes. 2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
e885ccb7ae layout-2020: build fixes. 2019-12-16 14:23:56 +01:00
Anthony Ramine
ace052ddbb Handle cursor and hit testing in 2020 2019-12-13 17:59:27 +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
Anthony Ramine
b2f6cc7144 Introduce BlockLevelJob 2019-12-13 17:51:06 +01:00