Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout: Modify styles for replaced content as appropriate during incremental flow construction. #6492

Merged
merged 4 commits into from Jul 7, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1171,7 +1171,12 @@ pub trait ToAzureRect {

impl ToAzureRect for Rect<Au> {
fn to_nearest_azure_rect(&self) -> Rect<AzFloat> {
Rect::new(self.origin.to_nearest_azure_point(), self.size.to_nearest_azure_size())
let top_left = self.origin.to_nearest_azure_point();
let bottom_right = self.bottom_right().to_nearest_azure_point();
Rect::new(top_left,
Size2D::new((bottom_right.x - top_left.x) as AzFloat,
(bottom_right.y - top_left.y) as AzFloat))

}
fn to_azure_rect(&self) -> Rect<AzFloat> {
Rect::new(self.origin.to_azure_point(), Size2D::new(self.size.width.to_f32_px(),
@@ -1249,7 +1249,7 @@ impl<'a> FlowConstructor<'a> {

let mut layout_data_ref = node.mutate_layout_data();
let layout_data = layout_data_ref.as_mut().expect("no layout data");
let style = (*node.get_style(&layout_data)).clone();
let mut style = (*node.get_style(&layout_data)).clone();
let damage = layout_data.data.restyle_damage;
match node.construction_result_mut(layout_data) {
&mut ConstructionResult::None => true,
@@ -1297,8 +1297,10 @@ impl<'a> FlowConstructor<'a> {
.repair_style_and_bubble_inline_sizes(&style);
}
_ => {
if node.is_replaced_content() {
properties::modify_style_for_replaced_content(&mut style);
}
fragment.repair_style(&style);
return true
}
}
}
@@ -208,6 +208,19 @@ impl SpecificFragmentInfo {
}
}

impl fmt::Debug for SpecificFragmentInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
SpecificFragmentInfo::ScannedText(ref info) => {
write!(f, " \"{}\"", info.run.text.slice_chars(info.range.begin().get() as usize,
info.range.end().get() as usize));
}
_ => {}
}
Ok(())
}
}

/// Clamp a value obtained from style_length, based on min / max lengths.
fn clamp_size(size: Au,
min_size: LengthOrPercentage,
@@ -2120,10 +2133,11 @@ impl Fragment {
impl fmt::Debug for Fragment {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "({} {} ", self.debug_id(), self.specific.get_type()));
try!(write!(f, "bb {:?} bp {:?} m {:?}",
try!(write!(f, "bb {:?} bp {:?} m {:?}{:?}",
self.border_box,
self.border_padding,
self.margin));
self.margin,
self.specific));
write!(f, ")")
}
}
@@ -689,7 +689,10 @@ pub struct InlineFragments {

impl fmt::Debug for InlineFragments {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self.fragments)
for fragment in self.fragments.iter() {
try!(write!(f, "\n * {:?}", fragment))
}
Ok(())
}
}

@@ -169,6 +169,7 @@ experimental == iframe/size_attributes_vertical_writing_mode.html iframe/size_at
== inset.html inset_ref.html
!= inset_blackborder.html blackborder_ref.html
== issue-1324.html issue-1324-ref.html
== jumpiness_a.html jumpiness_ref.html
== last_child_pseudo_a.html last_child_pseudo_b.html
== last_of_type_pseudo_a.html last_of_type_pseudo_b.html
== legacy_cellspacing_attribute_a.html border_spacing_ref.html
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
body.hello {
text-decoration: underline;
}
</style>
</head>
<body>
a
<script>
setTimeout(function() {
document.body.classList.add('hello');
}, 0);
</script>
</body>
</html>

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
text-decoration: underline;
}
</style>
</head>
<body>
a
</body>
</html>


@@ -1,3 +1,4 @@
[block-in-inline-001.htm]
type: reftest
disabled: seems to assume ascent and block size above baseline are equal
expected: FAIL
@@ -1,3 +1,4 @@
[block-in-inline-002.htm]
type: reftest
disabled: seems to assume ascent and block size above baseline are equal
expected: FAIL

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,5 +1,3 @@
[position-relative-035.htm]
type: reftest
expected:
if (os == "mac") and (version == "OS X 10.8.5"): FAIL
if (os == "mac") and (version == "OS X 10.10.3"): FAIL
expected: FAIL
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.