Merge pull request #2785 from glennw/content-font-size

Make pseudo :before and :after elements inherit style from attached
This commit is contained in:
Simon Sapin 2014-07-08 18:23:16 +01:00
commit a9e5457588
4 changed files with 34 additions and 2 deletions

View file

@ -553,14 +553,14 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
applicable_declarations_cache,
applicable_declarations.normal_shareable);
if applicable_declarations.before.len() > 0 {
self.cascade_node_pseudo_element(parent_style,
self.cascade_node_pseudo_element(Some(layout_data.shared_data.style.get_ref()),
applicable_declarations.before.as_slice(),
&mut layout_data.data.before_style,
applicable_declarations_cache,
false);
}
if applicable_declarations.after.len() > 0 {
self.cascade_node_pseudo_element(parent_style,
self.cascade_node_pseudo_element(Some(layout_data.shared_data.style.get_ref()),
applicable_declarations.after.as_slice(),
&mut layout_data.data.after_style,
applicable_declarations_cache,

View file

@ -82,3 +82,4 @@
== position_fixed_background_color_a.html position_fixed_background_color_b.html
== position_fixed_overflow_a.html position_fixed_overflow_b.html
== noscript.html noscript_ref.html
== pseudo_inherit.html pseudo_inherit_ref.html

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
p:before {
content: "A";
}
.big {
font-size: 128px;
}
</style>
</head>
<body style="color: red; font-size: 64px;">
<p style="color: green;" class="big">B</p>
</body>
</html>

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
.big {
font-size: 128px;
}
</style>
</head>
<body>
<p style="color: green;" class="big">AB</p>
</body>
</html>