Commit graph

342 commits

Author SHA1 Message Date
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
Anthony Ramine
fb1891f436 Add NodeExt::as_opaque 2019-12-13 17:51:06 +01:00
Simon Sapin
6f3c5ce773 Rename BlockLevelKind to NonReplacedContents 2019-12-13 13:59:15 +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
b218957461 Rename CollectedAbsolutelyPositionedBox to HoistedAbsolutelyPositionedBox 2019-12-13 12:44:05 +01:00
Simon Sapin
04b701b9e0 Move call to for_maybe_position_relative out of layout_in_flow_non_replaced_block_level 2019-12-13 12:41:58 +01:00
Simon Sapin
672d971d58 Regroup branches specific to SameFormattingContextBlock 2019-12-13 12:33:07 +01:00
Simon Sapin
c0962aa3fc Replace the closure in layout_in_flow_non_replaced_block_level with an enum 2019-12-13 12:09:51 +01:00
Simon Sapin
53a8a609d2 Fix a width v.s. height confusion bug in abspos layout 2019-12-13 00:09:43 +01:00
Simon Sapin
5ebddf19e6 Layout position: fixed in the initial containing block 2019-12-12 22:50:11 +01:00
Simon Sapin
c44ee516a1 Give PositioningContext more responsibilities
Iits details are now private to the module.

It has a couple methods that take closures to make sure that "before" and "after" steps are done together:

* In an absolutely positioned box, take care of nested abspos (establish a new containing block, etc.)
* For a box that *might* be `position: relative`, optionally take care of the same.
2019-12-12 22:50:11 +01:00
Simon Sapin
1c8d14ac0d Upgrade rayon_croissant to 0.2.0 2019-12-12 18:57:18 +01:00
Simon Sapin
9edda952c9 Make adjust_static_positions a method of PositioningContext 2019-12-12 15:43:50 +01:00
Simon Sapin
b43a3de51d Introduce PositioningContext 2019-12-12 15:37:01 +01:00
Simon Sapin
c895e3d236 Disable use of rayon with --layout-threads 1 instead of panicking 2019-12-10 18:41:24 +01:00
Simon Sapin
53ce714005 Fix a “Accessing content size that was not requested” panic
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”
2019-12-10 15:11:53 +01:00
Simon Sapin
a17db217a1 Struct with named fields over large tuple 2019-12-10 15:11:53 +01:00
Simon Sapin
be8df1d114 Move solve_axis function to module level 2019-12-10 15:11:53 +01:00