11:13:51 RRSAgent has joined #positionobserver 11:13:51 logging to http://www.w3.org/2015/08/27-positionobserver-irc 11:14:03 RSSAgent, make logs public 11:14:16 RRSAgent, make logs public 11:15:16 ojan: Would like to talk about PositionObserver, proposal to get standard of rendering pipeline, proposal how to fit resize observer into the pipeline. Fine if we drop off last point. 11:15:42 ojan: Use-cases for position observer. 11:16:58 ojan: Infinite scrollers, Disqus type comment system - lazy load when near viewport, Ad visibility detection - we've observed that they do a lot of work trying to detect if the ad is visible. 11:17:36 ojan: The advert something something standards board, setting up standards guidelines on what counts as an ad impression. 11:18:32 ojan: Work that Ads are doing to do this type of detection is quite expensive, requires performing polling. Triggers layout thrashing. 11:18:56 ojan: Standard requires polling every 100ms. 11:19:25 dbaron: would page visibility API applied to iframes work? 11:19:48 ojan: I don't remember why this wasn't expressive enough. 11:20:11 ojan: We had somebody from google ads to implement in chrome paint timing information. 11:21:28 ojan: You can't tell that you are visible, moz exposes paint count for this information, non-moz create a 1x1 flash plugin you can get information if it painted or not, nothing that solves occulsion problems. 11:21:49 ojan: for flash plugin use multiple to get higher resolution. 11:22:11 ojan: Meta: "What is a good solution for this problem, in addition with lazy loading and infinite lists." 11:22:29 ojan: Trying to come up with an API that solves all of the issues. 11:23:10 esphren: fb comments are also quite expensive, performing polling to detect when to load. 11:23:26 ojan: do those use cases make sense? 11:23:43 smfr: I'm not sure that infinite scrolling is in this problem space. 11:24:56 elliott: two different types of infinte scroll - network fetches when you reach end, view-cycling to reduce dom. 11:25:20 ojan: Explaining API on whiteboard. 11:25:41 ojan: var obs = new PositionObserver(); 11:26:12 elliott: var obs = new PositionObserver(() => { ... }); 11:26:20 elliott: obs.observe(e); 11:26:49 ojan: you observe a set of elements, then you get a list of change records. 11:27:08 dbaron, hober: 11:27:28 elliott: changeRecords: boudningRect, viewportRect, element 11:27:48 smfr: is this client coords? 11:28:30 elliott: both boundingRect and viewportRect is in coordinate space of client coordinates. 11:29:29 ojan: PositionObserver takes a config dictionary, takes in an element for the viewport which it is relative to. 11:30:00 ojan: 11:30:40 ojan: only fire the callback when the element intersects the start of the viewport. 11:31:06 ojan: case (1) just get callback when you enter/exit. 11:31:33 ojan: case(2) get callback when the percentage visability to the viewport changes. 11:32:06 ojan: case(3) extends the viewport so its slightly larger, i,e, 1s before. 11:32:15 smfr: this being time based is problematic. 11:32:28 ojan: this should be worded as "expected time". 11:32:38 ojan: decision between position vs. time here. 11:33:27 smfr: as an author with the time-based api the author then has to know how long it'll take to render content, but you don't know what device you are on. 11:35:09 dbaron: it seems like if there is something that has enough momentum to get into the range then you should fire the notification. Should be distance, or enough momentum to get into the viewport. 11:35:19 smfr: want to fire this event as fast as possible. 11:36:38 rossen: we spent a lot of time with WinJS team with their infinite scrollers, 6-8 screens of content, in order to realize all of these elements was distance based, they had 2 viewports of data before and after, (standard view cycling), all of the events were based on which portion of the viewports. 11:36:47 rosson: nothing was time based. 11:37:17 ojan: there are legitimate different ways to do this, chrome is time-based. we could expose both. 11:38:03 11:38:11 shane: no reason why we can't add time later. 11:38:49 dbaron: i feel like there is a use-case for a bool when says "call me back if you know you are going to be placed into the distance trigger" 11:39:04 dbaron: if the fling/etc has enough momentum to get there. 11:39:48 hober: we prototyped an event that would fire, when you nearly reached the bottom "will reveal bottom", "did reveal bottom" 11:41:18 summary: stick with distance initially + dbaron suggestion for bool. (see above). 11:41:24 \o/ 11:42:01 dino: we have use-cases for just inside the viewport 11:42:39 dino: we haven't progressed with out proposal before, because (ian summarizing) not powerful enough. 11:42:47 ojan: what is the sue-case again? 11:42:59 dino: animations that trigger based on position within the page. 11:43:09 ojan: i don't think that this will work for that. 11:44:02 dino: summary - could use this api if you could have -ve viewport modifier to trigger animations for elements going out/in of viewport. 11:44:22 ojan: async as threaded scrolling can't make sync api because of this. 11:45:36 smfr: 11:45:48 ^ not sure if i captured that properly. 11:46:13 elliott: fast fling should be fine, for use-case as ad is a blur, can't click. 11:46:25 smfr: probably fire this at scroll time. 11:46:50 eliott: we'd like to do this with queuing a task. 11:47:05 ojan: what are you concerns? 11:47:21 smfr: Concern about 1000's of items for infinite lists. 11:47:38 ojan: author can do willrevealbottom, just one element. 11:48:18 ojan: we will give ad networks example code to help them do the right thing. 11:48:38 smfr: I'm concerned about the viewport element, what happens if not in document, not parent, etc, etc. 11:48:51 smfr: lots of complexities with nested scrollers and what happens with those. 11:49:20 rossen: complexity with nested scroller? and add visibility. 11:50:04 ojan: ads only care about top level viewports? 11:50:40 rossen: 11:52:26 elliott: API is designed for ads billing problem, not the ad spam problem. 11:52:41 ojan: not trying to do occlusion, clipping, opacity, etc. 11:53:01 ojan: not going to solve occlusion here 11:53:38 ojan: could add in v2: in addition to boundingRect, guarenteedVisableBoundingRect. 11:54:16 elliott: bloom filter of visibility, yes you are visible or you *might* not be visible. 11:55:08 elliott: from our research you need to do pixel read-back to get 100% acc. 11:55:40 matt: this is just test interestion of two rects. 11:56:13 ojan: i do think we want to check if something is a decender of viewport element. 11:56:34 smfr: PositionObserver is firing inside the iframe? is this is security risk? 11:57:17 ojan: no, because we already expose this today. moz: innerScreen{X,Y}, non-moz: iframe throttle behaviour to detect this as well. 11:57:34 ojan: we are exposing more information, but can get at this. 11:57:56 smfr: is a bit weird to me that you are just intersecting two rects. 11:58:16 elliott: i disagree with ojan, think we should apply all intermediate scrollers. 11:59:47 dbaron: get it right for people who aren't trying to cheat? 11:59:51 elliott, ojan: yes. 11:59:56 dbaron: time check! 12:00:32 12:01:50 ojan: will do intersecting of rects up the ancestor chain. 12:02:06 smfr: can we change name? 12:02:13 12:02:36 RectIntersectionObserver? 12:02:44 ViewportObserver? 12:03:05 ISSUE: have bikeshed discussion. 12:03:59 ojan: do this through public-webapps or WICG? 12:04:18 dbaron: i think this has enough momumtum that this could go to public-webapps. 12:04:28 dbaron: WICG is meant to be step before. 12:05:32