mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
layout: Handle floated blocks with percentage heights correctly.
Improves the top menu in Wikipedia.
This commit is contained in:
parent
39d7bf93d6
commit
0604d0c6b1
4 changed files with 29 additions and 1 deletions
|
@ -1094,7 +1094,9 @@ impl BlockFlow {
|
|||
self.fragment.border_box.start.b = self.fragment.margin.block_start;
|
||||
|
||||
// Calculate content block-size, taking `min-block-size` and `max-block-size` into account.
|
||||
let mut candidate_block_size_iterator = CandidateBSizeIterator::new(self.fragment.style(), None);
|
||||
let mut candidate_block_size_iterator =
|
||||
CandidateBSizeIterator::new(self.fragment.style(),
|
||||
self.base.block_container_explicit_block_size);
|
||||
for candidate_block_size in candidate_block_size_iterator {
|
||||
candidate_block_size_iterator.candidate_value = match candidate_block_size {
|
||||
Auto => content_block_size,
|
||||
|
|
|
@ -135,3 +135,4 @@ flaky_gpu,flaky_linux == acid2_noscroll.html acid2_ref_broken.html
|
|||
== img_block_display_a.html img_block_display_ref.html
|
||||
== after_block_iteration.html after_block_iteration_ref.html
|
||||
== inline_block_percentage_height_a.html inline_block_percentage_height_ref.html
|
||||
== percentage_height_float_a.html percentage_height_float_ref.html
|
||||
|
|
12
tests/ref/percentage_height_float_a.html
Normal file
12
tests/ref/percentage_height_float_a.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Goodbye</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height: 100px;">
|
||||
<div style="float: left; height: 100%; background: red;">x</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
13
tests/ref/percentage_height_float_ref.html
Normal file
13
tests/ref/percentage_height_float_ref.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Goodbye</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height: 100px;">
|
||||
<div style="float: left; height: 100px; background: red;">x</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue