-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cssom] [css-fonts] [css-page] Sort out properties and descriptors. #9686
Conversation
@tabatkins: Bikeshed doesn't seem to be liking the dashed attribute syntax, even though I think per the WebIDL grammar is correct. E.g., this diff on top of this PR: diff --git a/cssom-1/Overview.bs b/cssom-1/Overview.bs
index a2ac5e91e..fdefb5521 100644
--- a/cssom-1/Overview.bs
+++ b/cssom-1/Overview.bs
@@ -2120,7 +2120,7 @@ Issue: Need to define the rules for
[Exposed=Window]
interface CSSPageDescriptors : CSSStyleDeclaration {
attribute [LegacyNullToEmptyString] CSSOMString margin;
attribute [LegacyNullToEmptyString] CSSOMString marginTop;
+ attribute [LegacyNullToEmptyString] CSSOMString margin-top;
attribute [LegacyNullToEmptyString] CSSOMString marginRight;
attribute [LegacyNullToEmptyString] CSSOMString marginBottom;
attribute [LegacyNullToEmptyString] CSSOMString marginLeft; Causes:
Am I missing something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall much cleaner than the current mess.
See comment about the new descriptors in CSS Fonts 5.
attribute [LegacyNullToEmptyString] CSSOMString ascentOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString descentOverride; | ||
attribute [LegacyNullToEmptyString] CSSOMString lineGapOverride; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should fonts 5 have the same interface too except adding the size-adjust descriptor and the subscript-*
descriptors as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@@ -1052,7 +1052,7 @@ IDL Definition</h4> | |||
[Exposed=Window] | |||
interface CSSKeyframeRule : CSSRule { | |||
attribute CSSOMString keyText; | |||
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style; | |||
[SameObject, PutForwards=cssText] readonly attribute CSSStyleProperties style; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the style
of keyframe rules should have its own interface to prevent declaring a property defined in CSS Animations?
The
<declaration-list>
inside of<keyframe-block>
accepts any CSS property except those defined in this specification
https://drafts.csswg.org/css-animations-1/#at-ruledef-keyframes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly...
Huh, weird that it's valid IDL, but you're right, technically it is, per https://webidl.spec.whatwg.org/#prod-identifier This would be a bug on plinss/widlparser, then. |
Thanks, sent plinss/widlparser#83 for that. |
* Ignore virtualenv directory. * tokenizer: Fix identifier regular expression. This blocks w3c/csswg-drafts#9686 * test: Add tests for dashed identifiers.
attribute [LegacyNullToEmptyString] CSSOMString fontFamily; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontStyle; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontWeight; | ||
attribute [LegacyNullToEmptyString] CSSOMString fontStretch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
font-stretch
(descriptor) is now a legacy alias of font-width
(b0660ee). I guess fontWidth
should also be defined.
@emilio @tabatkins Now that plinss/widlparser#83 has been merged is this ready to go, or does it still need changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be easier to merge this and then iterate on any refinements
cssom-1/Overview.bs
Outdated
[Exposed=Window] | ||
interface CSSPageDescriptors : CSSStyleDeclaration { | ||
attribute [LegacyNullToEmptyString] CSSOMString margin; | ||
attribute [LegacyNullToEmptyString] CSSOMString marginTop; | ||
attribute [LegacyNullToEmptyString] CSSOMString marginRight; | ||
attribute [LegacyNullToEmptyString] CSSOMString marginBottom; | ||
attribute [LegacyNullToEmptyString] CSSOMString marginLeft; | ||
attribute [LegacyNullToEmptyString] CSSOMString size; | ||
attribute [LegacyNullToEmptyString] CSSOMString marks; | ||
attribute [LegacyNullToEmptyString] CSSOMString bleed; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a part of me that wonders if we actually what to define this, rather than "all descriptors supported for the @page
at-rule", similar to what we do with properties? (Also CSSFontFaceDescriptors
above.)
Like, if an implementation supported legacyDescriptor
, do we not want it exposed on the interface? Or even a -webkit-legacy-descriptor
, do we not want that exposed similarly?
This is intended to address #5649.
035cd61
to
581417f
Compare
@tabatkins @svgeesus I updated now that the webidl parser is fixed, and it looks good from here. I should look into @gsnedders' suggestion about making descriptors more generically exposed in page and font-face descriptors, but I agree we can probably merge this and iterate on the specific text, because I don't know if legacy descriptors like |
This is intended to address #5649.