Auto merge of #16891 - kvark:preserve3d, r=glennw,emilio

Using TransformStyle::Preserve3D

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

The changes were reviewed previously as a part of WR update PRs, but then we decided to move them out.
r? @emilio

---
<!-- 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/16891)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-17 20:38:14 -05:00 committed by GitHub
commit a5ff57b20f
9 changed files with 79 additions and 57 deletions

View file

@ -30,11 +30,11 @@ use std::cmp::{self, Ordering};
use std::collections::HashMap;
use std::fmt;
use std::sync::Arc;
use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode};
use style::computed_values::{border_style, filter, image_rendering};
use style_traits::cursor::Cursor;
use text::TextRun;
use text::glyph::ByteIndex;
use webrender_traits::{self, ClipId, ColorF, GradientStop, ScrollPolicy, WebGLContextId};
use webrender_traits::{self, ClipId, ColorF, GradientStop, MixBlendMode, ScrollPolicy, TransformStyle, WebGLContextId};
pub use style::dom::OpaqueNode;
@ -424,11 +424,14 @@ pub struct StackingContext {
pub filters: filter::T,
/// The blend mode with which this stacking context blends with its backdrop.
pub blend_mode: mix_blend_mode::T,
pub mix_blend_mode: MixBlendMode,
/// A transform to be applied to this stacking context.
pub transform: Option<Matrix4D<f32>>,
/// The transform style of this stacking context.
pub transform_style: TransformStyle,
/// The perspective matrix to be applied to children.
pub perspective: Option<Matrix4D<f32>>,
@ -448,8 +451,9 @@ impl StackingContext {
overflow: &Rect<Au>,
z_index: i32,
filters: filter::T,
blend_mode: mix_blend_mode::T,
mix_blend_mode: MixBlendMode,
transform: Option<Matrix4D<f32>>,
transform_style: TransformStyle,
perspective: Option<Matrix4D<f32>>,
scroll_policy: ScrollPolicy,
parent_scroll_id: ClipId)
@ -461,8 +465,9 @@ impl StackingContext {
overflow: *overflow,
z_index: z_index,
filters: filters,
blend_mode: blend_mode,
mix_blend_mode: mix_blend_mode,
transform: transform,
transform_style: transform_style,
perspective: perspective,
scroll_policy: scroll_policy,
parent_scroll_id: parent_scroll_id,
@ -477,8 +482,9 @@ impl StackingContext {
&Rect::zero(),
0,
filter::T::new(Vec::new()),
mix_blend_mode::T::normal,
MixBlendMode::Normal,
None,
TransformStyle::Flat,
None,
ScrollPolicy::Scrollable,
pipeline_id.root_scroll_node())