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

Refactoring: start using rules converter for :style rules #1380

Closed
ameshkov opened this issue Apr 23, 2019 · 0 comments
Closed

Refactoring: start using rules converter for :style rules #1380

ameshkov opened this issue Apr 23, 2019 · 0 comments
Assignees
Milestone

Comments

@ameshkov
Copy link
Member

ameshkov commented Apr 23, 2019

Instead of doing it in the css-filter-rule:

            ```
            // We need this for two things:
            // 1. Convert uBlock-style CSS injection rules
            // 2. Validate pseudo-classes
            // https://github.com/AdguardTeam/AdguardForAndroid/issues/701
            var pseudoClass = parsePseudoClass(cssContent);
            if (pseudoClass !== null && ":style" === pseudoClass.name) {
                isInjectRule = true;
                cssContent = convertCssInjectionRule(pseudoClass, cssContent);
            } else if (pseudoClass !== null) {
                if (CssFilterRule.SUPPORTED_PSEUDO_CLASSES.indexOf(pseudoClass.name) < 0) {
                    throw new Error("Unknown pseudo class: " + cssContent);
                }
            }
            ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants