Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

mgreter
Copy link
Contributor

@mgreter mgreter commented Apr 2, 2015

Fixes #823

@mgreter mgreter added this to the 3.2.1 milestone Apr 2, 2015
@mgreter mgreter self-assigned this Apr 2, 2015
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 80.28% when pulling 625a2a0 on mgreter:bugfix/issue_823 into fd7f20f on sass:master.

@mgreter
Copy link
Contributor Author

mgreter commented Apr 2, 2015

@xzyfer should we include this in next 3.2.0-beta.5 release?

@xzyfer
Copy link
Contributor

xzyfer commented Apr 3, 2015

Maybe this is best left for when selector functions lands.
On 3 Apr 2015 09:25, "Marcel Greter" [email protected] wrote:

@xzyfer https://github.com/xzyfer should we include this in next
3.2.0-beta.5 release?


Reply to this email directly or view it on GitHub
#1033 (comment).

@mgreter
Copy link
Contributor Author

mgreter commented Apr 3, 2015

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 !?

@xzyfer
Copy link
Contributor

xzyfer commented Apr 3, 2015

Cool, go for it. I just thought it might be a risky change but it seems fine
On 3 Apr 2015 21:03, "Marcel Greter" [email protected] wrote:

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 !?


Reply to this email directly or view it on GitHub
#1033 (comment).

@mgreter mgreter mentioned this pull request Apr 3, 2015
@mgreter
Copy link
Contributor Author

mgreter commented Apr 3, 2015

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.

@mgreter mgreter modified the milestones: 3.2, 3.2.1 Apr 3, 2015
@mgreter mgreter force-pushed the bugfix/issue_823 branch from 625a2a0 to ce01b5e Compare April 3, 2015 10:27
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 80.7% when pulling ce01b5e on mgreter:bugfix/issue_823 into 70992f4 on sass:master.

@mgreter mgreter modified the milestones: 3.2.1, 3.2 Apr 3, 2015
@mgreter
Copy link
Contributor Author

mgreter commented Apr 3, 2015

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!

@mgreter
Copy link
Contributor Author

mgreter commented Apr 3, 2015

OK, lets wait for selector-functions and the new spec tests which should cover this topic better.
IMO the selector functions cannot be merged without a proper superselector handling anyway!

@onedayitwillmake
Copy link

@mgreter I agree, i can merge that in. The selector function, is essentially parsing the selectors, returning the result of calling that method

@mgreter
Copy link
Contributor Author

mgreter commented Apr 12, 2015

There is a very strange and IMO wrong logic at work with ruby sass and is_superselector. I fail too see why ruby sass produces different results for these two tests:

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 ...

@xzyfer xzyfer modified the milestones: 3.2.2, 3.3 May 1, 2015
@mgreter
Copy link
Contributor Author

mgreter commented Jun 15, 2015

This is included in my WIP branch for 3.3!

@mgreter mgreter closed this Jun 15, 2015
@mgreter mgreter deleted the bugfix/issue_823 branch July 28, 2015 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested @extends possible regression
4 participants