Commit graph

185 commits

Author SHA1 Message Date
Fernando Jiménez Moreno
f0e30f5b0c Canvas rendering for layout 2020
Update test expectations with layout 2020 canvas support
2020-03-06 13:23:07 +01:00
Martin Robinson
8de55695e4 Have transforms and filters be CBs for all descendants in layout_2020
This is a feature that was never properly implemented in the previous
layout system. We still need to preserve their in-tree order in the
display list though.
2020-03-02 11:47:00 +01:00
bors-servo
44d8727ad3
Auto merge of #25866 - ferjm:url.generated.content, r=nox
Generate ::before and ::after content from url() for layout2020

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes
2020-02-28 15:57:25 -05:00
Fernando Jiménez Moreno
dc9a33f3a9 Generate ::before and ::after content from url() for layout2020 2020-02-28 15:00:07 +01:00
Martin Robinson
c20c468814 Rename AbsolutelyPositionedBox::layout to AbsolutelyPositionedBox::to_hoisted
This method doesn't actually do any layout, but converts this block to a
HoistedAbsolutelyPositionedBox which is hoisted and then laid-out with
its containing block later. This makes the code a little easier to read.
2020-02-28 14:42:29 +01:00
Fernando Jiménez Moreno
48a4c07246 Properly position atomic inline level boxes 2020-02-27 17:14:18 +01:00
Fernando Jiménez Moreno
60fd1e005a Temporarily allow PseudoElementContentItem unused variant 2020-02-25 11:24:43 +01:00
Fernando Jiménez Moreno
5b2d6c81b2 Generate ::before and ::after content from attr() for layout 2020 2020-02-25 10:47:48 +01:00
Fernando Jiménez Moreno
bc66948f7c Generate ::before and ::after string content for layout 2020 2020-02-25 10:47:48 +01:00
bors-servo
9c6897c967
Auto merge of #25818 - mrobinson:transforms, r=SimonSapin
Add initial support for transforms to layout_2020

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-02-24 12:45:43 -05:00
Martin Robinson
80b29380f1 Add layout_2020 support for transformations 2020-02-21 17:07:09 +01:00
Fernando Jiménez Moreno
5e76c93cc7 Minor improvements to layout_debug and associated code 2020-02-21 16:34:32 +01:00
Fernando Jiménez Moreno
c4276aa27e Fix rebase issues and run Prettier on layout viewer code 2020-02-21 11:11:00 +01:00
Fernando Jiménez Moreno
a042f85083 Dump box tree state into json files and display it on layout 2020 viewer 2020-02-21 11:11:00 +01:00
Fernando Jiménez Moreno
67706f9c0b Add fragment debug id 2020-02-21 11:11:00 +01:00
Fernando Jiménez Moreno
5cbe05366b Add layout debugger support to layout_2020 2020-02-21 11:11:00 +01:00
Josh Matthews
3fd3c23e17 Update ipc-channel and crossbeam-channel. 2020-02-20 11:15:13 -05:00
bors-servo
35b1548cb6
Auto merge of #25777 - kunalmohan:24720-ImageCache, r=jdm
Take origin from current window instead of creating a new one in event of reflow

Everytime a new `LayoutContext` was created, it created a new origin which
caused endless stream of image loads to occur in case of reflow. The reason
for this was that the existing image, although cached successfully, was not
used because the entry in hashmap did not match because of different(new)
origin.
This is solved by storing the origin of a window in enum `ScriptReflow` and
used in creating new `LayoutContext` in case of reflow.

<!-- Please describe your changes on the following line: -->
r?@jdm

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #24720  (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-02-19 13:51:30 -05:00
Martin Robinson
d03560b0f1 Add layout_2020 support for filters and mix-blend-mode 2020-02-19 10:26:13 +01:00
Kunal Mohan
4a3bf52a7c
remove option for origin and mirror changes to layout_thread_2020 2020-02-18 00:57:33 +05:30
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