CSS.supports broken! Topic is solved
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.
This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.
Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.
This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.
Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
- JAB Creations
- Hobby Astronomer
- Posts: 16
- Joined: 2021-03-08, 10:52
CSS.supports broken!
I came to test to see if a CSS animation would work in Pale Moon (it does) and the browser prompted an update.
Because the release notes include new implementations and in a way that are easy to implement I decided to add browser detection for Pale Moon releases.
Unfortunately CSS.supports('white-space:break-spaces') failed...and so did CSS.supports('white-space:normal')!
This was supposed to be quick and easy so, I'm not sure about adding version detection just yet...
Because the release notes include new implementations and in a way that are easy to implement I decided to add browser detection for Pale Moon releases.
Unfortunately CSS.supports('white-space:break-spaces') failed...and so did CSS.supports('white-space:normal')!
This was supposed to be quick and easy so, I'm not sure about adding version detection just yet...
Re: CSS.supports broken!
Try using CSS.supports('property', 'value'); instead.
Seems our support for feeding a CSSOMString expression isn't currently working (we may need some extra code; Firefox officially supported this in v55, after our fork point)
Code: Select all
CSS.supports('white-space','break-spaces');
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
- JAB Creations
- Hobby Astronomer
- Posts: 16
- Joined: 2021-03-08, 10:52
Re: CSS.supports broken!
Ouch! Yeah, that works fine. Again, I get it as a developer that there is always one more thing that has to be done. However in this general case I only use CSS.supports for the browser detection. However in the future I may not remember this issue and I'm not sure who/where else this may be an existing issue. Hopefully when you folks have time to get around to that (time? what is that?) it'll be easy to implement. Thanks for the help.
Re: CSS.supports broken!
Well I poked at it and we do seem to have it as it was added with the initial implementation, but it does seem to be broken in some fashion.
More info/research needed. it's possible the spec changed.
More info/research needed. it's possible the spec changed.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: CSS.supports broken!
Aha! The issue is that we're expecting parenthesized expressions for the conditionText.
The following returns true as-expected.
Please note that this follows the CSS spec! See emphasised quote from the CSS Conditional Rules Module Level 3
The following returns true as-expected.
Code: Select all
CSS.supports('(white-space:break-spaces)');
So we're actually following the spec here; the parentheses are required. If browsers are allowing it without parentheses then they are not following the spec. It seems at least Firefox has started accepting it without, but that was based on a draft spec text that does not match what there is now (either in draft or TR) and should be considered a bug. Filed bug #1786616 to ping Mozilla about it.supports(CSSOMString conditionText), returns boolean
When the supports(conditionText) method is invoked with a single conditionText argument:
1. If conditionText, parsed and evaluated as a <supports-condition>, would return true, return true.
2. Otherwise, If conditionText, wrapped in parentheses and then parsed and evaluated as a <supports-condition>, would return true, return true.
3. Otherwise, return false.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
- JAB Creations
- Hobby Astronomer
- Posts: 16
- Joined: 2021-03-08, 10:52
Re: CSS.supports broken!
I don't see the point of the redundant parenthesis, how are they in any way helpful? Seems like more idiocy in the standards community like CSS scrollbar-width: thin; because it's not like we want to get RID of ambiguity across browsers and platforms. 🙄︀ I'm sure you have much more insight on this topic than I do though.
Mozilla banned me from Bugzilla like two years ago. They're extremely anti-fixing-bugs, extremely anti-common-sense, extremely anti-listening-to-users, etc. They must know what they're doing though, the Firefox market share has just been exploding the past few years. 🙄︀
Mozilla banned me from Bugzilla like two years ago. They're extremely anti-fixing-bugs, extremely anti-common-sense, extremely anti-listening-to-users, etc. They must know what they're doing though, the Firefox market share has just been exploding the past few years. 🙄︀
Re: CSS.supports broken!
They aren't redundant. It's exactly the form @supports takes.JAB Creations wrote: ↑2022-08-23, 19:46I don't see the point of the redundant parenthesis, how are they in any way helpful?
I do find it a little odd that they went from "implied parentheses" to just stating "parentheses" though as it's actually more readable without the parentheses.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: CSS.supports broken!
Oh, i'm a dunce misreading the spec.
They actually state that both conditions should be accepted, just the wording is not very clear!
Point 1 should pass with the parens given.
Point 2 means to say "take the string, then wrap it in parentheses, then evaluate it" so basically the spec has changed to state the inverse of the problem.
So in that case I should just add what Mozilla did for it which is a trivial addition of a parameter.
They actually state that both conditions should be accepted, just the wording is not very clear!
Point 1 should pass with the parens given.
Point 2 means to say "take the string, then wrap it in parentheses, then evaluate it" so basically the spec has changed to state the inverse of the problem.
So in that case I should just add what Mozilla did for it which is a trivial addition of a parameter.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
- JAB Creations
- Hobby Astronomer
- Posts: 16
- Joined: 2021-03-08, 10:52
Re: CSS.supports broken!
Looks like that portion of the standard was poorly written because I simply don't see anything about parenthesis there. Specifications should always be updated to address ambiguity, that is one of the fundamental reasons standards exist to begin with!
Re: CSS.supports broken!
It's certainly lacking in clarity if I so easily misread it!
But it is there, for sure. See attach
But it is there, for sure. See attach
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
- JAB Creations
- Hobby Astronomer
- Posts: 16
- Joined: 2021-03-08, 10:52
Re: CSS.supports broken!
I searched for paren...whatever, browser probably lost focus. The parenthesis are listed as the second option...with no reason to justify adding the parenthesis. Do these things get proof-read? Whatever, thanks for the clarification.