-
Notifications
You must be signed in to change notification settings - Fork 757
[mediaqueries-4] Can't have 'not', 'and' and 'or' at the same level #185
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
Conversation
|
Making this into a pull request rather than fixing it directly on the chance that I'm wrong. I'm pretty sure of this, but then again you should know it pretty well as well, so maybe I missed something somewhere. |
|
Hmmmm. I'd prefer if we could do "not" at the same level as the others, but I suppose I'd need to see what browsers actually do with and/not today. Your change is indeed correct for what @dbaron wrote in Conditional, tho. |
|
And for the grammar that you have in the MQ spec as well. I think the decision was not to have any implied operator priority, and keep it fully explicit always, to make sure there's not apparent ambiguity. Not sure why you think it is less important for |
|
Because "not" is unary, and "and" and "or" are binary; it's very standard for unary operators to either have very high or very low binding strength, whichever is most useful in context (and in this case I think it's obvious it would have high binding, like it does in other programming languages), but it's usually difficult to predict which of two binary operators have higher precedence. |
|
I think it is pretty confusing with Morality: don't guess, and stick parentheses in there, which is why we resolved to require them. (Can't find the link right now, but I am pretty sure we have a resolution a few years back). |
|
Yeah, that's reasonable. |
|
@frivoal |
|
@simevidas By legacy, I did not mean something to be phased out. I meant what we've had so far, as opposed to this new boolean logic that is (relatively) newly being introduced. |
|
On 06/14/2016 10:55 PM, Florian Rivoal wrote:
Given we've had media queries for awhile now, the correct thing ~fantasai |
This fixes a mistake introduced in 2f37630
Not only can you not have
orandandat the same level, butnotis handled the same as well, and also needs extra parentheses.