Skip to content

Commit

Permalink
Merge pull request #3293 from pcwalton/floated-generated-content-crash
Browse files Browse the repository at this point in the history
layout: Don't crash on floated generated content.
  • Loading branch information
pcwalton committed Sep 12, 2014
2 parents 883fc2e + 41ffec0 commit 20cde10
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/layout/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,9 @@ impl<'a, 'b> PostorderNodeMutTraversal for FlowConstructor<'a, 'b> {
}

// Inline items contribute inline fragment construction results.
(display::inline, float::none, _) => {
//
// FIXME(pcwalton, #3307): This is not sufficient to handle floated generated content.
(display::inline, _, _) => {
let construction_result = self.build_fragments_for_inline(node);
node.set_flow_construction_result(construction_result)
}
Expand Down
1 change: 1 addition & 0 deletions tests/ref/basic.list
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,4 @@ flaky_gpu,flaky_linux == acid2_noscroll.html acid2_ref_broken.html

== iframe/simple.html iframe/simple_ref.html
== iframe/multiple_external.html iframe/multiple_external_ref.html
== floated_generated_content_a.html floated_generated_content_b.html
15 changes: 15 additions & 0 deletions tests/ref/floated_generated_content_a.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<style>
.stand:before {
content: "";
float: left;
}
</style>
</head>
<body>
<div class="stand">Toast! Toast! Toast!</div>
</body>
</html>

9 changes: 9 additions & 0 deletions tests/ref/floated_generated_content_b.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="stand">Toast! Toast! Toast!</div>
</body>
</html>

0 comments on commit 20cde10

Please sign in to comment.