mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d.
This commit is contained in:
parent
b8900782b0
commit
466faac2a5
223 changed files with 4414 additions and 4105 deletions
|
@ -28,12 +28,11 @@
|
|||
use css::node_style::StyledNode;
|
||||
use block::BlockFlow;
|
||||
use context::LayoutContext;
|
||||
use display_list_builder::{DisplayListBuildingResult, DisplayListResult};
|
||||
use display_list_builder::{NoDisplayListBuildingResult, StackingContextResult};
|
||||
use display_list_builder::DisplayListBuildingResult;
|
||||
use floats::Floats;
|
||||
use flow_list::{FlowList, FlowListIterator, MutFlowListIterator};
|
||||
use flow_ref::FlowRef;
|
||||
use fragment::{Fragment, FragmentBoundsIterator, TableRowFragment, TableCellFragment};
|
||||
use fragment::{Fragment, FragmentBoundsIterator, SpecificFragmentInfo};
|
||||
use incremental::{RECONSTRUCT_FLOW, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage};
|
||||
use inline::InlineFlow;
|
||||
use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo};
|
||||
|
@ -428,16 +427,16 @@ pub trait MutableOwnedFlowUtils {
|
|||
|
||||
#[deriving(Encodable, PartialEq, Show)]
|
||||
pub enum FlowClass {
|
||||
BlockFlowClass,
|
||||
InlineFlowClass,
|
||||
ListItemFlowClass,
|
||||
TableWrapperFlowClass,
|
||||
TableFlowClass,
|
||||
TableColGroupFlowClass,
|
||||
TableRowGroupFlowClass,
|
||||
TableRowFlowClass,
|
||||
TableCaptionFlowClass,
|
||||
TableCellFlowClass,
|
||||
Block,
|
||||
Inline,
|
||||
ListItem,
|
||||
TableWrapper,
|
||||
Table,
|
||||
TableColGroup,
|
||||
TableRowGroup,
|
||||
TableRow,
|
||||
TableCaption,
|
||||
TableCell,
|
||||
}
|
||||
|
||||
/// A top-down traversal.
|
||||
|
@ -810,13 +809,13 @@ impl<E, S: Encoder<E>> Encodable<S, E> for BaseFlow {
|
|||
try!(e.emit_struct_field("class", 0, |e| c.class().encode(e)))
|
||||
e.emit_struct_field("data", 1, |e| {
|
||||
match c.class() {
|
||||
BlockFlowClass => c.as_immutable_block().encode(e),
|
||||
InlineFlowClass => c.as_immutable_inline().encode(e),
|
||||
TableFlowClass => c.as_immutable_table().encode(e),
|
||||
TableWrapperFlowClass => c.as_immutable_table_wrapper().encode(e),
|
||||
TableRowGroupFlowClass => c.as_immutable_table_rowgroup().encode(e),
|
||||
TableRowFlowClass => c.as_immutable_table_row().encode(e),
|
||||
TableCellFlowClass => c.as_immutable_table_cell().encode(e),
|
||||
FlowClass::Block => c.as_immutable_block().encode(e),
|
||||
FlowClass::Inline => c.as_immutable_inline().encode(e),
|
||||
FlowClass::Table => c.as_immutable_table().encode(e),
|
||||
FlowClass::TableWrapper => c.as_immutable_table_wrapper().encode(e),
|
||||
FlowClass::TableRowGroup => c.as_immutable_table_rowgroup().encode(e),
|
||||
FlowClass::TableRow => c.as_immutable_table_row().encode(e),
|
||||
FlowClass::TableCell => c.as_immutable_table_cell().encode(e),
|
||||
_ => { Ok(()) } // TODO: Support captions
|
||||
}
|
||||
})
|
||||
|
@ -869,7 +868,7 @@ impl BaseFlow {
|
|||
_ => {}
|
||||
}
|
||||
|
||||
if force_nonfloated == FloatIfNecessary {
|
||||
if force_nonfloated == ForceNonfloatedFlag::FloatIfNecessary {
|
||||
match node_style.get_box().float {
|
||||
float::none => {}
|
||||
float::left => flags.insert(FLOATS_LEFT),
|
||||
|
@ -910,7 +909,7 @@ impl BaseFlow {
|
|||
block_container_inline_size: Au(0),
|
||||
block_container_explicit_block_size: None,
|
||||
absolute_cb: ContainingBlockLink::new(),
|
||||
display_list_building_result: NoDisplayListBuildingResult,
|
||||
display_list_building_result: DisplayListBuildingResult::None,
|
||||
absolute_position_info: AbsolutePositionInfo::new(writing_mode),
|
||||
clip_rect: Rect(Zero::zero(), Size2D(Au(0), Au(0))),
|
||||
flags: flags,
|
||||
|
@ -940,11 +939,11 @@ impl BaseFlow {
|
|||
position_with_overflow.size.block));
|
||||
|
||||
let all_items = match self.display_list_building_result {
|
||||
NoDisplayListBuildingResult => Vec::new(),
|
||||
StackingContextResult(ref stacking_context) => {
|
||||
DisplayListBuildingResult::None => Vec::new(),
|
||||
DisplayListBuildingResult::StackingContext(ref stacking_context) => {
|
||||
stacking_context.display_list.all_display_items()
|
||||
}
|
||||
DisplayListResult(ref display_list) => display_list.all_display_items(),
|
||||
DisplayListBuildingResult::Normal(ref display_list) => display_list.all_display_items(),
|
||||
};
|
||||
|
||||
for item in all_items.iter() {
|
||||
|
@ -979,7 +978,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is a block flow.
|
||||
fn is_block_like(self) -> bool {
|
||||
match self.class() {
|
||||
BlockFlowClass => true,
|
||||
FlowClass::Block => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -989,8 +988,8 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// table-column-group flow, or table-caption flow.
|
||||
fn is_proper_table_child(self) -> bool {
|
||||
match self.class() {
|
||||
TableRowFlowClass | TableRowGroupFlowClass |
|
||||
TableColGroupFlowClass | TableCaptionFlowClass => true,
|
||||
FlowClass::TableRow | FlowClass::TableRowGroup |
|
||||
FlowClass::TableColGroup | FlowClass::TableCaption => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -998,7 +997,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is a table row flow.
|
||||
fn is_table_row(self) -> bool {
|
||||
match self.class() {
|
||||
TableRowFlowClass => true,
|
||||
FlowClass::TableRow => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1006,7 +1005,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is a table cell flow.
|
||||
fn is_table_cell(self) -> bool {
|
||||
match self.class() {
|
||||
TableCellFlowClass => true,
|
||||
FlowClass::TableCell => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1014,7 +1013,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is a table colgroup flow.
|
||||
fn is_table_colgroup(self) -> bool {
|
||||
match self.class() {
|
||||
TableColGroupFlowClass => true,
|
||||
FlowClass::TableColGroup => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1022,7 +1021,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is a table flow.
|
||||
fn is_table(self) -> bool {
|
||||
match self.class() {
|
||||
TableFlowClass => true,
|
||||
FlowClass::Table => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1030,7 +1029,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is a table caption flow.
|
||||
fn is_table_caption(self) -> bool {
|
||||
match self.class() {
|
||||
TableCaptionFlowClass => true,
|
||||
FlowClass::TableCaption => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1038,7 +1037,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is a table rowgroup flow.
|
||||
fn is_table_rowgroup(self) -> bool {
|
||||
match self.class() {
|
||||
TableRowGroupFlowClass => true,
|
||||
FlowClass::TableRowGroup => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1046,9 +1045,9 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is one of table-related flows.
|
||||
fn is_table_kind(self) -> bool {
|
||||
match self.class() {
|
||||
TableWrapperFlowClass | TableFlowClass |
|
||||
TableColGroupFlowClass | TableRowGroupFlowClass |
|
||||
TableRowFlowClass | TableCaptionFlowClass | TableCellFlowClass => true,
|
||||
FlowClass::TableWrapper | FlowClass::Table |
|
||||
FlowClass::TableColGroup | FlowClass::TableRowGroup |
|
||||
FlowClass::TableRow | FlowClass::TableCaption | FlowClass::TableCell => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1057,9 +1056,9 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Spec: http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes
|
||||
fn need_anonymous_flow(self, child: &Flow) -> bool {
|
||||
match self.class() {
|
||||
TableFlowClass => !child.is_proper_table_child(),
|
||||
TableRowGroupFlowClass => !child.is_table_row(),
|
||||
TableRowFlowClass => !child.is_table_cell(),
|
||||
FlowClass::Table => !child.is_proper_table_child(),
|
||||
FlowClass::TableRowGroup => !child.is_table_row(),
|
||||
FlowClass::TableRow => !child.is_table_cell(),
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
@ -1067,12 +1066,12 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Generates missing child flow of this flow.
|
||||
fn generate_missing_child_flow(self, node: &ThreadSafeLayoutNode) -> FlowRef {
|
||||
let flow = match self.class() {
|
||||
TableFlowClass | TableRowGroupFlowClass => {
|
||||
let fragment = Fragment::new_anonymous_table_fragment(node, TableRowFragment);
|
||||
FlowClass::Table | FlowClass::TableRowGroup => {
|
||||
let fragment = Fragment::new_anonymous_table_fragment(node, SpecificFragmentInfo::TableRow);
|
||||
box TableRowFlow::from_node_and_fragment(node, fragment) as Box<Flow>
|
||||
},
|
||||
TableRowFlowClass => {
|
||||
let fragment = Fragment::new_anonymous_table_fragment(node, TableCellFragment);
|
||||
FlowClass::TableRow => {
|
||||
let fragment = Fragment::new_anonymous_table_fragment(node, SpecificFragmentInfo::TableCell);
|
||||
box TableCellFlow::from_node_and_fragment(node, fragment) as Box<Flow>
|
||||
},
|
||||
_ => {
|
||||
|
@ -1101,7 +1100,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
fn is_block_container(self) -> bool {
|
||||
match self.class() {
|
||||
// TODO: Change this when inline-blocks are supported.
|
||||
BlockFlowClass | TableCaptionFlowClass | TableCellFlowClass => {
|
||||
FlowClass::Block | FlowClass::TableCaption | FlowClass::TableCell => {
|
||||
// FIXME: Actually check the type of the node
|
||||
self.child_count() != 0
|
||||
}
|
||||
|
@ -1112,7 +1111,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is a block flow.
|
||||
fn is_block_flow(self) -> bool {
|
||||
match self.class() {
|
||||
BlockFlowClass => true,
|
||||
FlowClass::Block => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1120,7 +1119,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow + 'a {
|
|||
/// Returns true if this flow is an inline flow.
|
||||
fn is_inline_flow(self) -> bool {
|
||||
match self.class() {
|
||||
InlineFlowClass => true,
|
||||
FlowClass::Inline => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue