Make CSS spy selector handling API-version agnostic#2352
Open
vogella wants to merge 2 commits into
Open
Conversation
eclipse.platform.ui PR #4051 changes CSSEngine.parseSelectors() and matches() to use an internal Selectors AST instead of the org.w3c.css.sac types. Use var and a Predicate instead of naming the selector list type so the spy compiles against both the old and new CSSEngine API.
Contributor
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
Contributor
|
I'm not sure this really works. This might make it compile time agnostic but I doubt it works in runtime the way indicated here.. |
This file contains hidden or 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
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.
The CSS spy referenced
org.w3c.css.sac.SelectorListandSelectordirectly, which breaks once eclipse.platform.ui #4051 switchesCSSEngine.parseSelectors()andmatches()to an internalSelectorsAST.Since both the old and new selector list types expose the same
getLength()/item(int)and round-trip cleanly throughengine.matches(...), the spy no longer needs to name the type at all. The parsed selectors are now held invarlocals and the recursive search takes aPredicate<CSSStylableElement>instead of a typed selector-list parameter (which also drops the always-nullpseudoargument). The result compiles against both the current and the post-#4051 target platform, so it can merge independently of the platform change.