Re: [cssom][css-page] Fixes for properly exposing @page in CSSOM

On Wed, 21 Aug 2013 12:55:13 +0200, Simon Sapin <simon.sapin@exyr.org>  
wrote:

> Le 21/08/2013 09:40, Simon Pieters a écrit :
>> Hi,
>>
>> I have fixed bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=22500  
>> and
>> would like review of my proposed changes:
>>
>> https://dvcs.w3.org/hg/csswg/rev/048b4760e33e
>>
>> commit message:
>>
>> Expose the margin at-rules in @page as CSSMarginRule, uses type constant
>> 9. Use a new interface for the declarations in @page and @top-left. Move
>> the bulk of CSSStyleDeclaration to a new interface CSSDeclaration, and  
>> let
>> CSSStyleDeclaration, CSSPageDeclaration and CSSMarginDeclaration inherit
>>   from it.
>>
>> Constant 9 was unused according to wiki.csswg.org/spec/cssom-constants
>>
>> See http://dev.w3.org/csswg/css-page/ for more context and examples.
>
> I disagree with CSSPageRule.style and CSSMarginRule.style having a  
> different type from CSSStyleRule.style. Some properties "do not apply"  
> to the page context or margin context just like the 'text-align'  
> property does not apply to inline elements, that does not affect the OM.
>
> @page and margin rules, like keyframe rules, contains "real" CSS  
> properties and are much closer to style rules than eg. @font-face which  
> contains descriptors that sometimes happen to have the same name as a  
> property.
>
> The 'size' property is a bit odd in that it never applies to elements,  
> but as currently defined it is a property and thus should appear in  
> CSSStyleDeclaration.

OK. Yeah I guess you're right.

My idea with this split was that we could reuse the machinery from  
CSSStyleDeclaration for descriptors in e.g. @font-face. I still think this  
can make sense for @font-face since descriptors and properties are similar  
enough that they could be represented with the same interface in CSSOM.

For now I've reverted the changes for CSSStyleDeclaration and let  
CSSPageRule.style and CSSMarginRule.style return it.

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

-- 
Simon Pieters
Opera Software

Received on Wednesday, 21 August 2013 11:26:14 UTC