https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e57d2a1ed5681d3ea058ea3956583200d2efe9aa authored by Eric Willigers on 15 April 2018, 11:01:13 UTC
CSS: Remove support for position values with 3 parts
Tip revision: e57d2a1
observer-exceptions.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script>
test(function () {
  assert_throws(RangeError(), function() {
    new IntersectionObserver(e => {}, {threshold: [1.1]})
  })
}, "IntersectionObserver constructor with { threshold: [1.1] }");

test(function () {
  assert_throws(TypeError(), function() {
    new IntersectionObserver(e => {}, {threshold: ["foo"]})
  })
}, 'IntersectionObserver constructor with { threshold: ["foo"] }');

test(function () {
  assert_throws("SYNTAX_ERR", function() {
    new IntersectionObserver(e => {}, {rootMargin: "1"})
  })
}, 'IntersectionObserver constructor witth { rootMargin: "1" }');

test(function () {
  assert_throws("SYNTAX_ERR", function() {
    new IntersectionObserver(e => {}, {rootMargin: "2em"})
  })
}, 'IntersectionObserver constructor with { rootMargin: "2em" }');

test(function () {
  assert_throws("SYNTAX_ERR", function() {
    new IntersectionObserver(e => {}, {rootMargin: "auto"})
  })
}, 'IntersectionObserver constructor with { rootMargin: "auto" }');

test(function () {
  assert_throws("SYNTAX_ERR", function() {
    new IntersectionObserver(e => {}, {rootMargin: "calc(1px + 2px)"})
  })
}, 'IntersectionObserver constructor with { rootMargin: "calc(1px + 2px)" }');

test(function () {
  assert_throws("SYNTAX_ERR", function() {
    new IntersectionObserver(e => {}, {rootMargin: "1px !important"})
  })
}, 'IntersectionObserver constructor with { rootMargin: "1px !important" }');

test(function () {
  assert_throws("SYNTAX_ERR", function() {
    new IntersectionObserver(e => {}, {rootMargin: "1px 1px 1px 1px 1px"})
  })
}, 'IntersectionObserver constructor with { rootMargin: "1px 1px 1px 1px 1px" }');

test(function () {
  assert_throws(TypeError(), function() {
    let observer = new IntersectionObserver(c => {}, {});
    observer.observe("foo");
  })
}, 'IntersectionObserver.observe("foo")');
</script>
back to top