This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25304 - "addListener" use an event instead
Summary: "addListener" use an event instead
Status: RESOLVED FIXED
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM View (show other bugs)
Version: unspecified
Hardware: PC All
: P1 normal
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-10 08:24 UTC by Simon Pieters
Modified: 2014-06-09 10:01 UTC (History)
1 user (show)

See Also:


Attachments

Comment 1 Simon Pieters 2014-05-19 08:25:53 UTC
RESOLVED:Make MQ lists and event target for the change event and alias the existing listener to addeventlistener and removeeventlistener

http://krijnhoetmer.nl/irc-logs/css/20140519#l-2053
Comment 2 Simon Pieters 2014-06-06 10:36:40 UTC
https://dvcs.w3.org/hg/csswg/rev/ce11bd9d0293
Comment 3 Anne 2014-06-06 11:25:39 UTC
Can you please not rely on "When a method or an attribute is said to call another method or attribute, the user agent must invoke its internal API for that attribute or method so that e.g. the author can't change the behavior by overriding attributes or methods with custom properties or functions in ECMAScript."

Or at least inline by saying that the UA should use the initial value of those properties.

This is a really icky way of writing requirements.
Comment 4 Anne 2014-06-06 11:27:04 UTC
Also, the event is exposed on workers, but is the API itself?
Comment 5 Simon Pieters 2014-06-09 08:07:53 UTC
Which properties do you mean? .media and .matched are set to concept-MediaQueryList-media and concept-MediaQueryList-matched.

The API isn't exposed to workers currently, but there's a bug asking for that. I guess I can hide the event from workers until then to not confuse feature detection.
Comment 6 Anne 2014-06-09 08:16:32 UTC
The methods are defined as directly invoking addEventListener().

(Also, the rationale for changing this API seems rather sketchy. Making the semantics equivalent to events seems reasonable, but exposing this as events, not so much.)
Comment 7 Simon Pieters 2014-06-09 10:01:24 UTC
Thanks

https://dvcs.w3.org/hg/csswg/rev/d9c86e52f02a

Please reopen or send email to www-style if you care about not exposing the event.