[webkit-reviews] review requested: [Bug 37205] matchMedium callbacks : [Attachment 55394] patch 3

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 7 10:36:36 PDT 2010


Luiz Agostini <luiz.agostini at openbossa.org> has asked  for review:
Bug 37205: matchMedium callbacks
https://bugs.webkit.org/show_bug.cgi?id=37205

Attachment 55394: patch 3
https://bugs.webkit.org/attachment.cgi?id=55394&action=review

------- Additional Comments from Luiz Agostini <luiz.agostini at openbossa.org>
First draft. Main objective is to receive some feedback and to use this patch
as a reference for discussion.

Setting r? to get some feedback on the idea and the implementation.

The consensus on the W3C blah-blah [1] mailing list was that instead of adding
individual DOM events for changes to media features, we should instead make it
possible to get notified when a user defined media query has changed.

The idea was making it possible to supply a JavaScript function to the
styleMedia.matchMedium(...) function.

As no exact IDL was proposed, I came up with one myself which I think fits the
use-case, and implemented the feature for WebKit.

The result of my work became the following IDL, for which I would like
comments/feedback:

    interface MediaChangeListener {
	void mediaChanged(in boolean queryResult);
    };

    interface StyleMedia {
	readonly attribute DOMString type;
	boolean matchMedium(in DOMString mediaquery, in MediaChangeListener
listener);
    };

If listener is supplied to the	matchMedium call then its mediaChanged method
will be called every time when then result of the expression given in
'mediaquery' changes.
mediaChanged parameter queryResult receives the current value (true/false) of
the corresponding mediaquery.

The idea and actual implementation has already gone through some initial
feedback rounds with Kenneth Rohde Christiansen


More information about the webkit-reviews mailing list