mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove dead code from layout.
This commit is contained in:
parent
de23fef9ca
commit
5ec1cdea9b
11 changed files with 4 additions and 116 deletions
|
@ -51,13 +51,6 @@ impl ApplicableDeclarations {
|
|||
normal_shareable: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clear(&mut self) {
|
||||
self.normal = SmallVec::new();
|
||||
self.before = Vec::new();
|
||||
self.after = Vec::new();
|
||||
self.normal_shareable = false;
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
|
@ -153,10 +153,6 @@ impl Floats {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.list.floats.len()
|
||||
}
|
||||
|
||||
/// Returns a rectangle that encloses the region from block-start to block-start + block-size,
|
||||
/// with inline-size small enough that it doesn't collide with any floats. max_x is the
|
||||
/// inline-size beyond which floats have no effect. (Generally this is the containing block
|
||||
|
|
|
@ -1430,11 +1430,6 @@ impl ContainingBlockLink {
|
|||
self.link = Some(Arc::downgrade(&link))
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn get(&mut self) -> &mut Option<WeakFlowRef> {
|
||||
&mut self.link
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn generated_containing_block_size(&self, for_flow: OpaqueFlow) -> LogicalSize<Au> {
|
||||
match self.link {
|
||||
|
@ -1483,8 +1478,4 @@ impl OpaqueFlow {
|
|||
OpaqueFlow(object.data as usize)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_base_flow(base_flow: &BaseFlow) -> OpaqueFlow {
|
||||
OpaqueFlow(base_flow as *const BaseFlow as usize)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,46 +22,6 @@ pub struct MutFlowListIterator<'a> {
|
|||
}
|
||||
|
||||
impl FlowList {
|
||||
/// Provide a reference to the front element, or None if the list is empty
|
||||
#[inline]
|
||||
pub fn front(&self) -> Option<&Flow> {
|
||||
self.flows.front().map(|head| &**head)
|
||||
}
|
||||
|
||||
/// Provide a mutable reference to the front element, or None if the list is empty
|
||||
#[inline]
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn front_mut(&mut self) -> Option<&mut Flow> {
|
||||
self.flows.front_mut().map(flow_ref::deref_mut)
|
||||
}
|
||||
|
||||
/// Provide a reference to the back element, or None if the list is empty
|
||||
#[inline]
|
||||
pub fn back(&self) -> Option<&Flow> {
|
||||
self.flows.back().map(|tail| &**tail)
|
||||
}
|
||||
|
||||
/// Provide a mutable reference to the back element, or None if the list is empty
|
||||
#[inline]
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn back_mut(&mut self) -> Option<&mut Flow> {
|
||||
self.flows.back_mut().map(flow_ref::deref_mut)
|
||||
}
|
||||
|
||||
/// Add an element first in the list
|
||||
///
|
||||
/// O(1)
|
||||
pub fn push_front(&mut self, new_head: FlowRef) {
|
||||
self.flows.push_front(new_head);
|
||||
}
|
||||
|
||||
/// Remove the first element and return it, or None if the list is empty
|
||||
///
|
||||
/// O(1)
|
||||
pub fn pop_front(&mut self) -> Option<FlowRef> {
|
||||
self.flows.pop_front()
|
||||
}
|
||||
|
||||
/// Add an element last in the list
|
||||
///
|
||||
/// O(1)
|
||||
|
|
|
@ -37,7 +37,7 @@ use std::sync::{Arc, Mutex};
|
|||
use string_cache::Atom;
|
||||
use style::computed_values::content::ContentItem;
|
||||
use style::computed_values::{border_collapse, clear, display, mix_blend_mode, overflow_wrap};
|
||||
use style::computed_values::{overflow_x, position, text_align, text_decoration, transform_style};
|
||||
use style::computed_values::{overflow_x, position, text_decoration, transform_style};
|
||||
use style::computed_values::{white_space, word_break, z_index};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
|
@ -812,11 +812,6 @@ impl Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn reset_inline_sizes(&mut self) {
|
||||
self.border_padding = LogicalMargin::zero(self.style.writing_mode);
|
||||
self.margin = LogicalMargin::zero(self.style.writing_mode);
|
||||
}
|
||||
|
||||
/// Returns a debug ID of this fragment. This ID should not be considered stable across
|
||||
/// multiple layouts or fragment manipulations.
|
||||
pub fn debug_id(&self) -> u16 {
|
||||
|
@ -1239,12 +1234,6 @@ impl Fragment {
|
|||
&*self.style
|
||||
}
|
||||
|
||||
/// Returns the text alignment of the computed style of the nearest ancestor-or-self `Element`
|
||||
/// node.
|
||||
pub fn text_align(&self) -> text_align::T {
|
||||
self.style().get_inheritedtext().text_align
|
||||
}
|
||||
|
||||
pub fn white_space(&self) -> white_space::T {
|
||||
self.style().get_inheritedtext().white_space
|
||||
}
|
||||
|
|
|
@ -804,16 +804,6 @@ impl InlineFragments {
|
|||
self.fragments.is_empty()
|
||||
}
|
||||
|
||||
/// Pushes a new inline fragment.
|
||||
pub fn push(&mut self, fragment: &mut Fragment) {
|
||||
self.fragments.push(fragment.clone());
|
||||
}
|
||||
|
||||
/// Merges another set of inline fragments with this one.
|
||||
pub fn push_all(&mut self, mut other: InlineFragments) {
|
||||
self.fragments.append(&mut other.fragments);
|
||||
}
|
||||
|
||||
/// A convenience function to return the fragment at a given index.
|
||||
pub fn get(&self, index: usize) -> &Fragment {
|
||||
&self.fragments[index]
|
||||
|
|
|
@ -44,12 +44,6 @@ fn null_unsafe_flow() -> UnsafeFlow {
|
|||
(0, 0)
|
||||
}
|
||||
|
||||
pub fn owned_flow_to_unsafe_flow(flow: *const FlowRef) -> UnsafeFlow {
|
||||
unsafe {
|
||||
mem::transmute::<&Flow, UnsafeFlow>(&**flow)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn mut_owned_flow_to_unsafe_flow(flow: *mut FlowRef) -> UnsafeFlow {
|
||||
unsafe {
|
||||
mem::transmute::<&Flow, UnsafeFlow>(&**flow)
|
||||
|
@ -62,12 +56,6 @@ pub fn borrowed_flow_to_unsafe_flow(flow: &Flow) -> UnsafeFlow {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn mut_borrowed_flow_to_unsafe_flow(flow: &mut Flow) -> UnsafeFlow {
|
||||
unsafe {
|
||||
mem::transmute::<&Flow, UnsafeFlow>(flow)
|
||||
}
|
||||
}
|
||||
|
||||
/// Information that we need stored in each DOM node.
|
||||
pub struct DomParallelInfo {
|
||||
/// The number of children that still need work done.
|
||||
|
|
|
@ -632,13 +632,6 @@ impl ColumnIntrinsicInlineSize {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns the true minimum size of this column, given the containing block's inline size.
|
||||
/// Beware that this is generally only correct for fixed table layout. (Compare CSS 2.1 §
|
||||
/// 17.5.2.1 with the algorithm in INTRINSIC § 4.)
|
||||
pub fn minimum(&self, containing_block_inline_size: Au) -> Au {
|
||||
cmp::max(self.minimum_length, containing_block_inline_size.scale_by(self.percentage))
|
||||
}
|
||||
|
||||
/// Returns the higher of the two percentages specified in `self` and `other`.
|
||||
pub fn greatest_percentage(&self, other: &ColumnIntrinsicInlineSize) -> CSSFloat {
|
||||
if self.percentage > other.percentage {
|
||||
|
|
|
@ -95,10 +95,6 @@ impl TableRowFlow {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn fragment(&mut self) -> &Fragment {
|
||||
&self.block_flow.fragment
|
||||
}
|
||||
|
||||
/// Assign block-size for table-row flow.
|
||||
///
|
||||
/// TODO(pcwalton): This doesn't handle floats and positioned elements right.
|
||||
|
@ -538,6 +534,9 @@ impl Encodable for CollapsedBorder {
|
|||
///
|
||||
/// The integer values here correspond to the border conflict resolution rules in CSS 2.1 §
|
||||
/// 17.6.2.1. Higher values override lower values.
|
||||
// FIXME(#8586): FromTableRow, FromTableRowGroup, FromTableColumn,
|
||||
// FromTableColumnGroup are unused
|
||||
#[allow(dead_code)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable)]
|
||||
pub enum CollapsedBorderProvenance {
|
||||
FromPreviousTableCell = 6,
|
||||
|
|
|
@ -78,10 +78,6 @@ impl TableRowGroupFlow {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn fragment(&mut self) -> &Fragment {
|
||||
&self.block_flow.fragment
|
||||
}
|
||||
|
||||
pub fn populate_collapsed_border_spacing<'a, I>(
|
||||
&mut self,
|
||||
collapsed_inline_direction_border_widths_for_table: &[Au],
|
||||
|
|
|
@ -672,13 +672,6 @@ impl<T> PseudoElementType<T> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_after(&self) -> bool {
|
||||
match *self {
|
||||
PseudoElementType::After(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn strip(&self) -> PseudoElementType<()> {
|
||||
match *self {
|
||||
PseudoElementType::Normal => PseudoElementType::Normal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue