Re: [Custom Elements] attributeChanged not sufficient?

I certainly support some kind of per-element media query, or resize event,
if the well-known performance issues around these ideas can be resolved,
but otherwise Custom Elements don't have a lot to say about this problem.

>> Typically, when using a plain JS API (and not a custom declarative
markup), users are used to call a size synchronization routine, shall the
map viewport change.

This notion hasn't changed. In the absence of native resize signals,
applications or frameworks will need to manage this information themselves,
and broadcast custom signals (e.g. 'call a size synchronization routine').

Fwiw, I believe this question is orthogonal to `attributeChanged` (or
attributes in general).

Scott


On Mon, Mar 31, 2014 at 4:20 AM, Ondřej Žára <ondrej.zara@firma.seznam.cz>wrote:

> Hi,
>
> let me introduce my Custom Element scenario: an interactive map element,
> powered by one of the well-known JS APIs (such as Google Maps API or so).
>
> Typically, the markup will be like
>
> <my-map lat="..." lon="..." zoom="..." controls>
>
> However, the underlying JS needs to know when this element's rendered size
> changes; the viewport needs to be filled with new map tiles and other geo
> data.
>
> Typically, when using a plain JS API (and not a custom declarative
> markup), users are used to call a size synchronization routine, shall the
> map viewport change. This is no longer the case when a Custom Element is
> introduced (and scripting is replaced by declarative HTML).
>
> A user may insert a map element anywhere in the page (see
> http://api4.mapy.cz/ for reference), including a variable-width box in a
> sidebar or so. This means that the <my-map> element itself cannot determine
> when its own (rendered) size changes, as the attributeChanged callback only
> applies to own attributes.
>
> Is there some recommended way of dealing with this?
>
>
> Sincerely,
> Ondrej Zara
>
>
>
> --
> *RNDr. Ondřej Žára*
> Programátor UI senior
>
> https://twitter.com/0ndras
> ondrej.zara@firma.seznam.cz <mailto:ondrej.zara@firma.seznam.cz>
> http://www.seznam.cz/
>
> Seznam.cz, a.s., Radlická 3294/10, 150 00 Praha 5 <http://mapy.cz/s/6rw4>
>
>
>
>

Received on Monday, 31 March 2014 17:07:40 UTC