Bug 1431031: Tests for calc() on font-size on various situations. r=Manishearth

It makes no sense to pass a custom base size of zero in presence of rem, ex, or
ch units.

MozReview-Commit-ID: 7ZZwRzQKREX
This commit is contained in:
Emilio Cobos Álvarez 2018-01-17 17:20:20 +01:00
Родитель 7ec737b816
Коммит faddf94080
5 изменённых файлов: 101 добавлений и 0 удалений

Просмотреть файл

@ -146383,6 +146383,18 @@
{}
]
],
"css/css-values/calc-ch-ex-lang.html": [
[
"/css/css-values/calc-ch-ex-lang.html",
[
[
"/css/css-values/calc-ch-ex-lang-ref.html",
"=="
]
],
{}
]
],
"css/css-values/calc-in-calc.html": [
[
"/css/css-values/calc-in-calc.html",
@ -146443,6 +146455,18 @@
{}
]
],
"css/css-values/calc-rem-lang.html": [
[
"/css/css-values/calc-rem-lang.html",
[
[
"/css/css-values/calc-rem-lang-ref.html",
"=="
]
],
{}
]
],
"css/css-values/ch-unit-001.html": [
[
"/css/css-values/ch-unit-001.html",
@ -253668,6 +253692,16 @@
{}
]
],
"css/css-values/calc-ch-ex-lang-ref.html": [
[
{}
]
],
"css/css-values/calc-rem-lang-ref.html": [
[
{}
]
],
"css/css-values/ex-calc-expression-001-ref.html": [
[
{}
@ -510100,6 +510134,14 @@
"70627dbbfc5af5fb859fdf1362f0004b38c64e34",
"reftest"
],
"css/css-values/calc-ch-ex-lang-ref.html": [
"218e1cb6782b554de35aad70913cddb8e7d71da2",
"support"
],
"css/css-values/calc-ch-ex-lang.html": [
"d15f42e237b281793ac808e06af92217d4f9593e",
"reftest"
],
"css/css-values/calc-in-calc.html": [
"be08a1510714e8b4fbc4d35582db5708924d06b2",
"reftest"
@ -510120,6 +510162,14 @@
"080551c1bee3d7bf54dda2c3d5b7e5a9fbd8aed6",
"reftest"
],
"css/css-values/calc-rem-lang-ref.html": [
"08bbc95f3078421a489e1e93cc7a4f035af40d5b",
"support"
],
"css/css-values/calc-rem-lang.html": [
"6fa668d2bcaf01f5c4680e3e14a0e86160d1b5d5",
"reftest"
],
"css/css-values/calc-unit-analysis.html": [
"c5fd567b4fa257ce53c48ebf8c444bf382459fec",
"testharness"

Просмотреть файл

@ -0,0 +1,12 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<style>
div {
width: calc(1ex + 1ch + 1em);
height: calc(1ex + 1ch + 1em);
background: green;
}
</style>
<div></div>

Просмотреть файл

@ -0,0 +1,16 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: Calc in font-size with ch / ex units across lang changes</title>
<link rel="help" href="https://drafts.csswg.org/css-values/#ch">
<link rel="help" href="https://drafts.csswg.org/css-values/#ex">
<link rel="help" href="https://drafts.csswg.org/css-values/#funcdef-calc">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1431031">
<link rel="match" href="calc-ch-ex-lang-ref.html">
<style>
div[lang] {
font-size: calc(1ex + 1ch + 1em);
}
</style>
<div lang="en">
<div style="width: 1em; height: 1em; background: green;"></div>
</div>

Просмотреть файл

@ -0,0 +1,6 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<p>You should see a green box twice-the-initial-font-size wide.</p>
<div style="width: 2em; height: 2em; background: green;"></div>

Просмотреть файл

@ -0,0 +1,17 @@
<!doctype html>
<html lang="en"><!-- The lang is important! -->
<meta charset="utf-8">
<title>CSS Test: Calc with rem and relative units on the root element</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" href="https://drafts.csswg.org/css-values/#rem">
<link rel="help" href="https://drafts.csswg.org/css-values/#funcdef-calc">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1431031">
<link rel="match" href="calc-rem-lang-ref.html">
<style>
html {
font-size: calc(1rem + 1em);
}
</style>
<p style="font-size: initial">You should see a green box twice-the-initial-font-size wide.</p>
<div style="width: 1em; height: 1em; background: green;"></div>
</html>