Auto merge of #18212 - mrobinson:position-sticky, r=emilio

Add support for position:sticky

This leverages the position:sticky support in WebRender to bring basic
support for position:sticky in Servo. There are still some issues with
nested sticky flows as well as a few other corner cases. Tests are
imported from WPT and can be removed once we update to the latest
version.

<!-- Please describe your changes on the following line: -->

---
<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18212)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-09-05 15:36:47 -05:00 committed by GitHub
commit f1fab036ab
84 changed files with 5729 additions and 50 deletions

View file

@ -492,10 +492,11 @@ impl WebRenderDisplayItemConverter for DisplayItem {
builder.push_clip_id(item.scroll_root.parent_id);
let our_id = item.scroll_root.id;
let item_rect = item.scroll_root.clip.main.to_rectf();
let webrender_id = match item.scroll_root.root_type {
ScrollRootType::Clip => {
builder.define_clip(Some(our_id),
item.scroll_root.clip.main.to_rectf(),
item_rect,
item.scroll_root.clip.get_complex_clips(),
None)
}
@ -507,6 +508,9 @@ impl WebRenderDisplayItemConverter for DisplayItem {
None,
scroll_sensitivity)
}
ScrollRootType::StickyFrame(sticky_frame_info) => {
builder.define_sticky_frame(Some(our_id), item_rect, sticky_frame_info)
}
};
debug_assert!(our_id == webrender_id);