Skip to content

Commit

Permalink
Fix wrong calculation of inline element's block size
Browse files Browse the repository at this point in the history
  • Loading branch information
canova committed Aug 22, 2016
1 parent 4e7c689 commit a14f6cb
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 44 deletions.
6 changes: 2 additions & 4 deletions components/layout/fragment.rs
Expand Up @@ -2008,10 +2008,8 @@ impl Fragment {
let font_derived_metrics =
InlineMetrics::from_font_metrics(&info.run.font_metrics, line_height);
InlineMetrics {
block_size_above_baseline: font_derived_metrics.block_size_above_baseline +
self.border_padding.block_start,
depth_below_baseline: font_derived_metrics.depth_below_baseline +
self.border_padding.block_end,
block_size_above_baseline: font_derived_metrics.block_size_above_baseline,
depth_below_baseline: font_derived_metrics.depth_below_baseline,
ascent: font_derived_metrics.ascent + self.border_padding.block_start,
}
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,3 +1,4 @@
[c5510-ipadn-000.htm]
type: reftest
expected: FAIL
expected:
if os != "mac": FAIL

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

24 changes: 24 additions & 0 deletions tests/wpt/mozilla/meta/MANIFEST.json
Expand Up @@ -2616,6 +2616,18 @@
"url": "/_mozilla/css/inline_element_border_a.html"
}
],
"css/inline_element_padding_margin.html": [
{
"path": "css/inline_element_padding_margin.html",
"references": [
[
"/_mozilla/css/inline_element_padding_margin_ref.html",
"=="
]
],
"url": "/_mozilla/css/inline_element_padding_margin.html"
}
],
"css/inline_font_size_zero_a.html": [
{
"path": "css/inline_font_size_zero_a.html",
Expand Down Expand Up @@ -11872,6 +11884,18 @@
"url": "/_mozilla/css/inline_element_border_a.html"
}
],
"css/inline_element_padding_margin.html": [
{
"path": "css/inline_element_padding_margin.html",
"references": [
[
"/_mozilla/css/inline_element_padding_margin_ref.html",
"=="
]
],
"url": "/_mozilla/css/inline_element_padding_margin.html"
}
],
"css/inline_font_size_zero_a.html": [
{
"path": "css/inline_font_size_zero_a.html",
Expand Down
21 changes: 21 additions & 0 deletions tests/wpt/mozilla/tests/css/inline_element_padding_margin.html
@@ -0,0 +1,21 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Border, padding and margin properties' top and bottom values of inline elements shouldn't affect element's height</title>
<link rel="match" href="inline_element_padding_margin_ref.html">
<style>
a {
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
padding: 20px 0;
margin: 20px 0;
}
</style>
</head>
<body>
<a href="#">foo</a>
<br>
bar
</body>
</html>
12 changes: 12 additions & 0 deletions tests/wpt/mozilla/tests/css/inline_element_padding_margin_ref.html
@@ -0,0 +1,12 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Border, padding and margin properties' top and bottom values of inline elements shouldn't affect element's height</title>
</head>
<body>
<a href="#">foo</a>
<br>
bar
</body>
</html>

0 comments on commit a14f6cb

Please sign in to comment.