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

ExtendedCss recursively calls MutationObserver #1317

Closed
maximtop opened this issue Mar 7, 2019 · 0 comments
Closed

ExtendedCss recursively calls MutationObserver #1317

maximtop opened this issue Mar 7, 2019 · 0 comments
Assignees
Labels
Bug
Milestone

Comments

@maximtop
Copy link
Contributor

@maximtop maximtop commented Mar 7, 2019

@maximtop commented on Thu Mar 07 2019

This link https://4pda.ru/2017/03/19/338134/ causes over 100% load in the chrome task manager

This happens because of Sizzle, which changes id attribute while executes the querySelectorAll request.


@maximtop commented on Thu Mar 07 2019

These 3 rules

  1. 4pda.ru##body > * > * > div > * > * > * > * > div > a[target="_blank"]:has(> img)
  2. 4pda.ru#$#.slider-nav > ul > li:has(> a[href="//4pda.ru/devdb/"]) { display: block!important; }
  3. 4pda.ru#$#body > *:not(div) > * > div:has(> *) > *:not(div):not(iframe):not(a):not(b):not(table):not(img):not(textarea):not(input):not(br):not(h3):not(p) { background-image: none!important; background: #e6e7e9!important }

sizzle changes id in this part of code
if (nid = context.getAttribute("id")) { nid = nid.replace(rcssescape, fcssescape); } else { context.setAttribute("id", nid = expando); }


@ameshkov commented on Thu Mar 07 2019

2 issues:

  1. Why does loop protection not work?
  2. You should disconnect observer before applying rules and connect it again afterwards.

@maximtop commented on Thu Mar 07 2019

Because loop protection filters only mutations with style attributes

    var protectionObserverOption = {
        attributes: true,
        attributeOldValue: true,
        attributeFilter: ['style']
    };
@maximtop maximtop self-assigned this Mar 7, 2019
@maximtop maximtop added the Bug label Mar 7, 2019
@maximtop maximtop added this to the 3.0 milestone Mar 7, 2019
@zzebrum zzebrum closed this Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.