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

Implement :properties pseudo-class #56

Closed
ameshkov opened this issue Dec 22, 2017 · 4 comments
Closed

Implement :properties pseudo-class #56

ameshkov opened this issue Dec 22, 2017 · 4 comments
Assignees
Milestone

Comments

@ameshkov
Copy link
Member

Synonym for :abp-properties.

Don't implement it right away, please take a look at their implementation first.

As I understand it works as matches-css + matches-css-before + matches-css-after

@ameshkov ameshkov added this to the 1.10 milestone Dec 22, 2017
@theseanl
Copy link
Contributor

theseanl commented Feb 1, 2018

Done in #59

@theseanl theseanl closed this as completed Feb 1, 2018
@theseanl theseanl reopened this Feb 7, 2018
@theseanl
Copy link
Contributor

theseanl commented Feb 7, 2018

It turned out that the overhead caused by processing the whole document at document start is quite substantial, e.g. on facebook.com. Since this is unavoidable, we should provide some mechanism for dividing styles processing into several chunks.

@theseanl theseanl removed this from the 1.10 milestone Feb 7, 2018
@ameshkov
Copy link
Member Author

ameshkov commented Feb 7, 2018

It appears that the performance problems are not due to the stylesheets scanning. Please investigate and fix it.

This data was recorded with https://gist.github.com/ameshkov/2d06530839ceefbe2027d95486ece1a3

ExtendedCss.query('div[id^="hyperfeed_story_id_"]:-abp-has(a[href="#"]:-abp-properties(content: "Sponsored"))')
VM10733:3243 StyleObserver initial processing: 1.155029296875ms
VM10733:4097 [ExtendedCss] Elapsed: 290830 μs.
4VM10733:99 {
    "AsyncWrapper.prototype.runImmediately": {
        "name": "AsyncWrapper.prototype.runImmediately",
        "count": 16190,
        "totalElapsed": 13.065000000011423,
        "averageElapsed": 0.0008069796170482658,
        "minElapsed": 0,
        "maxElapsed": 0.13999999999941792,
        "errors": 0
    },
    "AsyncWrapper.prototype.runAsap": {
        "name": "AsyncWrapper.prototype.runAsap",
        "count": 8095,
        "totalElapsed": 142.24500000002354,
        "averageElapsed": 0.017571957998767578,
        "minElapsed": 0.009999999999308784,
        "maxElapsed": 0.2900000000008731,
        "errors": 0
    },
    "StyleObserver.getSelector": {
        "name": "StyleObserver.getSelector",
        "count": 8095,
        "totalElapsed": 242.5949999999757,
        "averageElapsed": 0.02996849907349916,
        "minElapsed": 0.019999999998617568,
        "maxElapsed": 1.3800000000001091,
        "errors": 0
    },
    "Sizzle.selectors.pseudos.properties": {
        "name": "Sizzle.selectors.pseudos.properties",
        "count": 8095,
        "totalElapsed": 259.0500000000038,
        "averageElapsed": 0.03200123533045137,
        "minElapsed": 0.020000000000436557,
        "maxElapsed": 4.139999999999418,
        "errors": 0
    }
}

@ameshkov ameshkov added this to the 1.10 milestone Feb 7, 2018
@theseanl
Copy link
Contributor

For documentations sake, reposting a comment #55 (comment).

All the performance concerns were caused by compilerCache being missed. Simply calling Sizzle.compile on certain selectors restores the performance of the previous version. This is looks like a bug of Sizzle, and it seems to be fixed in Sizzle's master branch.

@ameshkov ameshkov reopened this Mar 19, 2018
adguard pushed a commit that referenced this issue Aug 17, 2020
Merge in EXTENSIONS/extended-css from fix/AG-3589 to master

* commit '452117988d48dffeb7c2e2cb51707fcd950d0ff7':
  fix break caused by previous ancestor removing
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