cpuprogramme / cpu-15

Dotclear theme for radio show C.P.U.
2 stars 1 forks source link

Use observer instead of scroll events #20

Closed dascritch closed 4 years ago

dascritch commented 6 years ago

cf https://hacks.mozilla.org/2017/08/intersection-observer-comes-to-firefox/

dascritch commented 6 years ago

cf https://tech.mozfr.org/post/2017/08/21/IntersectionObserver-arrive-dans-Firefox polyfill https://github.com/WICG/IntersectionObserver/tree/gh-pages/polyfill because Safari and iOS are deep shits

dascritch commented 4 years ago

Reverted 59a0cd600d3cafed7db07c03d1a4e67e15cb10b2 , because observers on webcomponents seems not correctly checked in Firefox

Snippet for checking :

function check(elements) {
          console.log(elements[0].intersectionRatio, elements[0].isIntersecting, elements[0])
}
new IntersectionObserver(check).observe(document.getElementById('menu'));
new IntersectionObserver(check).observe(document.querySelector('cpu-audio'));
dascritch commented 4 years ago

Reported to Mozilla https://bugzilla.mozilla.org/show_bug.cgi?id=1581876

dascritch commented 4 years ago

Bug related to cpu-audio webcomponent : container not declared as block