Re: Proposal: @parsing="loose | strict"

Boris Zbarsky On 09-07-15 00.53:

> Leif Halvard Silli wrote:
>> This is in fact what I am proposing. Let Web browser have the option 
>> of switching to "authoring device" mode.
> 
> In that case, why does the web page need anything in it at all?  If web 
>  browsers want to ship a strict non-default parser mode, that's fine. 
> They can just do that.  No need to annotate pages to use it.


If we say that an "authoring device" is a device of its own, then 
you can do

 <link rel="stylesheet" media="authoring" .... >

in order to send special style properties to the authoring device. 
  When editing a page, one often need a more "semantic" and simple 
stylesheet than when browsing it with a reading device.

As for strict parsing, even if strict parsing should be reserved 
for authoring devices, authoring devices should still not be 
forbidden from also supporting normal parsing as well. Then, if 
there is some pages that you want to edit with the non-default 
parsing mode, then one would be able to get the right mode 
automatically, without adjusting the preferences.

 
>> I suppose you meant that a "CSS property alone wouldn't work". 
>> However, by CSS, I did not mean only a CSS property, but also a new 
>> CSS/HTML media device type (I did not mean a "MIME type"). The media 
>> type that we target via the CSS selector '@media' or the HTML media 
>> attribute.
> 
> What's the point of the media type here?

The point is that one can specify special CSS for the "authoring 
device mode" - not only parsing mode, but other things as well.

>> The thing is that a media device of course treats the whole page in a 
>> certain way. This is programmed into the device before it starts 
>> reading the page. Thus, the device also has some predefined CSS 
>> properties.
> 
> Not sure what you mean by that, exactly...

If your web browser accepts User CSS sheets, and if you tell it to 
  render <h1> elements in read, then this stylesheet will be part 
of the "armor" with which your browser meets the World Wide Web. 
No reparsing needs to be done - the UA knows before it starts to 
read a page that eventual <h1>-s are to be colored red.

>> If we had a "authoring device" media type (or a "authoring mode" sub 
>> media type), then we could have a default
>>
>>     @media authoring{parsing:strict}
>>
>> for those devices/modes. If UAs could /switch/ their media mode, then 
>> authors could also, with the touch of a button (which I think you 
>> proposed, anyway), see the page in "authoring mode".
> 
> This has nothing to do with CSS or media, though.


Why not? This is how Amaya works - it lets you identify it as any 
of the CSS media device types that it is aware of. This way an 
author can test/see which styles that applies to the media type 
that he/she selects.

 
>> As a CSS property it would of course also be possible (for security or 
>> other reason) to use
>>
>>  @media all {parsing:strict}
> 
> I'm not clear on how you think this would work.  Care to explain?

For this to work, the UA would need to be informed that it should 
switch to strict parsing (if possible). A HTTP header. E.g. may be 
it could be triggered when one logs into internet banking sites. 
(Please note that I don't know how useful this would be - I just 
heard that Doug say that it also was related to security.)
-- 
leif halvard silli

Received on Wednesday, 15 July 2009 23:34:57 UTC