New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Css contain #10549

Merged
merged 10 commits into from Apr 25, 2018
Next

[css-contain] tests for style containment and counters

Test the spec changes / clarifications from
w3c/csswg-drafts#1887
w3c/csswg-drafts#2483
  • Loading branch information...
frivoal committed Apr 20, 2018
commit d7fbc4794403dfeb55f13310d4c1cb51813e2d6e
@@ -0,0 +1,26 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS-contain test: style containment and counter-increment</title>
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
<meta name=flags content="">
<meta name=assert content="counter-increment is scoped to the subtree and creates a new counter at the root of the subtree">
<link rel="match" href="reference/counter-scoping-001-ref.html">
<link rel=help href="https://drafts.csswg.org/css-contain/#containment-style">
<style>
div {
contain: style;
counter-increment: n;
}
div::before, div::after {
content: counters(n, '.') " ";
}
div::after {
counter-increment: n 2;
}
</style>
<p>Test passes if the text below is "1 1.2" (not including the quotation marks).<p>
<div></div>
@@ -0,0 +1,27 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS-contain test: style containment and counter-set</title>
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
<meta name=flags content="">
<meta name=assert content="counter-set is scoped to the subtree and creates a new counter at the root of the subtree">
<link rel="match" href="reference/counter-scoping-001-ref.html">
<link rel=help href="https://drafts.csswg.org/css-contain/#containment-style">
<link rel=help href="https://drafts.csswg.org/css-lists-3/#propdef-counter-set">
<style>
div {
contain: style;
counter-set: n;
}
div::before, div::after {
content: counters(n, '.') " ";
}
div::after {
counter-set: n 2;
}
</style>
<p>Test passes if the text below is "1 1.2" (not including the quotation marks).<p>
<div></div>
@@ -0,0 +1,9 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS-contain test reference</title>
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
<p>Test passes if the text below is "1 1.2" (not including the quotation marks).<p>
<div>1 1.2</div>
ProTip! Use n and p to navigate between commits in a pull request.