aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2019-01-14 10:37:41 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2019-01-14 10:37:41 +0100
commitfc75719ff213427945b8ad7580d102eb5148a314 (patch)
treec248ff2b37fac2e9e340b6bcb20766ffdf7d6184
parent64755705fbdeb0aaf257bbdd39577646f2718f28 (diff)
downloadservo-fc75719ff213427945b8ad7580d102eb5148a314.tar.gz
servo-fc75719ff213427945b8ad7580d102eb5148a314.zip
Remove BlockFlowDisplayListBuilding
Replaced by inherent methods on BlockFlow, the only implementor of that trait.
-rw-r--r--components/layout/block.rs7
-rw-r--r--components/layout/display_list/builder.rs85
-rw-r--r--components/layout/display_list/mod.rs1
-rw-r--r--components/layout/table.rs4
-rw-r--r--components/layout/table_caption.rs5
-rw-r--r--components/layout/table_cell.rs5
-rw-r--r--components/layout/table_row.rs5
-rw-r--r--components/layout/table_rowgroup.rs5
-rw-r--r--components/layout/table_wrapper.rs4
-rw-r--r--components/layout_thread/lib.rs2
-rw-r--r--components/script/script_thread.rs2
11 files changed, 26 insertions, 99 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index 8c4a8a771aa..0e4bf140d42 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -27,9 +27,10 @@
use crate::context::LayoutContext;
use crate::display_list::items::DisplayListSection;
-use crate::display_list::StackingContextCollectionState;
-use crate::display_list::{BlockFlowDisplayListBuilding, BorderPaintingMode};
-use crate::display_list::{DisplayListBuildState, StackingContextCollectionFlags};
+use crate::display_list::{
+ BorderPaintingMode, DisplayListBuildState, StackingContextCollectionFlags,
+ StackingContextCollectionState,
+};
use crate::floats::{ClearType, FloatKind, Floats, PlacementInfo};
use crate::flow::{
BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag, GetBaseFlow,
diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs
index e3dd66b8a2b..6bf719ff17e 100644
--- a/components/layout/display_list/builder.rs
+++ b/components/layout/display_list/builder.rs
@@ -2344,81 +2344,6 @@ bitflags! {
}
}
-pub trait BlockFlowDisplayListBuilding {
- fn collect_stacking_contexts_for_block(
- &mut self,
- state: &mut StackingContextCollectionState,
- flags: StackingContextCollectionFlags,
- );
-
- fn transform_clip_to_coordinate_space(
- &mut self,
- state: &mut StackingContextCollectionState,
- preserved_state: &mut SavedStackingContextCollectionState,
- );
- fn setup_clipping_for_block(
- &mut self,
- state: &mut StackingContextCollectionState,
- preserved_state: &mut SavedStackingContextCollectionState,
- stacking_context_type: Option<StackingContextType>,
- established_reference_frame: Option<ClipScrollNodeIndex>,
- flags: StackingContextCollectionFlags,
- ) -> ClippingAndScrolling;
- fn setup_clip_scroll_node_for_position(
- &mut self,
- state: &mut StackingContextCollectionState,
- border_box: Rect<Au>,
- );
- fn setup_clip_scroll_node_for_overflow(
- &mut self,
- state: &mut StackingContextCollectionState,
- border_box: Rect<Au>,
- );
- fn setup_clip_scroll_node_for_css_clip(
- &mut self,
- state: &mut StackingContextCollectionState,
- preserved_state: &mut SavedStackingContextCollectionState,
- stacking_relative_border_box: Rect<Au>,
- );
- fn create_pseudo_stacking_context_for_block(
- &mut self,
- stacking_context_type: StackingContextType,
- parent_stacking_context_id: StackingContextId,
- parent_clip_and_scroll_info: ClippingAndScrolling,
- state: &mut StackingContextCollectionState,
- );
- fn create_real_stacking_context_for_block(
- &mut self,
- parent_stacking_context_id: StackingContextId,
- parent_clipping_and_scrolling: ClippingAndScrolling,
- established_reference_frame: Option<ClipScrollNodeIndex>,
- state: &mut StackingContextCollectionState,
- );
- fn build_display_list_for_block(
- &mut self,
- state: &mut DisplayListBuildState,
- border_painting_mode: BorderPaintingMode,
- );
- fn build_display_list_for_block_no_damage(
- &self,
- state: &mut DisplayListBuildState,
- border_painting_mode: BorderPaintingMode,
- );
- fn build_display_list_for_background_if_applicable_with_background(
- &self,
- state: &mut DisplayListBuildState,
- background: &style_structs::Background,
- background_color: RGBA,
- );
-
- fn stacking_context_type(
- &self,
- flags: StackingContextCollectionFlags,
- ) -> Option<StackingContextType>;
-
- fn is_reference_frame(&self, context_type: Option<StackingContextType>) -> bool;
-}
-
/// This structure manages ensuring that modification to StackingContextCollectionState is
/// only temporary. It's useful for moving recursively down the flow tree and ensuring
/// that the state is restored for siblings. To use this structure, we must call
@@ -2498,7 +2423,7 @@ impl SavedStackingContextCollectionState {
}
}
-impl BlockFlowDisplayListBuilding for BlockFlow {
+impl BlockFlow {
fn transform_clip_to_coordinate_space(
&mut self,
state: &mut StackingContextCollectionState,
@@ -2576,7 +2501,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
}
}
- fn collect_stacking_contexts_for_block(
+ pub fn collect_stacking_contexts_for_block(
&mut self,
state: &mut StackingContextCollectionState,
flags: StackingContextCollectionFlags,
@@ -2970,7 +2895,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
self.base.collect_stacking_contexts_for_children(state);
}
- fn build_display_list_for_block_no_damage(
+ pub fn build_display_list_for_block_no_damage(
&self,
state: &mut DisplayListBuildState,
border_painting_mode: BorderPaintingMode,
@@ -3005,7 +2930,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
state.processing_scrolling_overflow_element = false;
}
- fn build_display_list_for_block(
+ pub fn build_display_list_for_block(
&mut self,
state: &mut DisplayListBuildState,
border_painting_mode: BorderPaintingMode,
@@ -3016,7 +2941,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
self.build_display_list_for_block_no_damage(state, border_painting_mode);
}
- fn build_display_list_for_background_if_applicable_with_background(
+ pub fn build_display_list_for_background_if_applicable_with_background(
&self,
state: &mut DisplayListBuildState,
background: &style_structs::Background,
diff --git a/components/layout/display_list/mod.rs b/components/layout/display_list/mod.rs
index ed4320ac7b2..1af9d7981c1 100644
--- a/components/layout/display_list/mod.rs
+++ b/components/layout/display_list/mod.rs
@@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-pub use self::builder::BlockFlowDisplayListBuilding;
pub use self::builder::BorderPaintingMode;
pub use self::builder::DisplayListBuildState;
pub use self::builder::FlexFlowDisplayListBuilding;
diff --git a/components/layout/table.rs b/components/layout/table.rs
index 83d3552a988..f7bf902e452 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -7,9 +7,9 @@
use crate::block::{BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer};
use crate::block::{ISizeConstraintInput, ISizeConstraintSolution};
use crate::context::LayoutContext;
-use crate::display_list::{BlockFlowDisplayListBuilding, BorderPaintingMode};
use crate::display_list::{
- DisplayListBuildState, StackingContextCollectionFlags, StackingContextCollectionState,
+ BorderPaintingMode, DisplayListBuildState, StackingContextCollectionFlags,
+ StackingContextCollectionState,
};
use crate::flow::{
BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils,
diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs
index b217aa65f8b..883d5d6501d 100644
--- a/components/layout/table_caption.rs
+++ b/components/layout/table_caption.rs
@@ -6,8 +6,9 @@
use crate::block::BlockFlow;
use crate::context::LayoutContext;
-use crate::display_list::{BlockFlowDisplayListBuilding, DisplayListBuildState};
-use crate::display_list::{StackingContextCollectionFlags, StackingContextCollectionState};
+use crate::display_list::{
+ DisplayListBuildState, StackingContextCollectionFlags, StackingContextCollectionState,
+};
use crate::flow::{Flow, FlowClass, OpaqueFlow};
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
use app_units::Au;
diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs
index b5d95b1e4dd..d72a6670576 100644
--- a/components/layout/table_cell.rs
+++ b/components/layout/table_cell.rs
@@ -6,8 +6,9 @@
use crate::block::{BlockFlow, ISizeAndMarginsComputer, MarginsMayCollapseFlag};
use crate::context::LayoutContext;
-use crate::display_list::{BlockFlowDisplayListBuilding, DisplayListBuildState};
-use crate::display_list::{StackingContextCollectionFlags, StackingContextCollectionState};
+use crate::display_list::{
+ DisplayListBuildState, StackingContextCollectionFlags, StackingContextCollectionState,
+};
use crate::flow::{Flow, FlowClass, FlowFlags, GetBaseFlow, OpaqueFlow};
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
use crate::layout_debug;
diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs
index ca33eb2584e..22db572c166 100644
--- a/components/layout/table_row.rs
+++ b/components/layout/table_row.rs
@@ -6,8 +6,9 @@
use crate::block::{BlockFlow, ISizeAndMarginsComputer};
use crate::context::LayoutContext;
-use crate::display_list::{BlockFlowDisplayListBuilding, DisplayListBuildState};
-use crate::display_list::{StackingContextCollectionFlags, StackingContextCollectionState};
+use crate::display_list::{
+ DisplayListBuildState, StackingContextCollectionFlags, StackingContextCollectionState,
+};
use crate::flow::{
EarlyAbsolutePositionInfo, Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils, OpaqueFlow,
};
diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs
index b2afd3c2aba..814cbe0d2d2 100644
--- a/components/layout/table_rowgroup.rs
+++ b/components/layout/table_rowgroup.rs
@@ -6,8 +6,9 @@
use crate::block::{BlockFlow, ISizeAndMarginsComputer};
use crate::context::LayoutContext;
-use crate::display_list::{BlockFlowDisplayListBuilding, DisplayListBuildState};
-use crate::display_list::{StackingContextCollectionFlags, StackingContextCollectionState};
+use crate::display_list::{
+ DisplayListBuildState, StackingContextCollectionFlags, StackingContextCollectionState,
+};
use crate::flow::{Flow, FlowClass, OpaqueFlow};
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
use crate::layout_debug;
diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs
index f63cf3f28f0..9e8f137e70a 100644
--- a/components/layout/table_wrapper.rs
+++ b/components/layout/table_wrapper.rs
@@ -17,9 +17,7 @@ use crate::block::{
use crate::block::{ISizeConstraintSolution, MarginsMayCollapseFlag};
use crate::context::LayoutContext;
use crate::display_list::StackingContextCollectionState;
-use crate::display_list::{
- BlockFlowDisplayListBuilding, DisplayListBuildState, StackingContextCollectionFlags,
-};
+use crate::display_list::{DisplayListBuildState, StackingContextCollectionFlags};
use crate::floats::FloatKind;
use crate::flow::{Flow, FlowClass, FlowFlags, ImmutableFlowUtils, OpaqueFlow};
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index 47774b86ec3..aebfeebe440 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -75,7 +75,7 @@ use parking_lot::RwLock;
use profile_traits::mem::{self as profile_mem, Report, ReportKind, ReportsChan};
use profile_traits::time::{self as profile_time, profile, TimerMetadata};
use profile_traits::time::{TimerMetadataFrameType, TimerMetadataReflowType};
-use script_layout_interface::message::{Msg, LayoutThreadInit, NodesFromPointQueryType, Reflow};
+use script_layout_interface::message::{LayoutThreadInit, Msg, NodesFromPointQueryType, Reflow};
use script_layout_interface::message::{QueryMsg, ReflowComplete, ReflowGoal, ScriptReflow};
use script_layout_interface::rpc::TextIndexResponse;
use script_layout_interface::rpc::{LayoutRPC, OffsetParentResponse, StyleResponse};
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index fd08bb5f80c..99965a521a6 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -118,7 +118,7 @@ use net_traits::{
};
use profile_traits::mem::{self as profile_mem, OpaqueSender, ReportsChan};
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
-use script_layout_interface::message::{self, Msg, LayoutThreadInit, ReflowGoal};
+use script_layout_interface::message::{self, LayoutThreadInit, Msg, ReflowGoal};
use script_traits::webdriver_msg::WebDriverScriptCommand;
use script_traits::CompositorEvent::{
CompositionEvent, KeyboardEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent, TouchEvent,