Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1312)

Delta Between Two Patch Sets: LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html

Issue 359780043: WIP for IO
Left Patch Set: Cleaned up root parsing Created 5 years, 8 months ago
Right Patch Set: 22 tests pass Created 5 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4
5 <script>
6 test(function () {
7 assert_throws(RangeError(), function() {
8 new IntersectionObserver(e => {}, {threshold: [1.1]})
9 })
10 }, "IntersectionObserver constructor with { threshold: [1.1] }");
11
12 test(function () {
13 assert_throws(TypeError(), function() {
14 new IntersectionObserver(e => {}, {threshold: ["foo"]})
15 })
16 }, 'IntersectionObserver constructor with { threshold: ["foo"] }');
17
18 test(function () {
19 assert_throws("SYNTAX_ERR", function() {
20 new IntersectionObserver(e => {}, {rootMargin: "1"})
21 })
22 }, 'IntersectionObserver constructor witth { rootMargin: "1" }');
23
24 test(function () {
25 assert_throws("SYNTAX_ERR", function() {
26 new IntersectionObserver(e => {}, {rootMargin: "2em"})
27 })
28 }, 'IntersectionObserver constructor with { rootMargin: "2em" }');
29
30 test(function () {
31 assert_throws("SYNTAX_ERR", function() {
32 new IntersectionObserver(e => {}, {rootMargin: "auto"})
33 })
34 }, 'IntersectionObserver constructor with { rootMargin: "auto" }');
35
36 test(function () {
37 assert_throws("SYNTAX_ERR", function() {
38 new IntersectionObserver(e => {}, {rootMargin: "calc(1px + 2px)"})
39 })
40 }, 'IntersectionObserver constructor with { rootMargin: "calc(1px + 2px)" }');
41
42 test(function () {
43 assert_throws("SYNTAX_ERR", function() {
44 new IntersectionObserver(e => {}, {rootMargin: "1px !important"})
45 })
46 }, 'IntersectionObserver constructor with { rootMargin: "1px !important" }');
47
48 test(function () {
49 assert_throws("SYNTAX_ERR", function() {
50 new IntersectionObserver(e => {}, {rootMargin: "1px 1px 1px 1px 1px"})
51 })
52 }, 'IntersectionObserver constructor with { rootMargin: "1px 1px 1px 1px 1px" }' );
53
54 test(function () {
55 assert_throws(TypeError(), function() {
56 let observer = new IntersectionObserver(c => {}, {});
57 observer.observe("foo");
58 })
59 }, 'IntersectionObserver.observe("foo")');
60 </script>
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b