layout: script: Fix build.

This commit is contained in:
Emilio Cobos Álvarez 2018-06-23 20:00:26 +02:00
parent 750c223021
commit 895946bb18
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
23 changed files with 141 additions and 98 deletions

View file

@ -1417,7 +1417,7 @@ impl BlockFlow {
// Per CSS 2.1 § 16.3.1, text alignment propagates to all children in flow.
//
// TODO(#2265, pcwalton): Do this in the cascade instead.
let containing_block_text_align = self.fragment.style().get_inheritedtext().text_align;
let containing_block_text_align = self.fragment.style().get_inherited_text().text_align;
kid.mut_base().flags.set_text_align(containing_block_text_align);
// Handle `text-indent` on behalf of any inline children that we have. This is
@ -1425,7 +1425,7 @@ impl BlockFlow {
// we know.
if kid.is_inline_flow() {
kid.as_mut_inline().first_line_indentation =
self.fragment.style().get_inheritedtext().text_indent
self.fragment.style().get_inherited_text().text_indent
.to_used_value(containing_block_size);
}
}
@ -2340,7 +2340,7 @@ pub trait ISizeAndMarginsComputer {
containing_block_inline_size),
MaybeAuto::from_style(position.inline_end,
containing_block_inline_size),
style.get_inheritedtext().text_align,
style.get_inherited_text().text_align,
available_inline_size)
}

View file

@ -1095,7 +1095,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
kid_flow.as_block()
.fragment
.style()
.get_inheritedtable()
.get_inherited_table()
.caption_side == side {
table_wrapper_flow.add_new_child(kid_flow);
}
@ -1256,7 +1256,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
// Determine if the table cell should be hidden. Per CSS 2.1 § 17.6.1.1, this will be true
// if the cell has any in-flow elements (even empty ones!) and has `empty-cells` set to
// `hide`.
let hide = node.style(self.style_context()).get_inheritedtable().empty_cells == EmptyCells::Hide &&
let hide = node.style(self.style_context()).get_inherited_table().empty_cells == EmptyCells::Hide &&
node.children().all(|kid| {
let position = kid.style(self.style_context()).get_box().position;
!kid.is_content() ||
@ -1871,7 +1871,7 @@ fn bidi_control_chars(style: &ServoArc<ComputedValues>) -> Option<(&'static str,
use style::computed_values::unicode_bidi::T::*;
let unicode_bidi = style.get_text().unicode_bidi;
let direction = style.get_inheritedbox().direction;
let direction = style.get_inherited_box().direction;
// See the table in http://dev.w3.org/csswg/css-writing-modes/#unicode-bidi
match (unicode_bidi, direction) {

View file

@ -1013,7 +1013,7 @@ impl FragmentDisplayListBuilding for Fragment {
id: webrender_image.key.unwrap(),
stretch_size: placement.tile_size.to_layout(),
tile_spacing: placement.tile_spacing.to_layout(),
image_rendering: style.get_inheritedbox().image_rendering.to_layout(),
image_rendering: style.get_inherited_box().image_rendering.to_layout(),
})));
});
}
@ -1581,7 +1581,7 @@ impl FragmentDisplayListBuilding for Fragment {
display_list_section: DisplayListSection,
clip: Rect<Au>,
) {
if self.style().get_inheritedbox().visibility != Visibility::Visible {
if self.style().get_inherited_box().visibility != Visibility::Visible {
return;
}
@ -1744,7 +1744,7 @@ impl FragmentDisplayListBuilding for Fragment {
state,
&text_fragment,
stacking_relative_content_box,
&self.style.get_inheritedtext().text_shadow.0,
&self.style.get_inherited_text().text_shadow.0,
clip,
);
@ -1765,7 +1765,7 @@ impl FragmentDisplayListBuilding for Fragment {
state,
&text_fragment,
stacking_relative_content_box,
&self.style.get_inheritedtext().text_shadow.0,
&self.style.get_inherited_text().text_shadow.0,
clip,
);
@ -1837,7 +1837,7 @@ impl FragmentDisplayListBuilding for Fragment {
stretch_size: stacking_relative_content_box.size.to_layout(),
tile_spacing: LayoutSize::zero(),
image_rendering: self.style
.get_inheritedbox()
.get_inherited_box()
.image_rendering
.to_layout(),
})));
@ -2005,7 +2005,7 @@ impl FragmentDisplayListBuilding for Fragment {
}
// Create display items for text decorations.
let text_decorations = self.style().get_inheritedtext().text_decorations_in_effect;
let text_decorations = self.style().get_inherited_text().text_decorations_in_effect;
let logical_stacking_relative_content_box = LogicalRect::from_physical(
self.style.writing_mode,
@ -3048,8 +3048,8 @@ impl ComputedValuesCursorUtility for ComputedValues {
#[inline]
fn get_cursor(&self, default_cursor: CursorKind) -> Option<CursorKind> {
match (
self.get_inheritedui().pointer_events,
&self.get_inheritedui().cursor,
self.get_inherited_ui().pointer_events,
&self.get_inherited_ui().cursor,
) {
(PointerEvents::None, _) => None,
(

View file

@ -561,7 +561,7 @@ impl FlexFlow {
.explicit_block_size(parent_container_size)
.map(|x| max(x - box_border, Au(0)));
let containing_block_text_align =
self.block_flow.fragment.style().get_inheritedtext().text_align;
self.block_flow.fragment.style().get_inherited_text().text_align;
while let Some(mut line) = self.get_flex_line(inline_size) {
let items = &mut self.items[line.range.clone()];

View file

@ -818,7 +818,7 @@ impl Fragment {
SpecificFragmentInfo::TableCell => {
let base_quantities = QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_PADDING |
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_SPECIFIED;
if self.style.get_inheritedtable().border_collapse ==
if self.style.get_inherited_table().border_collapse ==
BorderCollapse::Separate {
base_quantities | QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_BORDER
} else {
@ -828,7 +828,7 @@ impl Fragment {
SpecificFragmentInfo::TableWrapper => {
let base_quantities = QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_MARGINS |
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_SPECIFIED;
if self.style.get_inheritedtable().border_collapse ==
if self.style.get_inherited_table().border_collapse ==
BorderCollapse::Separate {
base_quantities | QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_BORDER
} else {
@ -838,7 +838,7 @@ impl Fragment {
SpecificFragmentInfo::TableRow => {
let base_quantities =
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_SPECIFIED;
if self.style.get_inheritedtable().border_collapse ==
if self.style.get_inherited_table().border_collapse ==
BorderCollapse::Separate {
base_quantities | QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_BORDER
} else {
@ -1272,7 +1272,7 @@ impl Fragment {
pub fn compute_border_and_padding(&mut self,
containing_block_inline_size: Au) {
// Compute border.
let border = match self.style.get_inheritedtable().border_collapse {
let border = match self.style.get_inherited_table().border_collapse {
BorderCollapse::Separate => self.border_width(),
BorderCollapse::Collapse => LogicalMargin::zero(self.style.writing_mode),
};
@ -1377,7 +1377,7 @@ impl Fragment {
}
pub fn white_space(&self) -> WhiteSpace {
self.style().get_inheritedtext().white_space
self.style().get_inherited_text().white_space
}
pub fn color(&self) -> Color {
@ -1625,12 +1625,12 @@ impl Fragment {
let mut flags = SplitOptions::empty();
if starts_line {
flags.insert(SplitOptions::STARTS_LINE);
if self.style().get_inheritedtext().overflow_wrap == OverflowWrap::BreakWord {
if self.style().get_inherited_text().overflow_wrap == OverflowWrap::BreakWord {
flags.insert(SplitOptions::RETRY_AT_CHARACTER_BOUNDARIES)
}
}
match self.style().get_inheritedtext().word_break {
match self.style().get_inherited_text().word_break {
WordBreak::Normal | WordBreak::KeepAll => {
// Break at normal word boundaries. keep-all forbids soft wrap opportunities.
let natural_word_breaking_strategy =

View file

@ -934,7 +934,7 @@ impl InlineFlow {
if fragments.fragments.is_empty() {
return
}
let text_justify = fragments.fragments[0].style().get_inheritedtext().text_justify;
let text_justify = fragments.fragments[0].style().get_inherited_text().text_justify;
// Translate `left` and `right` to logical directions.
let is_ltr = fragments.fragments[0].style().writing_mode.is_bidi_ltr();
@ -1341,7 +1341,7 @@ impl Flow for InlineFlow {
let mut intrinsic_sizes_for_nonbroken_run = IntrinsicISizesContribution::new();
for fragment in &mut self.fragments.fragments {
let intrinsic_sizes_for_fragment = fragment.compute_intrinsic_inline_sizes().finish();
match fragment.style.get_inheritedtext().white_space {
match fragment.style.get_inherited_text().white_space {
WhiteSpace::Nowrap => {
intrinsic_sizes_for_nonbroken_run.union_nonbreaking_inline(
&intrinsic_sizes_for_fragment)

View file

@ -959,7 +959,7 @@ fn inner_text_collection_steps<N: LayoutNode>(node: N,
};
// Step 2.
if style.get_inheritedbox().visibility != Visibility::Visible {
if style.get_inherited_box().visibility != Visibility::Visible {
continue;
}

View file

@ -191,8 +191,8 @@ impl TableFlow {
/// Returns the effective spacing per cell, taking the value of `border-collapse` into account.
pub fn spacing(&self) -> border_spacing::T {
let style = self.block_flow.fragment.style();
match style.get_inheritedtable().border_collapse {
border_collapse::T::Separate => style.get_inheritedtable().border_spacing,
match style.get_inherited_table().border_collapse {
border_collapse::T::Separate => style.get_inherited_table().border_spacing,
border_collapse::T::Collapse => border_spacing::T::zero(),
}
}
@ -298,7 +298,7 @@ impl Flow for TableFlow {
let collapsing_borders = self.block_flow
.fragment
.style
.get_inheritedtable()
.get_inherited_table()
.border_collapse == border_collapse::T::Collapse;
let table_inline_collapsed_borders = if collapsing_borders {
Some(TableInlineCollapsedBorders {
@ -522,7 +522,7 @@ impl Flow for TableFlow {
let border_painting_mode = match self.block_flow
.fragment
.style
.get_inheritedtable()
.get_inherited_table()
.border_collapse {
border_collapse::T::Separate => BorderPaintingMode::Separate,
border_collapse::T::Collapse => BorderPaintingMode::Hidden,
@ -771,12 +771,12 @@ pub trait TableLikeFlow {
impl TableLikeFlow for BlockFlow {
fn assign_block_size_for_table_like_flow(&mut self, block_direction_spacing: Au,
layout_context: &LayoutContext) {
debug_assert!(self.fragment.style.get_inheritedtable().border_collapse ==
debug_assert!(self.fragment.style.get_inherited_table().border_collapse ==
border_collapse::T::Separate || block_direction_spacing == Au(0));
fn border_spacing_for_row(fragment: &Fragment, row: &TableRowFlow,
block_direction_spacing: Au) -> Au {
match fragment.style.get_inheritedtable().border_collapse {
match fragment.style.get_inherited_table().border_collapse {
border_collapse::T::Separate => block_direction_spacing,
border_collapse::T::Collapse => {
row.collapsed_border_spacing.block_start
@ -1204,13 +1204,13 @@ impl<'table> TableCellStyleInfo<'table> {
use style::computed_values::visibility::T as Visibility;
if !self.cell.visible || self.cell.block_flow.fragment.style()
.get_inheritedbox().visibility != Visibility::Visible {
.get_inherited_box().visibility != Visibility::Visible {
return
}
let border_painting_mode = match self.cell.block_flow
.fragment
.style
.get_inheritedtable()
.get_inherited_table()
.border_collapse {
border_collapse::T::Separate => BorderPaintingMode::Separate,
border_collapse::T::Collapse => BorderPaintingMode::Collapse(&self.cell.collapsed_borders),

View file

@ -353,7 +353,7 @@ impl Flow for TableRowFlow {
let collapsing_borders = self.block_flow
.fragment
.style()
.get_inheritedtable()
.get_inherited_table()
.border_collapse == BorderCollapse::Collapse;
let row_style = &*self.block_flow.fragment.style;
self.preliminary_collapsed_borders.reset(
@ -500,7 +500,7 @@ impl Flow for TableRowFlow {
// Set up border collapse info.
let border_collapse_info =
match self.block_flow.fragment.style().get_inheritedtable().border_collapse {
match self.block_flow.fragment.style().get_inherited_table().border_collapse {
BorderCollapse::Collapse => {
Some(BorderCollapseInfoForChildTableCell {
collapsed_borders_for_row: &self.final_collapsed_borders,

View file

@ -130,7 +130,7 @@ impl Flow for TableRowGroupFlow {
let (inline_start_content_edge, inline_end_content_edge) = (Au(0), Au(0));
let content_inline_size = containing_block_inline_size;
let border_collapse = self.block_flow.fragment.style.get_inheritedtable().border_collapse;
let border_collapse = self.block_flow.fragment.style.get_inherited_table().border_collapse;
let inline_size_computer = InternalTable;
inline_size_computer.compute_used_inline_size(&mut self.block_flow,
shared_context,

View file

@ -170,7 +170,7 @@ impl TextRunScanner {
{
let in_fragment = self.clump.front().unwrap();
let font_style = in_fragment.style().clone_font();
let inherited_text_style = in_fragment.style().get_inheritedtext();
let inherited_text_style = in_fragment.style().get_inherited_text();
font_group = font_context.font_group(font_style);
compression = match in_fragment.white_space() {
WhiteSpace::Normal |
@ -477,7 +477,7 @@ pub fn font_metrics_for_style(mut font_context: &mut LayoutFontContext, style: :
/// Returns the line block-size needed by the given computed style and font size.
pub fn line_height_from_style(style: &ComputedValues, metrics: &FontMetrics) -> Au {
let font_size = style.get_font().font_size.size();
match style.get_inheritedtext().line_height {
match style.get_inherited_text().line_height {
LineHeight::Normal => Au::from(metrics.line_gap),
LineHeight::Number(l) => font_size.scale_by(l.0),
LineHeight::Length(l) => Au::from(l)