style: Miscellaneous Servo build fixes.

This commit is contained in:
Emilio Cobos Álvarez 2020-02-10 16:50:40 +01:00
parent 18cda1567a
commit e227715aee
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
12 changed files with 59 additions and 10 deletions

View file

@ -840,7 +840,10 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
match text_content {
TextContent::Text(string) => {
let info = Box::new(UnscannedTextFragmentInfo::new(string, node.selection()));
let info = Box::new(UnscannedTextFragmentInfo::new(
string.into(),
node.selection(),
));
let specific_fragment_info = SpecificFragmentInfo::UnscannedText(info);
fragments
.fragments
@ -857,7 +860,8 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
for content_item in content_items.into_iter() {
let specific_fragment_info = match content_item {
ContentItem::String(string) => {
let info = Box::new(UnscannedTextFragmentInfo::new(string, None));
let info =
Box::new(UnscannedTextFragmentInfo::new(string.into(), None));
SpecificFragmentInfo::UnscannedText(info)
},
content_item => {

View file

@ -95,7 +95,7 @@ impl ToLayout for TransformStyle {
type Type = wr::TransformStyle;
fn to_layout(&self) -> Self::Type {
match *self {
TransformStyle::Auto | TransformStyle::Flat => wr::TransformStyle::Flat,
TransformStyle::Flat => wr::TransformStyle::Flat,
TransformStyle::Preserve3d => wr::TransformStyle::Preserve3D,
}
}

View file

@ -309,7 +309,7 @@ impl Flow for TableFlow {
percentage: match *specified_inline_size {
Size::Auto => 0.0,
Size::LengthPercentage(ref lp) => {
lp.0.as_percentage().map_or(0.0, |p| p.0)
lp.0.to_percentage().map_or(0.0, |p| p.0)
},
},
preferred: Au(0),

View file

@ -437,7 +437,7 @@ impl Flow for TableRowFlow {
.unwrap_or(child_base.intrinsic_inline_sizes.minimum_inline_size),
percentage: match child_specified_inline_size {
Size::Auto => 0.0,
Size::LengthPercentage(ref lp) => lp.0.as_percentage().map_or(0.0, |p| p.0),
Size::LengthPercentage(ref lp) => lp.0.to_percentage().map_or(0.0, |p| p.0),
},
preferred: child_base.intrinsic_inline_sizes.preferred_inline_size,
constrained: match child_specified_inline_size {