-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from w3c/master
Sync up with W3C repo
- Loading branch information
Showing
151 changed files
with
4,912 additions
and
804 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<title>IDBCursor.update() - index - throw InvalidStateError when the cursor is being iterated</title> | ||
<link rel="author" title="Mozilla" href="https://www.mozilla.org"> | ||
<link rel="help" href="https://www.w3.org/TR/IndexedDB/#widl-IDBCursor-update-IDBRequest-any-value"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support.js"></script> | ||
<div id="log"></div> | ||
<script> | ||
var db, | ||
t = async_test(), | ||
records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, | ||
{ pKey: "primaryKey_1", iKey: "indexKey_1" } ]; | ||
|
||
var open_rq = createdb(t); | ||
open_rq.onupgradeneeded = function(e) { | ||
db = e.target.result; | ||
|
||
var objStore = db.createObjectStore("store", { keyPath: "pKey" }); | ||
objStore.createIndex("index", "iKey"); | ||
|
||
for (var i = 0; i < records.length; i++) | ||
objStore.add(records[i]); | ||
}; | ||
|
||
open_rq.onsuccess = function(e) { | ||
var cursor_rq = db.transaction("store", "readwrite") | ||
.objectStore("store") | ||
.index("index") | ||
.openCursor(); | ||
|
||
cursor_rq.onsuccess = t.step_func(function(e) { | ||
var cursor = e.target.result; | ||
assert_true(cursor instanceof IDBCursor, "cursor exists"); | ||
|
||
cursor.continue(); | ||
assert_throws("InvalidStateError", function() { | ||
cursor.update({ pKey: "primaryKey_0", iKey: "indexKey_0_updated" }); | ||
}); | ||
|
||
t.done(); | ||
}); | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>IDBCursor.update() - object store - throw InvalidStateError when the cursor is being iterated</title> | ||
<link rel="author" title="Mozilla" href="https://www.mozilla.org"> | ||
<link rel="help" href="https://www.w3.org/TR/IndexedDB/#widl-IDBCursor-update-IDBRequest-any-value"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support.js"></script> | ||
<div id="log"></div> | ||
<script> | ||
var db, | ||
t = async_test(), | ||
records = [{ pKey: "primaryKey_0", value: "value_0" }, | ||
{ pKey: "primaryKey_1", value: "value_1" }]; | ||
|
||
var open_rq = createdb(t); | ||
open_rq.onupgradeneeded = function (event) { | ||
db = event.target.result; | ||
|
||
var objStore = db.createObjectStore("store", {keyPath : "pKey"}); | ||
|
||
for (var i = 0; i < records.length; i++) { | ||
objStore.add(records[i]); | ||
} | ||
} | ||
|
||
open_rq.onsuccess = function(e) { | ||
var cursor_rq = db.transaction("store", "readwrite") | ||
.objectStore("store") | ||
.openCursor(); | ||
|
||
cursor_rq.onsuccess = t.step_func(function(event) { | ||
var cursor = event.target.result; | ||
assert_true(cursor instanceof IDBCursor, "cursor exists"); | ||
|
||
cursor.continue(); | ||
assert_throws("InvalidStateError", function() { | ||
cursor.update({ pKey: "primaryKey_0", value: "value_0_updated" }); | ||
}); | ||
|
||
t.done(); | ||
}); | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>XMLHttpRequest: open() in document that is not fully active (but may be active) should throw</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method"> | ||
</head> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
var test = async_test(), | ||
client, | ||
count = 0, | ||
win = window.open("resources/init.htm"); | ||
test.add_cleanup(function() { win.close(); }); | ||
function init() { | ||
test.step(function() { | ||
if(0 == count) { | ||
var doc = win.document; | ||
var ifr = document.createElement("iframe"); | ||
ifr.onload = function() { | ||
// Again, do things async so we're not doing loads from inside | ||
// load events. | ||
setTimeout(function() { | ||
client = new ifr.contentWindow.XMLHttpRequest(); | ||
count++; | ||
// Important to do a normal navigation, not a reload. | ||
win.location.href = "resources/init.htm"; | ||
}, 100); | ||
} | ||
doc.body.appendChild(ifr); | ||
} else if(1 == count) { | ||
assert_throws("InvalidStateError", function() { client.open("GET", "...") }) | ||
test.done() | ||
} | ||
}) | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>webkit-text-fill-color should take effect while rendering text-decoration underline</title> | ||
<title>webkit-text-fill-color should not take effect while rendering text-decoration underline</title> | ||
<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com"> | ||
<link rel="author" title="Mozilla" href="https://www.mozilla.org"> | ||
<link rel="help" href="https://compat.spec.whatwg.org/#the-webkit-text-fill-color"> | ||
<meta name="assert" content="The color of text-decoration underline should be green"> | ||
<link rel="match" href="webkit-text-fill-color-property-005-ref.html"> | ||
<style type="text/css"> | ||
p { | ||
font-size: 50px; | ||
color: green; | ||
} | ||
p.underline { | ||
text-decoration: underline; | ||
color: red; | ||
-webkit-text-fill-color: green; | ||
-webkit-text-fill-color: red | ||
} | ||
</style> | ||
<div><p>Pass if text underline is green!!!</p></div> | ||
<div><p class="underline"> </p></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<meta charset="UTF-8"> | ||
<title>Throwing in event listeners</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<div id="log"></div> | ||
<script> | ||
setup({allow_uncaught_exception:true}) | ||
|
||
test(function() { | ||
var errorEvents = 0; | ||
window.onerror = this.step_func(function(e) { | ||
assert_equals(typeof e, 'string'); | ||
++errorEvents; | ||
}); | ||
|
||
var element = document.createElement('div'); | ||
|
||
element.addEventListener('click', function() { | ||
throw new Error('Error from only listener'); | ||
}); | ||
|
||
element.dispatchEvent(new Event('click')); | ||
|
||
assert_equals(errorEvents, 1); | ||
}, "Throwing in event listener with a single listeners"); | ||
|
||
test(function() { | ||
var errorEvents = 0; | ||
window.onerror = this.step_func(function(e) { | ||
assert_equals(typeof e, 'string'); | ||
++errorEvents; | ||
}); | ||
|
||
var element = document.createElement('div'); | ||
|
||
var secondCalled = false; | ||
|
||
element.addEventListener('click', function() { | ||
throw new Error('Error from first listener'); | ||
}); | ||
element.addEventListener('click', this.step_func(function() { | ||
secondCalled = true; | ||
}), false); | ||
|
||
element.dispatchEvent(new Event('click')); | ||
|
||
assert_equals(errorEvents, 1); | ||
assert_true(secondCalled); | ||
}, "Throwing in event listener with multiple listeners"); | ||
</script> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.