-
Notifications
You must be signed in to change notification settings - Fork 465
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
Fix is_superselector_of
function
#1033
Conversation
@xzyfer should we include this in next 3.2.0-beta.5 release? |
Maybe this is best left for when selector functions lands.
|
I actually thought it would make sense to have it merged before selector functions, since it could possibly have an impact there (they may suffer from the same bug). So I thought it would be good to already have it merged. Otherwise chances are that this bug will be fixed twice !? |
Cool, go for it. I just thought it might be a risky change but it seems fine
|
Pinged @onedayitwillmake so he maybe can verify this changes to be sane. I guess he should have a few additional spec tests by now, so maybe he can test if this brakes any existing behavior. |
625a2a0
to
ce01b5e
Compare
OK, just made some tests with the WIP branch and it seems to alter results for the new selector function tests. So I will leave this PR open for now for further feedback and references! |
OK, lets wait for selector-functions and the new spec tests which should cover this topic better. |
@mgreter I agree, i can merge that in. The selector function, is essentially parsing the selectors, returning the result of calling that method |
There is a very strange and IMO wrong logic at work with ruby sass and test-a {
// false
$a: "a + c + d";
$b: "a + b + c + d";
a: is_superselector($a, $b);
}
test-b {
// true
$a: "a + c + d + e";
$b: "a + b + c + d + e";
a: is_superselector($a, $b);
} IMO I found the code part in ruby sass that is mainly responsible for this behavior: # .foo > .baz is not a superselector of .foo > .bar > .baz or .foo >
# .bar .baz, despite the fact that .baz is a superselector of .bar >
# .baz and .bar .baz. Same goes for + and ~.
return if seq1.length == 3 && seq2.length > 3 With this info I might be able to re-produce the IMO "strange" behavior ... |
This is included in my WIP branch for 3.3! |
Fixes #823