-
-
Notifications
You must be signed in to change notification settings - Fork 942
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
Fixed: value-keyword-case
is now ignore counter-reset property and counter, counters and attr functions.
#2407
Conversation
e296440
to
a92264a
Compare
Looks good. You should add duplicate tests to the "upper" blocks (i.e. wherever we currently have counter-increment tests) |
a92264a
to
21f2976
Compare
@edg2s thanks, fixed |
#2408 fixes the other part of this bug (counter functions) |
@@ -4,6 +4,7 @@ const keywordSets = require("../../reference/keywordSets") | |||
const declarationValueIndex = require("../../utils/declarationValueIndex") | |||
const getUnitFromValueNode = require("../../utils/getUnitFromValueNode") | |||
const isCounterIncrementCustomIdentValue = require("../../utils/isCounterIncrementCustomIdentValue") | |||
const isCounterResetCustomIdentValue = require("../../utils/isCounterIncrementCustomIdentValue") |
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 be isCounterResetCustomIdentValue
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.
Typo in new "require".
One could merge counterIncrementKeywords/counterResteKeywords as they are identical in the spec. Also in CSS3 where counter-set is introduced. Or we could keep them separate.
@edg2s best could keep them separate. They can change late, imho. |
Ok - you still have a typo in the 'require' statement. |
21f2976
to
b26cff7
Compare
value-keyword-case
is now ignore counter-reset property.value-keyword-case
is now ignore counter-reset property and counter, counters and attr functions.
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.
Looks good.
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.
Great work! Thank you!
}, { | ||
code: "a { content: counter(cOuNtEr-NaMe); }", | ||
}, { | ||
code: "a { content: counter(COUNTER-NAME); }", |
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.
The same 3 tests are repeated, right?
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.
@davidtheclark typo, it should be counters
(ending on s
)
}, { | ||
code: "a { content: counter(counter-name); }", | ||
}, { | ||
code: "a { content: counter(cOuNtEr-NaMe); }", |
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.
If you've already tested the line about toLowerCase
(with the value-string
tests above), I don't think we need to multiply every test with alternate cases.
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.
@davidtheclark difference functions to ignore attr
and counter
code: "a { content: oPeN-qUoTe; }", | ||
message: messages.expected("oPeN-qUoTe", "OPEN-QUOTE"), | ||
line: 1, | ||
column: 14, |
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.
How do these tests relate to the issue?
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.
@davidtheclark yep extra tests
@@ -64,7 +65,7 @@ const rule = function (expectation, options) { | |||
} | |||
|
|||
// Ignore keywords within `url` and `var` function | |||
if (node.type === "function" && (valueLowerCase === "url" || valueLowerCase === "var")) { | |||
if (node.type === "function" && (valueLowerCase === "url" || valueLowerCase === "var" || valueLowerCase === "counter" || valueLowerCase === "counters" || valueLowerCase === "attr")) { |
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.
How does attr
relate to the issue?
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.
@davidtheclark I thought that I would correct this behavior in one commit
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.
That's fine. In the future please make sure to point this out in the comment about your PR, so we remember to place it in the Changelog. Is it tested?
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.
@davidtheclark yep
code: "a { content: attr(value-string); }", |
@evilebottnawi Great! After you make those couple of changes, want to merge and add a changelog entry? |
@davidtheclark A couple of minutes and send a commit 😄 |
a726845
to
c2080f5
Compare
/cc @davidtheclark |
@evilebottnawi Go ahead and merge! |
@davidtheclark merge? 😄 |
Yes, merge! |
To merge or not to merge... |
Added to Changelog:
|
#2406
e.g. "No, it's self explanatory."