Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central #3817

Merged
merged 6 commits into from Dec 20, 2019
Prev

Backed out changeset c9cbe7b9ad94 (bug 1605380) for WR failures on ba…

…ckground-border-collapsed-gradient.html . CLOSED TREE

[wrupdater] From https://hg.mozilla.org/mozilla-central/rev/e94a014eb27e172be7f6b3860806803159d3d1f2
  • Loading branch information
nbeleuzu authored and moz-gfx committed Dec 20, 2019
commit 497170e33aba8c8acfbba08b68c3f7cc0dd70467
@@ -994,8 +994,21 @@ impl<'a> SceneBuilder<'a> {
fn process_common_properties(
&mut self,
common: &CommonItemProperties,
bounds: Option<&LayoutRect>,
apply_pipeline_clip: bool,
apply_pipeline_clip: bool
) -> (LayoutPrimitiveInfo, ScrollNodeAndClipChain) {
let (layout, _, clip_and_scroll) = self.process_common_properties_with_bounds(
common,
&common.clip_rect,
apply_pipeline_clip,
);
(layout, clip_and_scroll)
}

fn process_common_properties_with_bounds(
&mut self,
common: &CommonItemProperties,
bounds: &LayoutRect,
apply_pipeline_clip: bool
) -> (LayoutPrimitiveInfo, LayoutRect, ScrollNodeAndClipChain) {
let clip_and_scroll = self.get_clip_and_scroll(
&common.clip_id,
@@ -1011,37 +1024,19 @@ impl<'a> SceneBuilder<'a> {
&self.clip_scroll_tree
);

let clip_rect = snap_to_device.snap_rect(
&common.clip_rect.translate(current_offset)
);

let rect = bounds.map_or(clip_rect, |bounds| {
snap_to_device.snap_rect(&bounds.translate(current_offset))
});
let clip_rect = common.clip_rect.translate(current_offset);
let rect = bounds.translate(current_offset);

let layout = LayoutPrimitiveInfo {
rect,
clip_rect,
rect: snap_to_device.snap_rect(&rect),
clip_rect: snap_to_device.snap_rect(&clip_rect),
flags: common.flags,
hit_info: common.hit_info,
};

(layout, rect, clip_and_scroll)
}

fn process_common_properties_with_bounds(
&mut self,
common: &CommonItemProperties,
bounds: &LayoutRect,
apply_pipeline_clip: bool,
) -> (LayoutPrimitiveInfo, LayoutRect, ScrollNodeAndClipChain) {
self.process_common_properties(
common,
Some(bounds),
apply_pipeline_clip,
)
}

pub fn snap_rect(
&mut self,
rect: &LayoutRect,
@@ -1146,9 +1141,8 @@ impl<'a> SceneBuilder<'a> {
);
}
DisplayItem::Rectangle(ref info) => {
let (layout, _, clip_and_scroll) = self.process_common_properties(
let (layout, clip_and_scroll) = self.process_common_properties(
&info.common,
None,
apply_pipeline_clip,
);

@@ -1159,9 +1153,8 @@ impl<'a> SceneBuilder<'a> {
);
}
DisplayItem::HitTest(ref info) => {
let (layout, _, clip_and_scroll) = self.process_common_properties(
let (layout, clip_and_scroll) = self.process_common_properties(
&info.common,
None,
apply_pipeline_clip,
);

@@ -1172,9 +1165,8 @@ impl<'a> SceneBuilder<'a> {
);
}
DisplayItem::ClearRectangle(ref info) => {
let (layout, _, clip_and_scroll) = self.process_common_properties(
let (layout, clip_and_scroll) = self.process_common_properties(
&info.common,
None,
apply_pipeline_clip,
);

@@ -1427,9 +1419,8 @@ impl<'a> SceneBuilder<'a> {
);
}
DisplayItem::BackdropFilter(ref info) => {
let (layout, _, clip_and_scroll) = self.process_common_properties(
let (layout, clip_and_scroll) = self.process_common_properties(
&info.common,
None,
apply_pipeline_clip,
);

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.