Auto merge of #19057 - mrobinson:update-wr-sticky-api, r=glennw

Update WR to use the new sticky positioning API

<!-- 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they do not change behavior.

<!-- 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/19057)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-10-30 15:58:07 -05:00 committed by GitHub
commit b6475cf433
6 changed files with 58 additions and 32 deletions

View file

@ -34,7 +34,7 @@ use style_traits::cursor::Cursor;
use text::TextRun;
use text::glyph::ByteIndex;
use webrender_api::{self, ClipId, ColorF, GradientStop, LocalClip, MixBlendMode, ScrollPolicy};
use webrender_api::{ScrollSensitivity, StickyFrameInfo, TransformStyle};
use webrender_api::{ScrollSensitivity, StickyOffsetBounds, TransformStyle};
pub use style::dom::OpaqueNode;
@ -321,10 +321,17 @@ impl fmt::Debug for StackingContext {
}
}
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct StickyFrameData {
pub margins: SideOffsets2D<Option<f32>>,
pub vertical_offset_bounds: StickyOffsetBounds,
pub horizontal_offset_bounds: StickyOffsetBounds,
}
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub enum ClipScrollNodeType {
ScrollFrame(ScrollSensitivity),
StickyFrame(StickyFrameInfo),
StickyFrame(StickyFrameData),
Clip,
}