mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Replace the unsound impl DerefMut for FlowRef
with an unsafe function.
See #6503.
This commit is contained in:
parent
a5fbb2f2a6
commit
2d22aa8e7e
10 changed files with 112 additions and 81 deletions
|
@ -10,6 +10,7 @@ use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBui
|
|||
use floats::{FloatKind, Floats, PlacementInfo};
|
||||
use flow::{MutableFlowUtils, OpaqueFlow};
|
||||
use flow::{self, BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED};
|
||||
use flow_ref;
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
|
||||
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW, RESOLVE_GENERATED_CONTENT};
|
||||
use layout_debug;
|
||||
|
@ -1596,6 +1597,7 @@ impl Flow for InlineFlow {
|
|||
self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn compute_absolute_position(&mut self, _: &LayoutContext) {
|
||||
// First, gather up the positions of all the containing blocks (if any).
|
||||
//
|
||||
|
@ -1656,9 +1658,10 @@ impl Flow for InlineFlow {
|
|||
let is_positioned = fragment.is_positioned();
|
||||
match fragment.specific {
|
||||
SpecificFragmentInfo::InlineBlock(ref mut info) => {
|
||||
flow::mut_base(&mut *info.flow_ref).clip = clip;
|
||||
let flow = unsafe { flow_ref::deref_mut(&mut info.flow_ref) };
|
||||
flow::mut_base(flow).clip = clip;
|
||||
|
||||
let block_flow = info.flow_ref.as_mut_block();
|
||||
let block_flow = flow.as_mut_block();
|
||||
block_flow.base.absolute_position_info = self.base.absolute_position_info;
|
||||
|
||||
let stacking_relative_position = self.base.stacking_relative_position;
|
||||
|
@ -1676,9 +1679,9 @@ impl Flow for InlineFlow {
|
|||
self.base.stacking_relative_position_of_display_port;
|
||||
}
|
||||
SpecificFragmentInfo::InlineAbsoluteHypothetical(ref mut info) => {
|
||||
flow::mut_base(&mut *info.flow_ref).clip = clip;
|
||||
|
||||
let block_flow = info.flow_ref.as_mut_block();
|
||||
let flow = unsafe { flow_ref::deref_mut(&mut info.flow_ref) };
|
||||
flow::mut_base(flow).clip = clip;
|
||||
let block_flow = flow.as_mut_block();
|
||||
block_flow.base.absolute_position_info = self.base.absolute_position_info;
|
||||
|
||||
block_flow.base.stacking_relative_position =
|
||||
|
@ -1687,9 +1690,10 @@ impl Flow for InlineFlow {
|
|||
self.base.stacking_relative_position_of_display_port;
|
||||
}
|
||||
SpecificFragmentInfo::InlineAbsolute(ref mut info) => {
|
||||
flow::mut_base(&mut *info.flow_ref).clip = clip;
|
||||
let flow = unsafe { flow_ref::deref_mut(&mut info.flow_ref) };
|
||||
flow::mut_base(flow).clip = clip;
|
||||
|
||||
let block_flow = info.flow_ref.as_mut_block();
|
||||
let block_flow = flow.as_mut_block();
|
||||
block_flow.base.absolute_position_info = self.base.absolute_position_info;
|
||||
|
||||
let stacking_relative_position = self.base.stacking_relative_position;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue