W3C home > Mailing lists > Public > www-style@w3.org > April 2014

Re: why not MediaQueryList.onchange

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 16 Apr 2014 12:34:26 -0700
To: Elliott Sprehn <esprehn@gmail.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Message-ID: <20140416193426.GA2413@crum.dbaron.org>
On Wednesday 2014-04-16 15:21 -0400, Elliott Sprehn wrote:
> lists = copy of mediaLists.
> for each list in lists:
>   eval media query of list.
> for each list in lists:
>   if list is dirty:
>     dispatch change event on list.

I don't think there's any substantive difference in complexity
there; whether the copying is done at the start or inside the first
for loop doesn't really make much difference.

(On the other hand, I don't recall how much complexity it adds to
make something be an EventTarget.  That said, I'm fine with using
events because they fit with the platform [1]; I just think the
complexity argument is not relevant.)

-David

[1] Although I'm not sure to what extent events work well as a
    mechanism for notifications about events internal to the
    platform rather than notifications of changes external to the
    platform.  For example, mutation events didn't work out all that
    well.

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Received on Wednesday, 16 April 2014 19:34:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:21 UTC