Extending CSSOM Views matchMedium with callback Re: CSS WG comments on View Modes Media Feature spec

On Fri, Mar 26, 2010 at 2:25 PM, Marcos Caceres <marcosc@opera.com> wrote:
> On Thu, Mar 18, 2010 at 4:02 PM, Simon Fraser <smfr@me.com> wrote:
>> On Mar 18, 2010, at 6:44 AM, Marcos Caceres wrote:
>>
>>>> 4. all these queries could/should have an event-based counterpart so the
>>>>   changes are detectable by code. We understand this is outside of the
>>>>   scope of this spec but that's still an important comment.
>>>
>>> We have a proposal already for the CSS WG to review:
>>> http://dev.w3.org/2006/waf/widgets-vm/vm-interfaces.src.html
>>
>> It seems like this needs to align to the current CSS OM View spec:
>> <http://dev.w3.org/csswg/cssom-view/>
>>
>> which has a StyleMedia interface available on the window object as 'styleMedia', rather than 'media'.
>>
>> I would expect to see events related to media type changes in the CSS OM View spec too, rather than in a widgets-related spec.
>
> I totally agree, there is much overlap. We should start looking at how
> to merge the two specs (or our requirements) into the CSS OM View
> spec. I would be happy for the widgets one to vanish if the CSS OM
> View spec would handled our use cases.
>
> Perhaps we should have a joint teleconf or something to arrange how to
> proceed...  I'll leave that up to the chairs, however.

To make Widget View Modes Interfaces [1] redundant, we would like to
propose extending CSSOM Views' matchMedium method to have a callback
as a second argument.

This would address the following sections of [1] in the following ways:

# 3.2. Media Type Changed Event Types
styleMedia.matchMedium("screen", function() { alert("no
longer screen!") })

# 3.3. View Mode Changed Event Types
styleMedia.matchMedium("(viewmodesyntax)", ... )

# 3.4. Resolution Changed Event Types
styleMedia.matchMedium("(resolution:300dpi)", ... )

# 3.5. Orientation Changed Event Types
styleMedia.matchMedium("(orientation:landscape)", ... )

The proposal has it's origins on the Mozilla bug list (see comment
from David Baron):
https://bugzilla.mozilla.org/show_bug.cgi?id=542058#c3

Kind regards,
Marcos

[1] http://dev.w3.org/2006/waf/widgets-vm/vm-interfaces.src.html
-- 
Marcos Caceres
http://datadriven.com.au

Received on Monday, 12 April 2010 09:26:30 UTC