Opened 5 months ago

Closed 4 months ago

Last modified 3 months ago

#5422 closed defect (fixed)

Property selector matching * selector doesn't work

Reported by: fhd Assignee: hfiguiere
Priority: P2 Milestone:
Module: Core Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29490698/

Description (last modified by trev)

Environment

Adblock Plus for Chrome 1.13.3

How to reproduce

  1. Add the following custom filter: testpages.adblockplus.org#?#.abp-testsuite-fail:-abp-properties(/.*/)
  2. Navigate to https://testpages.adblockplus.org/en/testsuite/05

Observed behaviour

The box under _Test case_ is red, and the following error shows up in the console:

Error in event handler for (unknown): SyntaxError: Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to parse the rule '::content .abp-testsuite-fail*, ::content .abp-testsuite-failhtml, ::content .abp-testsuite-fail body, ::content .abp-testsuite-failh1, ::content .abp-testsuite-failh2, ::content .abp-testsuite-failh3, ::content .abp-testsuite-fail.center, ::content .abp-testsuite-fail.abp-container, ::content .abp-testsuite-fail.abp-container h1, ::content .abp-testsuite-fail h2, ::content .abp-testsuite-fail h3, ::content .abp-testsuite-fail.abp-container h3, ::content .abp-testsuite-fail.abp-container p, ::content .abp-testsuite-fail.abp-container p:last-of-type, ::content .abp-testsuite-fail.abp-container hr, ::content .abp-testsuite-fail.abp-header h1, ::content .abp-testsuite-fail.abp-header a, ::content .abp-testsuite-fail.abp-logo, ::content .abp-testsuite-fail.abp-breadcrumbs, ::content .abp-testsuite-fail.abp-pagelist, ::content .abp-testsuite-fail.abp-pagelist h3, ::content .abp-testsuite-fail.abp-testsuitelist, ::content .abp-testsuite-fail.abp-bubble, ::content .abp-testsuite-fail.abp-bubble p, ::content .abp-testsuite-fail.abp-bubble h4, ::content .abp-testsuite-fail.abp-bubble a, ::content .abp-testsuite-fail.abp-bubble a:hover, ::content .abp-testsuite-fail.abp-bubble a img, ::content .abp-testsuite-fail.abp-customfilterlist, ::content .abp-testsuite-fail.abp-linkset, ::content .abp-testsuite-fail.abp-linkset li, ::content .abp-testsuite-fail.abp-lastupdate, ::content .abp-testsuite-fail.abp-feature-table td, ::content .abp-testsuite-fail th, ::content .abp-testsuite-fail.abp-filterlist, ::content .abp-testsuite-fail.abp-reference-image, ::content .abp-testsuite-fail.abp-testcase-information, ::content .abp-testsuite-fail.abp-testcase-information th, ::content .abp-testsuite-fail.abp-testcase-information td, ::content .abp-testsuite-fail.abp-testsuite-testcase, ::content .abp-testsuite-fail.abp-testsuite-testcase-inner, ::content .abp-testsuite-fail.abp-testsuite-pass, ::content .abp-testsuite-fail.abp-testsuite-fail, ::content .abp-testsuite-fail.abp-testsuite-image, ::content .abp-testsuite-fail.abp-testsuite-result, ::content .abp-testsuite-fail.abp-testsuite-iframe, ::content .abp-testsuite-fail.abp-testsuite-03-img, ::content .abp-testsuite-fail.abp-testsuite-04, ::content .abp-testsuite-fail.abp-testcase-img-04, ::content .abp-testsuite-fail.abp-testcase-img-04 img, ::content .abp-testsuite-fail.abp-testcase-img-04-overlay, ::content .abp-testsuite-fail.abp-testcase-img-05, ::content .abp-testsuite-fail.abp-testcase-css-01, ::content .abp-testsuite-fail.abp-testcase-css-02, ::content .abp-testsuite-fail.abp-testcase-css-03::before{display: none !important;}'.
    at ElemHide.addSelectors (chrome-extension://cfhdojbkjhnklbpkdaibdccddilifddb/include.preload.js:438:24)
    at ElemHideEmulation.addSelectors (chrome-extension://cfhdojbkjhnklbpkdaibdccddilifddb/elemHideEmulation.js:476:10)
    at getFiltersFunc.patterns (chrome-extension://cfhdojbkjhnklbpkdaibdccddilifddb/elemHideEmulation.js:521:14)

Expected behaviour

The box under _Test case_ is green, and there is no error in the console.

Additional notes

Our code will currently produce the selector .abp-testsuite-fail* which isn't valid. We need special handling when selectors like * or *.foo are matched.

Change History (7)

comment:1 Changed 5 months ago by hfiguiere

  • Owner set to hfiguiere

comment:2 Changed 5 months ago by hfiguiere

  • Component changed from Unknown to Core
  • Platform changed from Chrome to Unknown / Cross platform

comment:3 Changed 5 months ago by hfiguiere

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 4 months ago by trev

  • Description modified (diff)
  • Priority changed from Unknown to P2
  • Ready set
  • Summary changed from Greedy property selector doesn't work to Property selector matching * selector doesn't work

comment:5 Changed 4 months ago by abpbot

A commit referencing this issue has landed:
Issue 5422 - Properly build props selector

comment:6 Changed 4 months ago by hfiguiere

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:7 Changed 3 months ago by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Fixed.

ABP 1.13.3.1838
Chrome 51 / 61 / Windows 10
Opera 47 / Windows 10

Note: See TracTickets for help on using tickets.