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

Conformance tests for IntersectionObserver. #4384

Conversation

szager-chromium
Copy link
Contributor

@szager-chromium szager-chromium commented Dec 22, 2016

@sideshowbarker
Copy link
Contributor

The lint tool found some problems that need to be fixed—

https://travis-ci.org/w3c/web-platform-tests/jobs/186189394

INDENT TABS: intersection-observer/cross-origin-iframe.html 37 Tabs used for indentation
INDENT TABS: intersection-observer/timestamp.html 55 Tabs used for indentation
INDENT TABS: intersection-observer/timestamp.html 82 Tabs used for indentation

@RByers
Copy link
Contributor

RByers commented Jan 4, 2017

szager-chromium@ if there's someone who's familiar with the details of the Intersection Observer spec that can review this (or has already reviewed this upstream in blink), then I can push it for you.

@inexorabletash
Copy link
Contributor

@smaug---- points out we should have tests for moving elements to other documents. Shouldn't block upstreaming these, but would be good to have.

@sideshowbarker
Copy link
Contributor

w3c-test:mirror

@jgraham
Copy link
Contributor

jgraham commented Mar 15, 2017

Can we rebase this branch on master so we stability checker results?

@w3c-bots
Copy link

These tests are now available on w3c-test.org

@szager-chromium
Copy link
Contributor Author

szager-chromium commented Apr 12, 2017

These tests were reviewed in the chromium repository by foolip@:

https://codereview.chromium.org/2560253004

@w3c-bots
Copy link

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision e04b52b
Using browser at version BuildID 20170412100254; SourceStamp f40e24f40b4c4556944c762d4764eace261297f5
Starting 10 test iterations
All results were stable

All results

22 tests ran
/intersection-observer/client-rect.html
Subtest Results Messages
OK
IntersectionObserverEntry.boundingClientRect should match target.boundingClientRect() FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/containing-block.html
Subtest Results Messages
OK
IntersectionObserver should only report intersections if root is a containing block ancestor of target. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/cross-origin-iframe.html
Subtest Results Messages
OK
Intersection observer test with no explicit root and target in a cross-origin iframe. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/disconnect.html
Subtest Results Messages
OK
IntersectionObserver should not deliver pending notifications after disconnect(). FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/display-none.html
Subtest Results Messages
OK
IntersectionObserver should send a not-intersecting notification for a target that gets display:none. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/edge-inclusive-intersection.html
Subtest Results Messages
OK
IntersectionObserver should detect and report edge-adjacent and zero-area intersections. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/iframe-no-root.html
Subtest Results Messages
OK
Observer with the implicit root; target in a same-origin iframe. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/multiple-targets.html
Subtest Results Messages
OK
One observer with multiple targets. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/multiple-thresholds.html
Subtest Results Messages
OK
Observer with multiple thresholds. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/observer-attributes.html
Subtest Results Messages
OK
Observer attribute getters. FAIL IntersectionObserver is not defined
/intersection-observer/observer-exceptions.html
Subtest Results Messages
OK
IntersectionObserver constructor with { threshold: [1.1] } FAIL assert_throws: function "function() {\n new IntersectionObserver(e => {}, {threshold: [1.1]})\n }" threw object "ReferenceError: IntersectionObserver is not defined" ("ReferenceError") expected object "RangeError" ("RangeError")
IntersectionObserver constructor with { threshold: ["foo"] } FAIL assert_throws: function "function() {\n new IntersectionObserver(e => {}, {threshold: ["foo"]})\n }" threw object "ReferenceError: IntersectionObserver is not defined" ("ReferenceError") expected object "TypeError" ("TypeError")
IntersectionObserver constructor witth { rootMargin: "1" } FAIL assert_throws: function "function() {\n new IntersectionObserver(e => {}, {rootMargin: "1"})\n }" threw object "ReferenceError: IntersectionObserver is not defined" that is not a DOMException SYNTAX_ERR: property "code" is equal to undefined, expected 12
IntersectionObserver constructor with { rootMargin: "2em" } FAIL assert_throws: function "function() {\n new IntersectionObserver(e => {}, {rootMargin: "2em"})\n }" threw object "ReferenceError: IntersectionObserver is not defined" that is not a DOMException SYNTAX_ERR: property "code" is equal to undefined, expected 12
IntersectionObserver constructor width { rootMargin: "auto" } FAIL assert_throws: function "function() {\n new IntersectionObserver(e => {}, {rootMargin: "auto"})\n }" threw object "ReferenceError: IntersectionObserver is not defined" that is not a DOMException SYNTAX_ERR: property "code" is equal to undefined, expected 12
IntersectionObserver constructor with { rootMargin: "1px 1px 1px 1px 1px" } FAIL assert_throws: function "function() {\n new IntersectionObserver(e => {}, {rootMargin: "1px 1px 1px 1px 1px"})\n }" threw object "ReferenceError: IntersectionObserver is not defined" that is not a DOMException SYNTAX_ERR: property "code" is equal to undefined, expected 12
IntersectionObserver.observe("foo") FAIL assert_throws: function "function() {\n let observer = new IntersectionObserver(c => {}, {});\n observer.observe("foo");\n }" threw object "ReferenceError: IntersectionObserver is not defined" ("ReferenceError") expected object "TypeError" ("TypeError")
/intersection-observer/observer-without-js-reference.html
Subtest Results Messages
OK
IntersectionObserver that is unreachable in js should still generate notifications. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/remove-element.html
Subtest Results Messages
OK
Verify that not-intersecting notifications are sent when a target is removed from the DOM tree. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/root-margin.html
Subtest Results Messages
OK
Root margin tests FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/same-document-no-root.html
Subtest Results Messages
OK
IntersectionObserver in a single document using the implicit root. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/same-document-root.html
Subtest Results Messages
OK
IntersectionObserver in a single document with explicit root. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/same-document-zero-size-target.html
Subtest Results Messages
OK
Observing a zero-area target. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/shadow-content.html
Subtest Results Messages
OK
Observing a target inside shadow DOM. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/timestamp.html
Subtest Results Messages
OK
Check that timestamps correspond to the to execution context that created the observer. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/unclipped-root.html
Subtest Results Messages
OK
Test that border bounding box is used to calculate intersection with a non-scrolling root. FAIL IntersectionObserver is not defined
/intersection-observer/zero-area-element-hidden.html
Subtest Results Messages
OK
A zero-area hidden target should not be intersecting. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921
/intersection-observer/zero-area-element-visible.html
Subtest Results Messages
OK
Ensure that a zero-area target intersecting root generates a notification with intersectionRatio == 1 FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 921

@w3c-bots
Copy link

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision e04b52b
Using browser at version 59.0.3067.0 dev
Starting 10 test iterations

Unstable results

Test Subtest Results Messages
/intersection-observer/observer-attributes.html observer.root PASS: 20/10
/intersection-observer/observer-attributes.html observer.thresholds PASS: 20/10
/intersection-observer/observer-attributes.html observer.rootMargin PASS: 20/10

All results

22 tests ran
/intersection-observer/client-rect.html
Subtest Results Messages
OK
IntersectionObserverEntry.boundingClientRect should match target.boundingClientRect() FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/containing-block.html
Subtest Results Messages
OK
IntersectionObserver should only report intersections if root is a containing block ancestor of target. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/cross-origin-iframe.html
Subtest Results Messages
OK
Intersection observer test with no explicit root and target in a cross-origin iframe. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/disconnect.html
Subtest Results Messages
OK
IntersectionObserver should not deliver pending notifications after disconnect(). FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/display-none.html
Subtest Results Messages
OK
IntersectionObserver should send a not-intersecting notification for a target that gets display:none. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/edge-inclusive-intersection.html
Subtest Results Messages
OK
IntersectionObserver should detect and report edge-adjacent and zero-area intersections. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/iframe-no-root.html
Subtest Results Messages
OK
Observer with the implicit root; target in a same-origin iframe. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/multiple-targets.html
Subtest Results Messages
OK
One observer with multiple targets. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/multiple-thresholds.html
Subtest Results Messages
OK
Observer with multiple thresholds. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/observer-attributes.html
Subtest Results Messages
ERROR
Observer attribute getters. PASS
observer.root PASS: 20/10
observer.thresholds PASS: 20/10
observer.rootMargin PASS: 20/10
/intersection-observer/observer-exceptions.html
Subtest Results Messages
OK
IntersectionObserver constructor with { threshold: [1.1] } PASS
IntersectionObserver constructor with { threshold: ["foo"] } PASS
IntersectionObserver constructor witth { rootMargin: "1" } PASS
IntersectionObserver constructor with { rootMargin: "2em" } PASS
IntersectionObserver constructor width { rootMargin: "auto" } PASS
IntersectionObserver constructor with { rootMargin: "1px 1px 1px 1px 1px" } PASS
IntersectionObserver.observe("foo") PASS
/intersection-observer/observer-without-js-reference.html
Subtest Results Messages
OK
IntersectionObserver that is unreachable in js should still generate notifications. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/remove-element.html
Subtest Results Messages
OK
Verify that not-intersecting notifications are sent when a target is removed from the DOM tree. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/root-margin.html
Subtest Results Messages
OK
Root margin tests FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/same-document-no-root.html
Subtest Results Messages
OK
IntersectionObserver in a single document using the implicit root. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/same-document-root.html
Subtest Results Messages
OK
IntersectionObserver in a single document with explicit root. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/same-document-zero-size-target.html
Subtest Results Messages
OK
Observing a zero-area target. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/shadow-content.html
Subtest Results Messages
OK
Observing a target inside shadow DOM. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/timestamp.html
Subtest Results Messages
OK
Check that timestamps correspond to the to execution context that created the observer. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/unclipped-root.html
Subtest Results Messages
OK
Test that border bounding box is used to calculate intersection with a non-scrolling root. PASS
First rAF. PASS
target.style.transform = 'translateY(195px)' PASS
/intersection-observer/zero-area-element-hidden.html
Subtest Results Messages
OK
A zero-area hidden target should not be intersecting. FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004
/intersection-observer/zero-area-element-visible.html
Subtest Results Messages
OK
Ensure that a zero-area target intersecting root generates a notification with intersectionRatio == 1 FAIL assert_equals: Window must be 800 pixels wide. expected 800 but got 1004

@smaug----
Copy link
Contributor

@tobytailor could you take a look at the Firefox results. I assume some of the tests are buggy and Firefox implementation has some bugs too.

@szager-chromium
Copy link
Contributor Author

@smaug---- It seems like most or all of the failures stem from the fact that the tests require an 800x600 viewport. That's always the case when running chromium tests, so that assumption is hard-coded into the tests.

Is there a way to force that requirement when running them against firefox?

@smaug----
Copy link
Contributor

No, or even if there was that is a bug in the tests and should be fixed there.

@smaug----
Copy link
Contributor

But @jgraham could say more about the setup in Firefox.

@tobitailor
Copy link
Contributor

tobitailor commented Apr 12, 2017

Be aware that the API is still disabled by default in Firefox. It needs to be enabled via dom.IntersectionObserver.enabled flag in about:config. That would explain all the IntersectionObserver not being defined errors.

@tobitailor
Copy link
Contributor

I removed requirements of a 800x600 viewport and got all tests to work in Chrome(Canary) and Firefox Nightly (with additional patches tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1358666). See szager-chromium#1

@nolanlawson
Copy link
Member

Can this PR be closed because apparently the tests have already made it into master? #6216 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants