17:51:39 RRSAgent has joined #webapps 17:51:39 logging to http://www.w3.org/2016/01/25-webapps-irc 17:54:47 rrsagent, make log public 17:55:01 Meeting: Web Platform - custom elements 17:55:05 Chair: chaals 17:56:15 Present+ PLH, Hober, William_Chen, AnnevK, DGlazkov, AdrianBa, TravisL, ArronEicholz, Léonie, Hayato, Ryosuke 17:58:44 agenda? 17:58:53 Zakim has joined #webapps 17:58:56 agenda? 17:59:01 agenda+ logistics 17:59:08 agenda+ agenda bashing 18:00:05 Present+ Jan 18:02:53 plh has joined #webapps 18:02:53 arronei has joined #webapps 18:02:57 hi 18:03:08 something 18:03:16 Present+ Smaug(remote) 18:03:19 wchen has joined #webapps 18:03:31 Present+ Plh 18:03:45 chaals: I'll be listening in the background while doing random other stuff. 18:03:51 smaug: can you hear us? 18:03:57 not right now 18:04:02 I did for awhile 18:04:06 k 18:04:09 yes 18:04:37 scribeNick: plh 18:04:46 [introductions] 18:05:00 Present+ Charles 18:05:04 Present_ Hayato 18:05:08 Present+ jan 18:05:12 Present+ Ryosuke 18:05:30 Present+ Antti 18:05:46 wilsonpage has joined #webapps 18:06:14 Present+ Monica 18:06:18 Present+ Justin 18:06:29 rrsagent, make logs public-visible 18:07:07 kochi2 has joined #webapps 18:07:15 zcorpan has joined #webapps 18:08:15 kochi2 has joined #webapps 18:08:46 just joined on webex. 18:08:57 Present+ Kochi(Remote) 18:09:08 Topic: agenda bashing 18:09:30 annevk has joined #webapps 18:09:41 -> https://github.com/w3c/webcomponents/wiki/Custom-Elements:-Contentious-Bits Contentious bits: things for the agenda 18:09:50 Travis: looking at contentious bits, we should do: review of constructors, simple name properties, attribute change callback 18:10:08 plh: ah, what are the settings? 18:10:09 wilsonpage has joined #webapps 18:10:18 plh: you might want to update https://www.w3.org/Project/IRC/ then 18:11:19 Travis: [....] 18:11:58 justin has joined #webapps 18:12:58 dglazkov: we should start with least contentious 18:13:05 agenda+ lifecycle callback timing 18:13:37 zakim, take up item 3 18:13:37 agendum 3. "lifecycle callback timing" taken up [from chaals] 18:13:39 Travis: so is it documented yet when to fire a nano task? 18:13:50 Anne: when IDL returns, but not documented yet 18:14:00 q? 18:14:10 dglazkov: there is a queue 18:14:37 Anne: just before the method is called, there would be a nanotask 18:15:00 Travis: we assume it's introduced when to invoke a method in WebIDL 18:15:39 Travis: if a nano can queue more work that results in a microtask... 18:15:47 jan_miksovsky has joined #webapps 18:16:02 Ryosuke: you have a stack of nanotask 18:16:18 Travis: so sync but delayed after the operation... 18:16:46 s/just before the method is called/just before you return from the method call/ 18:17:00 ACTION: chaals file issue on WebIDL 18:17:00 Error creating an ACTION: could not connect to Tracker. Please mail with details about what happened. 18:17:48 [this is resolved] 18:17:50 s/issue on WebIDL/issue on WebIDL to get the nanotask flow documented 18:17:58 RESOLUTION: We're happy to do it like this 18:18:08 Topic: Symbol Name vs String name 18:19:05 Travis: concern is: what if we move the logic of custom element and put it into mutation observers? 18:19:19 ... so that you have one API for observing mutations 18:19:35 ... attach/detach/reparenting should be addressed in mutation observers 18:19:44 ... in addition to want nanotask timing 18:20:04 Ryosuke: that would bring queing vs tasking 18:20:10 rrsagent, draft minutes 18:20:10 I have made the request to generate http://www.w3.org/2016/01/25-webapps-minutes.html chaals 18:20:32 .... one reason to design this way was that it was easy for mutation observer to step on each other 18:20:54 ... if you modify something in a mutation observer, you have no idea of the ordering 18:21:06 ... if we move the logic, we would reintroducing the problem 18:21:20 Travis: I just want to move the API surface 18:21:34 .... to make it general purpose 18:21:45 ... I don't have to create a new API 18:21:47 Present- jan, Plh, Charles 18:21:58 ... just have to take care of the constructor 18:22:05 Ryosuke: make sense to me 18:22:18 Travis: I'm saying we should punt on it, but would like to transition 18:22:21 one of the reasons for MutionObservers was performance, which is a lot better than with more sync (nanotask-like) MutationEvents. 18:22:33 Anne: how would we do that? 18:22:50 (microtasks give the better performance) 18:23:56 [break to bring Domenic] 18:24:00 See https://www.w3.org/Bugs/Public/show_bug.cgi?id=23250 Travis 18:24:04 Present+ DomenicD 18:25:19 monica has joined #webapps 18:26:28 jsbell has joined #webapps 18:26:30 Ryosuke: some elements affect others only if they are in the document (bese, style) 18:26:33 s/saying we should punt/saying we should not punt 18:27:00 Domenic: detached documents are so rare 18:27:07 s/bese/base 18:27:54 dglazkov&Ryosuke: agreed 18:28:05 dglazkov: I like the idea of a generic callback 18:28:14 s/so rare/so rare that yes, we can leave it as an edge case we don't solve 18:28:38 Ryosuke: so, if we add the attribute filter, it might be ugly. 18:29:11 s/ugly/ugly to have two different was to follow attributes changing 18:29:23 domenic: making sure they match it's fine, but it's important to have both. eg being notify when creating custom elements 18:29:45 travis: you can always observe your own attributes, so damage is limited 18:29:54 s/always/only 18:30:03 ryosuke: we have a bunch of other sync events, not sure if it matters 18:30:40 ... with a microtask ending, you would batch those if lots of elements 18:31:02 zakim, who is on the phone? 18:31:02 Present: Smaug(remote), Ryosuke, Antti, Monica, Justin, Kochi(Remote), DomenicD 18:32:19 ryosuke: range functions will operate on custom elements. nanotask will fire at the end of the range operation 18:32:34 anne: but that might not involve any IDL 18:32:50 ... at least, it's not written down 18:34:20 Resolved: generic callback need be written down, instead of detach/attach 18:34:31 https://github.com/w3c/webcomponents/issues/362 18:35:54 Ryosuke: when navigating an iframe, you would fire those callbacks 18:36:07 Anne: except that script execution is stalled 18:36:45 Domenic: if had a parent browsing context change callback could do the trick 18:37:19 Anne: when do we have the more restrictive callback, ie when the doc change 18:37:29 s/when/why 18:37:31 Domenic: very spammy, and not many use cases 18:37:37 s/why/when 18:37:46 s/when do we/why do we only 18:38:00 Ryosuke: when you keep inserting substree, it would generate a lot of callbacks 18:38:12 Anne: so, are shadow tree are in a composed document? 18:38:20 s/are in/in/ 18:39:19 Ryosuke: ordering is important... 18:39:49 Ryosuke: when getting a callback, should we have it before invoking callback for subcomponents? 18:40:13 i/Anne: why do we/Ryosuke: We don't want the author scripts to run when you navigate away from your iframe… which is notified by pageVisibility rather than attached and detached 18:40:13 Domenic: use case points to the document 18:40:27 Ryosuke: but it's important to figure the ordering 18:40:51 zcorpan has joined #webapps 18:40:56 Ryosuke: top-down order, your subcomponents might not be ready 18:41:28 Ryosuke: take the layout component. you'll need the subcomponents 18:41:56 Justin: should components assume they have their subcomponent or get updates 18:42:10 ... for layout you want to respond as the children are updated 18:42:44 Justin: we've seen cases when people want to know when children are ready, but it seems the wrong way 18:43:11 Travis: if you're a tab layout, you'll need at least 2 children 18:43:33 Justin: I used when you need to setup something up the tree 18:44:02 Domenic: like when starting to listen to mouse events 18:44:18 Domenic: bottom-up seem to encourage a bad style 18:44:31 Justin: yes, I've seen it misused already 18:44:55 ... I'm partial to encourage to listen to child changes rather than assuming the children are correct 18:45:19 Domenic: we'll probably top-bottom for constructors so we should do the same 18:45:21 Ryosuke: agreed 18:45:40 Jan: some components want to know how they're styled 18:45:51 ... when do I have style information? 18:46:06 Ryosuke: sounds like horrible squared problem... 18:46:29 dglazkov: we should discourage people doing so, but they'll keep doing it :) 18:46:43 dglazkov: we need to keep looking for answer 18:46:49 s/horrible squared problem/it leads to a horrible n-squared algorithm 18:46:51 Justin: I'd like a style observer 18:47:13 Travis: combination of mutation observers and style attributes 18:47:49 Anne: seems weird. there is a term called "in a document" that will return false ina shadow root tree 18:47:59 ... for those, we have "in a composed document" 18:48:26 Domenic: we need to change the author facing name or change the spec 18:48:45 Hayato: "inserted into a document deeply"? 18:48:58 ... we have to resolve the distribution anyway 18:49:19 Jan: can we have a name that doesn't have to be precised? 18:49:36 rrsagent, please generate a name 18:49:36 I'm logging. I don't understand 'please generate a name', plh. Try /msg RRSAgent help 18:50:02 [naming discussion] 18:52:14 [naming discussion...] 18:52:48 Domenic: if you do document.contained, it won't return true in a deep/composed document 18:53:03 s/contained/contains/ 18:53:15 Anne: inserted and removed are fine 18:53:53 Justin: the fact that we have removed is an argument against a callback using remove 18:54:18 Justin: node.remove will not always do a remove 18:54:28 ... if you're a detached case 18:54:51 Resolution: We need to find a good colour^name 18:54:55 Unresolved: someone to come up with a proper name 18:55:28 [back to symbol names] 18:55:53 Domenic: let's separate public API from subclass API, but agree it';s not ergonomic 18:55:57 Topic: Symbol or String 18:56:48 Domenic: one design is to hide those on prototypes but it's disruptive 18:57:10 s/those on/those by putting them on another object not directly on 18:57:19 Anne: problem with symbol things is extending 18:58:01 Domenic: no two symbols are ever equal to each other 18:58:21 ... with strings, we would be able to change the semantic as easily 18:59:19 Domenic: there is a cultural opinion against encouraging subclasses, while we're encourage to do so at the moment 18:59:50 Jan: we're running the risk of conflicts already 19:01:06 Domenic: you don't avoid very much by going to symbols 19:01:26 ted: the day 2 day cost outweight the purity... 19:01:38 Domenic: so we have to go back to callbacks on everything... 19:01:58 [general agreement] 19:02:13 Resolution: no change from current spec. 19:18:33 scribe: Travis 19:18:36 jan_miksovsky has joined #webapps 19:18:38 scribeNick: Travis 19:19:04 domenic: We may have exhausted the non-controversial stuff 19:19:16 ... callback timing 19:19:23 ... parser stops 19:19:29 ... fires attribute changed 19:19:42 ... children 19:19:44 ... then resumes 19:20:03 ... seems there's good cause to fire the callbacks as soon as possible. 19:20:30 ... will require some deep parser spec engineering :-( 19:20:30 even in case of innerHTML ? 19:20:52 anne: formalizing document.write? and applying to other elements? 19:21:04 rniwa: we should disallow document.write 19:21:18 Not in the case of innerHTML. That allows you to observe the fragment inside the algorithm 19:21:19 ... there's a flag for that already. 19:21:33 anne: the other problem is dom mutations. If you remove the element, where does the parser resume? 19:21:47 Domenic_: we should just disallow document.write. 19:22:30 annevk: the parser already follows the stack 19:22:40 Domenic_: this is another level of complicated. 19:22:54 ... I'm looking for clear-cut places to disallow things. 19:23:18 rniwa: in a constructor, script element is created and sync-inserted into document, what then 19:23:34 Domenic_: scripts inserted from XHR are disllowed 19:23:50 annevk: because those docs have no browsing context. 19:23:53 monica has joined #webapps 19:24:18 annevk: with random scripts, you're just nesting a little 19:25:04 sicking has joined #webapps 19:25:10 rniwa: document.open/write only cases of reentrancy? 19:25:22 Travis: parser can stop at any time... 19:26:01 annevk: all these concerns already apply to script element. We already have syncronicity. 19:26:10 Domenic_: I just disallowed in modules because they are 'bad' 19:26:24 annevk: Here it doesn't really buy us anything. 19:26:43 Domenic_: [describes the order of operations] 19:27:01 q? 19:27:17 smaug: even in places of innerHTML? 19:27:26 Domenic_: good point. 19:27:44 ... right now the fragment in innerHTML is a spec fiction. This feature would allow that to become observerable. 19:27:58 ... alternatives are to wait until nano-task timing. 19:28:14 annevk: with innerHTML, parser has to queue the nano-tasks. We then define when to fire these. 19:28:32 Domenic_: according to my new order, parser never queues nano-tasks. 19:28:41 annevk: Well,they can be syncronous... 19:28:55 ... in innerHTML case they get queued as well. 19:29:35 rniwa: inside of parser, it would be sync, but in innerHTML it would be nano-task. Is that what is being proposed? 19:29:54 Domenic_: well we have upgrades and parsing... we're saying innerHTML is an upgrade case. 19:31:17 rniwa: having the parser act two different ways is weird to me. 19:31:49 Domenic_: for authors, I could argue that innerHTML and parsing are understood differently. 19:32:01 rniwa: As an author now I have to worry about it? 19:32:12 Domenic_: The argument is that you code it as if there are no children. 19:33:53 Travis: for consistent world view, should we not fire attribute changed if they're already present at constructor time? 19:34:49 dglazkov: I can come to terms with innerHTML being treated as an upgrade case. 19:35:30 LJWatson has joined #webapps 19:35:46 justin: I see danger that authors will set attributes (default) during parsing expecting to have the parser overwrite them... 19:36:16 Domenic_: Forcing innerHTML to have the upgrade world-view will change author expectations. 19:36:41 monica: we rely on default attributes (versus user attributes) for aria. Order is important for us. 19:36:47 ... we do this on attached. 19:37:18 annevk: for aria we should have an internal API. Then you can set defaults and have them be overwritten. 19:37:26 ... you'd have some internal slots for that. 19:37:44 ... you don't want to have the attributes be the cannonical state. 19:38:19 justin: are you referring to how the properties have the 'computed value' whereas the attribute has whatever state was set. 19:38:51 ... there are some cases where you do want to write an attribute for the purposes of styling... 19:39:01 dglazkov: are we getting close to resolving this? 19:39:28 Domenic_: I'm not really comfortable with saying that [it] happens synchronous. TAble for 20 mins, or decide? 19:39:32 rniwa: table it. 19:39:47 annevk: Folks always deferring to script, depending on upgrades... 19:40:00 Domenic_: I don't think the innerHTML case changes this. 19:40:05 Domenic_: OK. New topic. 19:40:13 ... registerElement or new API name? 19:40:18 dglazkov: new name!!!!! 19:40:37 RESOLUTION: use defineCustomElement - void… 19:40:41 travis: talk slower 19:40:43 Domenic_: apple did "defineCustomElement" 19:41:16 rniwa: the name is kinda long, but I like long names. 19:41:27 annevk: I'm happy bikeshedding... er with 'defineElement' 19:42:34 jan_miksovsky: I like the similarities between defineElement and createElement... they look nice together. 19:43:10 RESOLUTION: No, actually defineElement seems a great idea 19:43:20 Domenic_: single class per element name? 19:43:32 rniwa: ins/del use the same interface. 19:43:49 justin: Some folks want to be able to use "is" as a mixin 19:44:13 ... not only using single class def for multiple elements. 19:44:51 justin: I want some sugar (a custom element definition) and apply to other elements in the document. 19:45:24 rniwa: If your module only defines the class, then you can leave it up to author's to define the names. 19:45:36 dfreedm has joined #webapps 19:45:49 rniwa: If no one objects to mutliple tag names per class... 19:46:05 I object:) 19:46:26 I think it's a bug in the platform that we didn't have class per tag name 19:46:31 ... then there is a problem with how the exotic object is created. 19:46:43 Domenic_: fixable if you pass tagname through super(tag_name). 19:46:47 annevk has joined #webapps 19:47:18 [PLH steps out] 19:47:27 rniwa: Then you have to propogate the usage of tagname (both externally and internally to your class) 19:48:01 Domenic_: during parsing you encounter how does the parser tell what to do in the class? 19:48:06 Yeah that seems bad, tag name should be read from a static on the class 19:48:25 Domenic_: This constrains the first argument to custom element constructor to have the tag name. 19:48:38 rniwa: constructor can return whatever it wants! 19:48:42 ... we could allow this. 19:48:50 ... It would be a known issue. 19:48:56 Domenic_: what happens when constructor throws? 19:48:56 static get tagName() { return "x-foo"; } defineElement tears off the getter just like it does for attached and friends 19:49:32 rniwa: When it throws, when in parsing, we probably need to create HTMLUnknownElement. 19:50:02 rniwa: It's OK for custom element constructor to return a text node. Then the parser tries to add a child to it... and .... kaboom! 19:50:16 annevk: I think you just need to create an HTMLUnknownElement in all these cases. 19:50:19 Hmm... I think if you return something that is not an Element we should abort the process and leave it as an Unknown 19:50:22 Yes 19:50:37 justin: back to elements with mutliple tag names... can't you solve this similarly to constructor-call trick. 19:51:03 Yeah, i agree with Anne 19:51:03 ... when you call into HTMLElement constructor it has some magic to know what the tag name will be. 19:51:33 Travis: So then this becomes implicit and not exposed to web code? 19:51:53 Can it consult the parser state? 19:51:54 rniwa: You can call your super constructor multiple times... (via new ...) 19:52:26 justin: You have some global state. Showed Eliott, he said... 19:52:34 https://gist.github.com/domenic/c1566e755c9e14613aa1 19:52:36 [lost it] 19:52:50 I think you can just ask the constructor table though 19:53:05 jan_miksovsky has joined #webapps 19:53:24 Domenic_: [looking at link... hard problem... if a new happens before the super call] 19:53:50 justin: given new.target, other state, etc., you might be able to figure it out. 19:53:54 bicknellr has joined #webapps 19:54:04 Domenic_: if you call new.target it will have the wrong target (to be sure) 19:54:14 ... we can expand a check. 19:54:29 justin: you have to check a stack to make sure you haven't re-entered yourself. 19:54:57 annevk: What's the problem (summary)? 19:55:04 I need help from the lobby :) 19:55:19 rniwa: When super() is called, we need to construct the right element (whatever the parser's trying to create). 19:55:35 ... in upgrade, this is really important. The super() call needs to return the right object (you). 19:56:45 ... now when you make a new call to yourself, things get confused. 19:57:02 justin: I think you can solve this. With new.target + a stack. 19:57:09 rniwa: yes, you can, but ugggg. 19:57:25 ... Also, constructor could be inline. 19:58:08 [esprehn arrives] 19:59:14 rniwa: There is a point when you can detect this... after you return from the constructor. If during the constructor, you already called a constructor, then you could fail out (bail). 19:59:30 Present+ ESprehn 19:59:34 LJWatson has joined #webapps 19:59:36 ... problem is that super() call is returning completely random object. 20:00:07 esprehn: In ES6, if constructor keeps returning random stuff. 20:00:25 Domenic_: super() is short for this = new super(). 20:00:45 esprehn: new.target is the thing at the bottom of the stack. 20:00:50 https://gist.github.com/domenic/c1566e755c9e14613aa1#gistcomment-1679615 20:01:01 rniwa: what if you call you're own constructor (or another element). 20:01:23 Domenic_: Did this fix it? 20:02:04 rniwa: The inner call will work, but then it will throw. 20:03:02 justin: combined with HTMLUnknownElement, this is what you will get. 20:03:26 trackbot has joined #webapps 20:04:33 justin: You can crazy constructor stuff _after_ super. But if you do it before... 20:04:38 rniwa: you're just a bad person. 20:04:41 [all agree] 20:05:35 rniwa: [discovers the white-board] 20:06:41 rniwa: describes case with new element created in first line of a constructor. 20:06:50 ... then there's a super call... 20:07:53 ... conclusion: we have to disallow both before and after new creations in the constructor. 20:08:10 justin: without using a stack. 20:08:11 https://gist.github.com/dglazkov/72ae5223631c525ba6e7 20:08:26 justin: we may need another global to manage the 'in UA construction' 20:08:55 rniwa: Seems desirable to create some kind of element... 20:09:35 justin: Well... maybe you could wait till attached[bikeshed]callback. 20:09:58 esprehn: can't we just change ES6 construction/creation? 20:10:20 esprehn: I think developers will revolt if we disallow creating new elements in the constructor. 20:11:22 annevk: input type password, like input type text/button. There's some precident. 20:11:28 rniwa: OK, so we can't throw. 20:12:05 ... in output we can check to see if the thing we thought would be created was created, and if not throw. 20:12:27 rniwa: Working backwards, reviewing the implications of this change... 20:12:58 esprehn: in upgrade case, what happens? 20:13:51 esprehn: If we swizzle your prototype and things break, then... what? 20:13:57 rniwa: Leave it. 20:14:08 Domenic_: and things are half-baked and broken. 20:14:58 esprehn: You'd queue an exception to fire up the stack (for onerror) 20:16:11 jan_miksovsky: We really want a constructor without a required parameter 20:16:29 ... how would this problem be different if there was an argument to the constructor? 20:16:46 ... all these games to make sure we support a constructor without arguments? 20:16:52 Domenic_: no, this is more base than that. 20:18:04 [discussions and clarifications] 20:18:31 Domenic_: someone who understands these implications better than me should write this up. 20:18:35 rniwa: I can do this. 20:18:49 marcosc has joined #webapps 20:19:06 chaals: break for lunch? yes. 20:40:14 LJWatson has joined #webapps 20:45:56 monica has joined #webapps 20:53:58 sicking has joined #webapps 21:05:56 jan_miksovsky has joined #webapps 21:07:35 chaals has joined #webapps 21:08:03 rrsagent, make minutes 21:08:03 I have made the request to generate http://www.w3.org/2016/01/25-webapps-minutes.html adrianba 21:08:18 rrsagent, make logs public 21:08:54 ACTION: rniwa write up what the caller for custom element constructor and HTML element constructor should check 21:08:54 Error creating an ACTION: could not connect to Tracker. Please mail with details about what happened. 21:09:35 LJWatson has joined #webapps 21:09:53 arronei has joined #webapps 21:13:24 scribe: dglazkov 21:13:52 [discussion around timing of callbacks/constructors] 21:14:21 esprehn: the parser will be special and innerHTML and others will have a nanotask timing 21:14:40 rniwa: disagree. the problem is that this will be inconsistent 21:15:08 rniwa: compound operations, editing 21:15:21 esprehn: run all callbacks sync? 21:15:25 rniwa: just constructors 21:15:48 [discussion around where to run sizing code for custom element] 21:16:31 esprehn: defer all interesting work until it's time to run attach 21:16:56 rniwa: disagree, you can't just change my opinion by repeating the same thing 21:17:36 rniwa: I added EventQueueScope and we still sometimes run script during editing 21:18:12 esprehn: would like to avoid running script during editing, and if they do, treat them as a bug 21:18:34 domenic_: this is one of our "can not live with" issues 21:19:41 rniwa: in this case we can't reach the agreement today 21:20:28 esprehn: this has benefits, right? you have to make it work with both upgrade and non-upgrade, you have a better design 21:20:56 esprehn: [provides an analogical design decision] 21:21:13 esprehn: [ ... in android] 21:22:34 jan_miksovsky: asking clarifying question: am I hearing correctly that esprehn is suggesting I should defer important work until "attached" callback? 21:22:44 [clarifying discussion] 21:23:26 hober: probably good to distinguish the discussion between how we want people to write code and how they will actually write code 21:23:54 jan_miksovsky: may make sense if you change the stakes (throws in the case we don't want people to write code) 21:24:15 Domenic_: has been my opinion that this does not come up very often 21:24:43 Domenic_: devs will not see a lot of difference unless they do a lot of work 21:25:29 esprehn: complaints we see from devs: 1) finishedParsing callback for element; 2) attribute setting during constructor 21:26:00 annevk: part of the mismatch might be that Blink believes that they can defer everything that happens, and WebKit does not quite believe that. 21:26:40 Domenic_: Gecko delays some of the mutation events already 21:26:49 annevk: not all cases 21:27:13 jan_miksovsky: 21:27:25 jan_miksovsky: what's the reason for synchronous constructor? 21:27:49 rniwa: ideally, we want to do everything synchronously 21:28:05 rniwa: easiest ergonomics, consistent world state, do something -> happens 21:28:38 rniwa: in some cases it is okay, like attributeChanged 21:28:53 cdata has joined #webapps 21:29:00 rniwa: not okay for the cases when the object is being created and constructor is not called 21:29:30 justin: but this is true for upgrades? 21:29:41 rniwa: right, this is why we don't like them 21:30:18 justin: since you already have to assume the upgrade case, why do you need to have sync constructor? 21:31:21 rniwa: for attributeChanged case, at least you can call a method on an object, but with async constructors you literally don't have the right proto/identity of an object 21:31:45 [discussion around when this would happen] 21:32:27 monica: this is why we don't do any important work in created, except for creating a stub shadow tree maybe 21:32:40 shepazu_ has joined #webapps 21:33:15 annevk: in HTML spec, most of the work happens when an element is inserted or removed. Creating element does nothing most of the time. 21:33:46 esprehn: another case, innerHTML fragment is spec fiction, and ideally we should not make it be observable 21:34:13 rniwa: interested in what Mozilla/Microsoft thinks, may help sway 21:35:00 annevk: if we can prove that we can move all events to nanotask timing. If we did, then we will be convinced. Otherwise, the sync argument stronger 21:35:27 Travis: nanotask looks like sync 21:35:35 annevk: no, there are some cases where you can see 21:35:49 annevk: from the spec perspective it would be better if we did everything deferred 21:36:28 Travis: in spec, if you clone the tree, do you get 3 callbacks? 21:36:32 annevk: yes 21:36:51 Travis: so it's identical to microtask? 21:37:11 rniwa: no, because is a stack of queues 21:37:11 plh has joined #webapps 21:37:19 [discussion] 21:37:41 esprehn: modeled after auto-release pools 21:37:57 me thanks! 21:38:27 jan_miksovsky: what's the right model to prevent component model? If I were to create a boilerplate, what's my general model? 21:38:48 jan_miksovsky: I don't think I can explain to someone when to do what. As a component author, I am a little confused. 21:38:50 [PLH returns] 21:39:14 jan_miksovsky: "here's a bunch of hooks, use them as you see fit". I would prefer a good boilerplate 21:39:23 annevk: there are many different models? 21:39:41 Domenic_: pretty decent consensus on what the boilerplate is 21:39:59 annevk: in img element, you might want to start as early as possible 21:40:15 esprehn: that might be an anti-pattern 21:40:37 jan_miksovsky: ask for a tighter range of options 21:41:13 justin: not sure the sync/async changes this boilerplate 21:41:33 jan_miksovsky: if no useful work happens in constructor, would this be significant for this discussion? 21:42:10 Travis: no one here is saying we should take away the constructor callback, right? 21:42:22 annevk has joined #webapps 21:42:40 esprehn: use constructor to set up shape of the object (and stop changing it if you want to run fast) 21:43:00 esprehn: might not be the same time quantum as the one to look at your attributes and children 21:43:48 Domenic_: [some proposal about attribute change listening, not clear] 21:44:26 justin: what's the relationship between attributeChangedCallback and insertedIntoDocumentCallback? 21:44:37 Domenic_: inserted is called after 21:44:48 justin: that's okay then 21:45:03 justin: [explains how complex elements need a state machine] 21:45:23 Domenic_: upgrade should call attributeChangedCallback and cal insertedIntoDocumentCallback 21:45:44 Domenic_: and need to define an order 21:45:59 annevk, esprehn: call before 21:46:14 [discussion around order] 21:47:20 annevk: most good elements should work either way. Script src is different, but should work either way 21:48:28 Here are events that fire synchronously in both WebKit/Blink: v 21:48:29 https://jsfiddle.net/gxwdv5vv/2/ 21:49:04 https://jsfiddle.net/h3L8sz2w/2/ 21:49:09 jan_miksovsky has joined #webapps 21:49:52 [looking at what does Edge do] 21:49:58 [and what Firefox does] 21:51:30 s/prevent component model/build components 21:51:32 s/prevent component model/build components/ 21:52:15 rniwa: looks like only Blink/WebKit fire these sync 21:52:20 Travis: focus is sync 21:53:05 rniwa: so at least one event is fired sync 21:53:26 Travis: are we still stuck on constructor/nanotask discussion? 21:54:05 wchen: I don't think we can confidently say that we'll be robust against sync constructor 21:54:13 annevk: bz says it will be significant amount work 21:54:39 jan_miksovsky: so your preference would be to be async in non-constructor case 21:54:41 annevk: yes 21:54:58 annevk: we are already moving to nanotask timing somewhat 21:55:19 jan_miksovsky: so that adds up to proposal non-parser async constructor 21:55:24 jan_miksovsky: Travis? 21:55:30 Travis: parsing is fine 21:56:00 Travis: otherwise, thinking of our design, we have a consistent tree model, which matches all changes to the tree 21:56:35 Travis: [describes how Edge model works] 21:56:46 Travis: will need archeology 21:56:54 Domenic_: definitely will need archeology 21:57:00 wilsonpage has joined #webapps 21:57:06 wchen: seems like we need it anyway 21:57:21 rniwa: we should have a comprehensive list of methods/getters/setters 21:57:29 Travis: that could modify DOM 21:57:41 rniwa: I am sure browser will have extensions, etc. 21:57:51 https://code.google.com/p/chromium/codesearch#search/&q=CustomElementCallbacks&sq=package:chromium&type=cs 21:57:53 Travis: I think it's fine, we can build support for architecture 21:58:14 Travis: it's probably harder to nanotask than sync 21:58:51 annevk: you need to make sure it doesn't mess with your state 21:58:59 Travis: yes, but it's a smaller set 21:59:14 Travis: we can implement, and dev ergonomics will be better 21:59:32 Travis: these are all good reasons to go with nanotask 21:59:47 jan_miksovsky: I heard support from Mozilla and Edge 21:59:54 wchen: we already have something like this 22:00:27 rniwa: it seems that there's support, so there's no reason to argue 22:00:43 RESOLUTION: Nanotask timing for constructor 22:01:27 [break!] 22:02:09 unbreak! 22:02:22 Domenic_: the only issue that was remaining was attribute filter for style attribute 22:02:30 dglazkov: does anyone not want it 22:02:35 chaals: put a proposal on IRC 22:03:24 ( hmm, ok, skype kicked me out. ) 22:04:33 Attribute filter proposal: at defineElement time, we grab constructor.attributeFilter and convert it to an IDL sequence (i.e. iterate over it and ToString each element). If it's not present, defineElement throws. 22:05:54 Domenic_: so how do you get notifications for all the attributes? 22:06:13 null attributeFilter? 22:08:46 you can't, I think 22:08:51 no built-in elements have that 22:09:17 ah, true 22:13:15 chaals has joined #webapps 22:19:29 scribe: rniwa 22:20:06 Domenic_: there is a question of style attribute spamming attributeChanged callbacks 22:20:24 Domenic_: the proposal is to add an attribute filter which is a static property on class 22:20:31 marcosc has joined #webapps 22:20:53 Domenic_: It's a mandatory property and it's statically bound at the time of `defineElement` call time 22:21:30 class XFoo { static get attributeFilter() { return [ "a", "b" ]; } } 22:21:54 justin: why don't we not invoke attribute callbacks instead 22:21:58 Domenic_: that sounds better 22:22:21 justin: how about prefixing matching 22:22:35 esprehn: some libraries requested. e.g. for on*. 22:23:00 (sounds like something not for v1) 22:23:12 (that prefix matching ) 22:23:26 chaals: the point of this filter is reducing the number of attributes being observed 22:23:29 [agree with smaug] 22:23:41 justin: but how about an element that proxies attributes / properties? 22:24:27 esprehn: if we were to add *, I wish it would exclude "style" so that you'd have to write "*+style" in order to receive callbacks for style attribute 22:25:00 dglazkov: for v1, no * and no attribute change callback if it's missing. 22:25:55 marcosc has joined #webapps 22:26:16 jan_miksovsky: there is already mutation observer that can observe all attributes 22:26:48 jan_miksovsky: in MO, you can modify the list of attributes being observed dynamically 22:27:42 Domenic_: for those who think reading the filter value once is weird, both the callback function and the attribute filter values are read once at `defineElement` time 22:28:33 rniwa: missing attributeFilter with no callbacks, mutation observer you always get callback… that's weird 22:29:16 Domenic_: what if we renamed it to attributeChangeFilter. 22:29:47 rniwa: my point was that semantics is different 22:30:41 esprehn: in the case when attribute filter is present, the behavior is the same 22:31:49 annevk: on a different topic, why do we keep the callback at the time of `defineElement`? 22:32:04 annevk: if we had a subclass and called `super()`, it wouldn't be calling something different 22:32:49 rniwa: agree, it is weird if DOM has this stuff on the side. 22:33:34 esprehn: It's slow to do it like justin wants, working dynamically. 22:33:49 DD: You don't get at queue time you do it at call time. 22:33:58 esprehn: then we queue stuff we will drop on the floor 22:34:03 DD: What if you @@ 22:34:09 Justin: kind of leaky 22:34:21 AvK: If you don't have attributeChange you don't have attributefilter 22:34:37 … subclasses will always be slow because when they invoke super thereis a get and call 22:34:45 esprehn: no it is at registration time. 22:35:06 … you have a bunch of static getters used at definition time 22:35:45 Avk: if you have a subclass that invokes super, the call will do a get on the super class, and you will then have the slow stuff to do 22:35:51 rniwa: You don't want to queue stuff. 22:36:09 justin: guessing for most elements a framework will be there always defining these callbacks 22:36:14 DD: I'm a bad person. 22:36:43 esprehn: You can write a super.attributeFilter … 22:36:43 rniwa: if we had an attribute filter, you want to create a static internal structure for each custom element 22:36:52 esprehn: ^ 22:37:05 esprehn: instead of having to keep querying to the engine. 22:37:56 esprehn: for callbacks, we can still cache the existence of methods 22:38:16 annevk: mostly to determine the shape? 22:38:22 Domenic_: I also like the idea of not being able to change the behavior of class 22:38:41 annevk: we can also do the shape check at runtime 22:38:48 kochi2 has joined #webapps 22:38:51 annevk: as to whether it has a callback or not 22:39:16 justin: that might lead to even more confusion because author can change function and some changes take into effect and others don 22:39:17 't 22:39:43 Domenic_: I don't think you should really mess with your class structure after calling `defineElement` 22:40:44 esprehn: the old design involved passing arguments around and chained it across super calls and that's how the server side stuff works 22:40:50 esprehn: but nobody liked that design 22:41:31 Domenic_: we should throw when an attribute callback is there but no attribute filter is set 22:42:37 ACTION: Domenic_ will write a formal spec for attribute filter 22:42:37 Error creating an ACTION: could not connect to Tracker. Please mail with details about what happened. 22:43:41 Topic: is= 22:43:43 hober: I think we kind of agreed not to do it. 22:44:21 justin: Polymer uses "is" and perhaps this is an instance in which the views of Chrome / Polymer are different. 22:45:03 monica: there is a lot of element for which parser treats differently 22:45:08 (Attribute filter writeup: https://github.com/w3c/webcomponents/issues/367) 22:45:18 monica: for example, td has a special behavior in HTML parser 22:45:48 monica: so unless you can extend an existing element, you can't have parser treat it differently 22:45:56 justin: the most important use case for us is template element 22:46:44 justin: this might be a case in which wrapping with another element might work but we've seen some customers experiencing performance problems due to the sheer number of nodes in the document 22:47:03 Travis: what are those custom elements doing? 22:47:20 Domenic_: what they are is that they want to have these callbacks be involved on elements that already exist 22:47:43 Travis: this feels like the use case of end-of-nano task mutation observer 22:47:59 esprehn: that's not right. they also want to be able to add methods or accessibility features 22:48:26 Travis: and you probably don't want to write everything yourself 22:49:18 Travis: so if you had HTMLAnchorElement defined and extended it, it's still an anchor element browser supports but you're supplementing it with callbacks and methods? 22:49:41 Domenic_: it's important to separate functionality from the particular syntax of is=~. 22:50:16 Domenic_: in theory, this should be also achievable via custom tag name but bz pointed out that this would require a large rewrite of browser engines that check tag names 22:50:25 plh: what happens with selectors? 22:50:41 Travis: I'm still not sold on why you can't wrap it 22:50:57 Travis: is= is like creating a new object to an existing element 22:51:42 esprehn: browser creates an exotic object which is anchor and then browser sticks the prototype into the instance 22:51:48 esprehn: it's just like upgrades 22:52:27 esprehn: the API currently doesn't have any checks for your custom element class not actually inheriting from a subclass of HTMLElement 22:52:53 justin: it seems like there was a consensus to drop this feature in v1, but for Polymer, this goes a long way 22:53:16 monica: templates and lists are big use cases 22:53:23 hober: does component kitchen use it? 22:53:25 jan_miksovsky: no 22:53:50 (and inputs and buttons and forms, for use cases) 22:54:16 dglazkov: if i were to remove myself from implementation, this whole this is about unveiling things that you can't get out of right now 22:54:33 dglazkov: I want the same behavior parsing as "td" and want the same ARIA role, etc... 22:54:55 annevk: it feels like is= is not the right solution for this 22:55:16 Domenic_: but it would take a really time to resolve all of these problems property 22:55:41 jan_miksovsky: we didn't find not being able to insert a random element inside option, select, etc... haven't been that much of pain 22:55:57 jan_miksovsky: there has been a few cases like defining button without is= with the right style was hard 22:56:17 jan_miksovsky: we have seen it's painful to proxy properties and methods when wrapping elements 22:56:45 jan_miksovsky: syntax of is= seems a bit cranky saying this is one class but then it's another class 22:57:03 Travis: you can't use these elements plainly with createElement 22:57:21 justin: in terms of weirdness, we see tag names as roles 22:57:44 justin: and is= is the actual implementation 22:57:58 justin: there is also a consideration for third party tools that may expect standard HTML tag names 22:58:28 LJWatson: feels like this might be a similar problem as ones encountered in epubs 22:58:58 Domenic_: this isn't a must have but this seems to solve many issues like accessibility 22:59:16 Domenic_: shadow DOM already has restrictions on which element it can attach 22:59:41 chaals: restricting has a nice appeal 23:00:07 annevk: what if you wanted to apply new behaviors on a subset of elements 23:00:41 esprehn: parser also closes head when it hits an element other than one of the three elements 23:01:00 esprehn: so there is no way to put things into head with custom elements 23:01:16 esprehn: and we need to make the parser behavior different in order to allow this 23:01:22 annevk: we probably don't want to allow that because that would require everyone running scripts all the time 23:02:04 Domenic_: more generic syntax for inheriting from an element will be instead of 23:02:19 but this syntax has all the downsides of having to look up definitions 23:02:48 hober: is= seems like a good feature to think about when we think about what features are missing 23:03:16 q+ 23:03:16 hober: but since removing a feature is impossible, but maybe we should not add this feature now because we may regret later 23:03:21 q+ 23:03:27 ack ju 23:03:49 justin: from API consumer point of view, we used link element (subclassed) and it's a real shame to lose that functionality 23:04:00 justin: what's the objection from implementor's side? 23:04:16 Travis: it's that it's a bad declarative syntax 23:04:30 chaals: it's ugly; this is what I hear. 23:05:00 q+ to ask whether role= could be used/extended to trigger native behaviour? 23:05:26 chaals: a question I pose counter to hober's point is that perhaps is= will solve many problems for once instead of having to go figure out three different problems separately and come up with a separate solution 23:05:53 chaals: like some things in HTML, we may regret about this feature but it might be cheaper to be sorry later than not having anything that works for years 23:06:16 esprehn: we also find that this is useful for polyfilling 23:06:58 esprehn: e.g. dialog element can be polyfilled using lifecycle callbacks to get the timing right which is hard to do today 23:07:16 Domenic_: here's a lot of things you can do with is= 23:07:22 parsing hooks for