Re: [w3c/webcomponents] Need a callback for when children changed or parser finished parsing children (#809)

@dogoku well, yes, if there was at least a `contentChangedCallback` that would automatically enable access to the Custom Element content (i.e. `this.innerHTML` or `this.textContent`, or `this.querySelector(...)`) we'll have an easier life, as that can help with unexpected flushes of the page and it will expose a precise point in time where you can at least start setting up your content.

After all, even `<select>` shows their content before their end tag is encountered:

```php
<?php
header('Content-type: text/html; charset=utf-8');
echo '<select>';
for ($i = 0; $i < 10; $i++) {
  echo '<option>'.$i.'</option>';
  if ($i === 5) {
    flush();
    ob_flush();
    sleep(5);
    // explore the select up to 5 options
  }
}
echo '</select>';
?>
```

So while I personally dream about a `contentParsedCallback` that would happen independently of the content, as long as the closing tag is either explicitly encountered or automatically closed, anything help that could help setting up reliably a Custom Element would be better than current state.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/809#issuecomment-534135299

Received on Monday, 23 September 2019 14:54:13 UTC