-
Notifications
You must be signed in to change notification settings - Fork 52
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
Refactor for performance and features #32
Open
MaxLap
wants to merge
13
commits into
aanand:master
Choose a base branch
from
MaxLap:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This can improve performance for large stylesheets. May allow for shorter outputs by displaying only the normalized ones.
By making a tree with selectors that imply each other, we can only search a subset of the selectors at a time. Ex: if you have the two selectors: ".hello" and ".hello.world", then ".hello.world" implies that ".hello" would match. So until you find a ".hello", there is no reason to look for a ".hello.world"
Some of the changes fix things needed by deadweight.
Support for pseudo-classes Unsupported rules are now handled without errors Now even generates implied rules to have less rules to search for at a time.
Just wanted to say that the reason the build fails is because Nokogiri 1.6.6.2 isn't supported for 1.8.7 it seems. |
Thanks! I have very little time to look after deadweight these days, but I'll take a look as soon as I can. |
Pseudo-elements using single-colon syntax are now also stripped. Pseudo-classes not supported by nokogiri are stripped.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a set of changes that improve deadweight's performance and adds support for more css.
Normalizing the selectors to minimize the number that needs to be checked.
By making a tree with selectors that imply each other, we can only search a subset of the selectors at a time.
Ex: if you have the two selectors: ".hello" and ".hello.world", then ".hello.world" implies that ".hello" would match. So until you find a ".hello", there is no reason to look for a ".hello.world". This can greatly improve the speed nested styles.
Now supporting many pseudo-classes (Based on nokogiri's supported pseudoclasses, needed to update the Gemfile.lock for nokogiri to handle some of them correctly). Additionnally, we strip the :hover and :valid since logically, if you find the element, that the :hover is also found...
When a rule is not supported, it is now handled correctly. Output wise, it remains a simple "unused" rule. That could be improved in the future to distinguish them.