mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Merge pull request #2785 from glennw/content-font-size
Make pseudo :before and :after elements inherit style from attached
This commit is contained in:
commit
a9e5457588
4 changed files with 34 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
17
src/test/ref/pseudo_inherit.html
Normal file
17
src/test/ref/pseudo_inherit.html
Normal 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>
|
14
src/test/ref/pseudo_inherit_ref.html
Normal file
14
src/test/ref/pseudo_inherit_ref.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue