This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
From the viewpoint of WebKit implementation, HOST_RULE type number should be < 32. I mean, for example, "partial interface CSSRule { - const unsigned short HOST_RULE = 1001; + const unsigned short HOST_RULE = 31; };" Because we can use only 5 bits for type number. In WebKit's StyleRuleBase class: class StyleRuleBase : public WTF::RefCountedBase { ... unsigned m_type : 5; signed m_sourceLine : 27; } I think, it would be not acceptable to make StyleRuleBase larger. Probably we have to keep 32 bits (=5+27). If we change m_sourceLine from 27 bits to 22 bits (1001 < 1024=2^10), m_sourceLine's max is 4,194,303. I guess, 4,194,303 is a little small for real world web. Best regards, Takashi Sakamoto
The reasoning is very much implementation detail. We need something else for API changes. Also, it shouldn't be hard to convert the type internally, effectively if (m_type == 31) return 1001;
Olli is right and, at least for now, it can't be less than 31, because it's not been approved by CSS WG per http://wiki.csswg.org/spec/cssom-constants.
Thank you, Olli and Dimitri. Yeah, I was thinking of the following way: if (m_type == 31) return 1001; However I was advised to firstly confirm whether the "1001" was fixed or not. Now I knew "1001" is important and fixed. So I will try another way. Best regards, Takashi Sakamoto
No worries. It will likely be 17 once approved by CSS WG.
Tab, just wanted to remind you about this. Do I send an email to www-style about this? What's the best course of action here?
(In reply to comment #5) > Tab, just wanted to remind you about this. Do I send an email to www-style > about this? What's the best course of action here? I need to take the time out to write the scoped style spec properly, which will introduce @host.
Thank you. I updated WebKit bug about CSSHostRule, https://bugs.webkit.org/show_bug.cgi?id=102344 and added "class StyleRareRuleBlock", which can have 65535 types. If it is difficult to change CSSHostRule's type, I will try the StyleRareRuleBlock. Best regards, Takashi Sakamoto