Fix <br> support

This commit is contained in:
Matt Brubeck 2014-08-26 16:58:04 -07:00
parent f5ebd19c01
commit 024ce539fd
5 changed files with 26 additions and 2 deletions

View file

@ -1421,8 +1421,10 @@ impl Fragment {
pub fn can_merge_with_fragment(&self, other: &Fragment) -> bool {
match (&self.specific, &other.specific) {
(&UnscannedTextFragment(_), &UnscannedTextFragment(_)) => {
/// FIXME: Should probably use a whitelist of styles that can safely differ (#3165)
self.font_style() == other.font_style() &&
self.text_decoration() == other.text_decoration()
self.text_decoration() == other.text_decoration() &&
self.white_space() == other.white_space()
}
_ => false,
}

View file

@ -85,7 +85,7 @@ ol[type="i"] { list-style-type: lower-roman; }
ol[type="I"] { list-style-type: upper-roman; }
u, ins { text-decoration: underline }
br:before { content: "\A"; white-space: pre-line }
br:before { content: "\A"; white-space: pre }
center { text-align: center }
a:link,

View file

@ -1,4 +1,5 @@
== basic_width_px.html basic_width_em.html
== br.html br-ref.html
== hello_a.html hello_b.html
== margin_a.html margin_b.html
== root_pseudo_a.html root_pseudo_b.html

11
src/test/ref/br-ref.html Normal file
View file

@ -0,0 +1,11 @@
<!doctype HTML>
<html>
<head>
<meta charset="UTF-8">
<title>br reference</title>
</head>
<body>
<div>A</div>
<div>B</div>
</body>
</html>

10
src/test/ref/br.html Normal file
View file

@ -0,0 +1,10 @@
<!doctype HTML>
<html>
<head>
<meta charset="UTF-8">
<title>br test</title>
</head>
<body>
A<br>B
</body>
</html>