зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1326189 part 5 - Add reftest for caret-color with :visited. r=dholbert
MozReview-Commit-ID: Fw1gnUQSRbq --HG-- extra : rebase_source : 6b06582d65b0e61f3f0721e4af6b2c686664428c
This commit is contained in:
Родитель
9c07cf28a2
Коммит
e9127937e6
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: Ahem;
|
||||
src: url(Ahem.ttf);
|
||||
}
|
||||
div {
|
||||
font: 16px/1 Ahem;
|
||||
width: 1em;
|
||||
background: green;
|
||||
}
|
||||
</style>
|
||||
<div><span></span></div>
|
||||
<script>
|
||||
let $div = document.querySelector('div');
|
||||
let $span = document.querySelector('span');
|
||||
window.onload = function () {
|
||||
document.fonts.ready.then(() => {
|
||||
$div.style.height = $span.getBoundingClientRect().height + 'px';
|
||||
});
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: Ahem;
|
||||
src: url(Ahem.ttf);
|
||||
}
|
||||
a {
|
||||
caret-color: red;
|
||||
}
|
||||
a:visited {
|
||||
caret-color: green;
|
||||
}
|
||||
textarea {
|
||||
caret-color: inherit;
|
||||
font: 16px/1 Ahem;
|
||||
outline: none;
|
||||
border: 0 none;
|
||||
resize: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<a href="visited-page.html"><textarea></textarea></a>
|
||||
<script>
|
||||
document.querySelector('textarea').focus();
|
||||
</script>
|
|
@ -44,6 +44,8 @@ TEST_HARNESS_FILES.testing.mochitest.tests.layout.style.test['css-visited'] += [
|
|||
'/layout/reftests/css-visited/border-2b.html',
|
||||
'/layout/reftests/css-visited/border-collapse-1-ref.html',
|
||||
'/layout/reftests/css-visited/border-collapse-1.html',
|
||||
'/layout/reftests/css-visited/caret-color-on-visited-1-ref.html',
|
||||
'/layout/reftests/css-visited/caret-color-on-visited-1.html',
|
||||
'/layout/reftests/css-visited/color-choice-1-ref.html',
|
||||
'/layout/reftests/css-visited/color-choice-1.html',
|
||||
'/layout/reftests/css-visited/color-on-bullets-1-ref.html',
|
||||
|
@ -105,6 +107,7 @@ TEST_HARNESS_FILES.testing.mochitest.tests.layout.style.test['css-visited'] += [
|
|||
'/layout/reftests/css-visited/width-1-ref.html',
|
||||
'/layout/reftests/css-visited/width-on-link-1.html',
|
||||
'/layout/reftests/css-visited/width-on-visited-1.html',
|
||||
'/layout/reftests/fonts/Ahem.ttf',
|
||||
'/layout/reftests/svg/as-image/lime100x100.svg',
|
||||
'/layout/reftests/svg/as-image/svg-image-visited-1-helper.svg',
|
||||
'/layout/reftests/svg/as-image/svg-image-visited-2-helper.svg',
|
||||
|
|
|
@ -32,6 +32,7 @@ var gTests = [
|
|||
// assumed to be complete when loaded, but we poll for visited link
|
||||
// coloring on the TEST (first file) until the test passes.
|
||||
"== pseudo-classes-02.svg pseudo-classes-02-ref.svg",
|
||||
"needs-focus == caret-color-on-visited-1.html caret-color-on-visited-1-ref.html",
|
||||
"!= color-on-link-1-ref.html color-on-visited-1-ref.html",
|
||||
"== color-on-link-1.html color-on-link-1-ref.html",
|
||||
"== color-on-link-before-1.html color-on-link-1-ref.html",
|
||||
|
@ -98,7 +99,9 @@ function startIframe(url) {
|
|||
return new Promise(resolve => {
|
||||
var element = document.createElement("iframe");
|
||||
element.addEventListener("load", () => {
|
||||
resolve(element.contentWindow);
|
||||
element.contentDocument.fonts.ready.then(() => {
|
||||
resolve(element.contentWindow);
|
||||
});
|
||||
}, {once: true});
|
||||
// smaller than normal reftests, but enough for these
|
||||
element.setAttribute("style", "width: 30em; height: 10em");
|
||||
|
|
Загрузка…
Ссылка в новой задаче