Skip to content
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

"javascript:" urls: add web-platform-test #7614

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions css/css-images-3/gradient-button-ref.html
@@ -0,0 +1,15 @@
<!doctype html>
<meta charset="utf-8">
<title>Big button with gradient (without padding)</title>
<style>
#button {
width: calc(300px + 2 * 30px);
height: calc(80px + 2 * 20px);
background: linear-gradient(blue, green);
border-width: 5px;
border-style: solid;
border-color: red;
border-radius: 10px;
}
</style>
<div id="button"></div>
19 changes: 19 additions & 0 deletions css/css-images-3/gradient-button.html
@@ -0,0 +1,19 @@
<!doctype html>
<meta charset="utf-8">
<title>Gradients with padding</title>
<link rel="help" href="https://drafts.csswg.org/css-images-3/#gradients">
<meta name="assert" content="gradients cover element padding">
<link rel="match" href="gradient-button-ref.html">
<style>
#button {
width: 300px;
height: 80px;
padding: 20px 30px;
background: linear-gradient(blue, green);
border-width: 5px;
border-style: solid;
border-color: red;
border-radius: 10px;
}
</style>
<div id="button"></div>
19 changes: 19 additions & 0 deletions css/css-images-3/gradient-move-stops-ref.html
@@ -0,0 +1,19 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<style>
#gradient {
width: 400px;
height: 300px;
background-image: linear-gradient(to right, yellow 0%, blue 70%, green 70%, green 100%);
}
</style>
</head>

<body>
<div id="gradient"></div>
</body>

</html>
22 changes: 22 additions & 0 deletions css/css-images-3/gradient-move-stops.html
@@ -0,0 +1,22 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<title>Linear gradient which needs some positions changed and inferred.</title>
<link rel="help" href="https://drafts.csswg.org/css-images-3/#radial-color-stops">
<link rel="match" href="gradient-move-stops-ref.html">
<style>
#gradient {
width: 400px;
height: 300px;
background-image: linear-gradient(to right, yellow, blue 70%, green 0);
}
</style>
</head>

<body>
<div id="gradient"></div>
</body>

</html>
23 changes: 23 additions & 0 deletions css/css-images-3/linear-gradient-1.html
@@ -0,0 +1,23 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<title>Linear gradient with some inferred positions</title>
<link rel="help" href="https://drafts.csswg.org/css-images-3/#radial-color-stops">
<meta name="assert" content="Calculation of implicit gradient stops.">
<link rel="match" href="linear-gradient-ref.html">
<style>
#gradient {
width: 400px;
height: 300px;
background-image: linear-gradient(to right, black 0%, red, gold);
}
</style>
</head>

<body>
<div id="gradient"></div>
</body>

</html>
23 changes: 23 additions & 0 deletions css/css-images-3/linear-gradient-2.html
@@ -0,0 +1,23 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<title>Linear gradient with all inferred positions</title>
<link rel="help" href="https://drafts.csswg.org/css-images-3/#radial-color-stops">
<meta name="assert" content="Calculation of implicit gradient stops.">
<link rel="match" href="linear-gradient-ref.html">
<style>
#gradient {
width: 400px;
height: 300px;
background-image: linear-gradient(to right, black, red, gold);
}
</style>
</head>

<body>
<div id="gradient"></div>
</body>

</html>
19 changes: 19 additions & 0 deletions css/css-images-3/linear-gradient-ref.html
@@ -0,0 +1,19 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<style>
#gradient {
width: 400px;
height: 300px;
background-image: linear-gradient(to right, black 0%, red 50%, gold 100%);
}
</style>
</head>

<body>
<div id="gradient"></div>
</body>

</html>
13 changes: 13 additions & 0 deletions cssom/selectorText-modification-restyle-001-ref.html
@@ -0,0 +1,13 @@
<!doctype html>
<meta charset="utf-8">
<title>(Ref #1) CSSOM - CSSStyleRule.selectorText Modification Restyle - Reference #1</title>

<style>
div {
color: green;
}
</style>

<body>
<div>I should be green.</div>
</body>
21 changes: 21 additions & 0 deletions cssom/selectorText-modification-restyle-001.html
@@ -0,0 +1,21 @@
<!doctype html>
<meta charset="utf-8">
<title>(Test #1) CSSOM - CSSStyleRule.selectorText Modification Restyle - Test #1</title>
<link rel="match" href="selectorText-modification-restyle-001-ref.html">

<style>
@namespace bogus url(http://example.com/bogus);

bogus|div {
color: green;
}
</style>

<body>
<div>I should be green.</div>
<script>
// Remove the "bogus" namespace--now it should apply to the div above.
// We also expect to see a restyle.
document.querySelector("style").sheet.cssRules[1].selectorText = "div";
</script>
</body>
11 changes: 11 additions & 0 deletions cssom/style-sheet-interfaces-001.html
Expand Up @@ -61,6 +61,17 @@
assert: [ "styleElement.sheet exists", "styleElement.sheet is a CSSStyleSheet",
"linkElement.sheet exists", "linkElement.sheet is a CSSStyleSheet"] });

test(function () {
var style = document.createElement("style");
document.querySelector("head").appendChild(style);
var sheet1 = style.sheet;
assert_equals(sheet1.cssRules.length, 0);
style.appendChild(document.createTextNode("a { color: green; }"));
assert_equals(style.sheet.cssRules.length, 1);
}, "sheet_property_updates",
{ help: "https://www.w3.org/TR/cssom-1/#the-linkstyle-interface",
assert: "The sheet property on LinkStyle should always return the current associated style sheet." });

test(function() {
assert_own_property(styleSheet, "ownerRule");
assert_own_property(styleSheet, "cssRules");
Expand Down
28 changes: 28 additions & 0 deletions url/a-element-href-javascript.html
@@ -0,0 +1,28 @@
<!doctype html>
<meta charset=utf-8>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>

<script>
var linkStatus = 'link not clicked';

function changeStatus() {
linkStatus = 'link has been clicked';
}
</script>

<a id="javascript-link" href="javascript:changeStatus()">link</a>

<script>
setup({explicit_done:true});

document.querySelector("#javascript-link").click();

step_timeout(function() {
test(function() {
assert_equals(linkStatus, "link has been clicked");
}, "javascript: scheme urls should be executed in correct global scope");

done();
});
</script>
4 changes: 4 additions & 0 deletions workers/Worker_ErrorEvent_error.htm
Expand Up @@ -4,6 +4,10 @@
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
// The worker events races with the window's load event; if the worker events
// arrive first, the harness will detect the error event and fail the test.
setup({ allow_uncaught_exception: true });

var t1 = async_test("Error handler outside the worker should not see the error value");
var t2 = async_test("Error handlers inside a worker should see the error value");

Expand Down
2 changes: 2 additions & 0 deletions workers/data-url.html
Expand Up @@ -27,6 +27,8 @@
});
w.onerror = t.step_func_done(function(e) {
assert_true(true, 'Should throw ' + e.message);
// Stop the error from being propagated to the WPT test harness
e.preventDefault();
});
}, test_desc);
}
Expand Down