Opened 5 years ago

Closed 5 years ago

#2390 closed change (fixed)

Create a new filter class for CSS property filters

Reported by: trev Assignee: greiner
Priority: P2 Milestone: Adblock-Plus-2.6.10-for-Firefox
Module: Core Keywords:
Cc: Blocked By:
Blocking: #2389, #2392 Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):



CSS property filters will use a syntax compatible with element hiding filters: > [-abp-properties='|background-image: url(data:*)']. However, the handling will be very different, meaning that they need their own class.

What to change

Create a new class CSSPropertyFilter extending ElemHideBase. This class should have additional properties selectorPrefix and selectorSuffix - substrings of the selector, before and after the -abp-properties clause respectively. It should also have a lazily resolved regexp property, similarly to RegExpFilter. The logic for converting abp-properties value into a regular expression should be shared between CSSPropertyFilter and RegExpFilter.

ElemHideBase.fromText() should be extended to recognize CSS property filters and return an instance of the correct class. Optional: verify that there is at least one positive entry in the domains list and return InvalidFilter if there is none (only if the performance won't suffer).

Change History (4)

comment:1 Changed 5 years ago by trev

  • Blocking 2392 added

comment:2 Changed 5 years ago by greiner

  • Owner set to greiner

comment:3 Changed 5 years ago by greiner

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

comment:4 Changed 5 years ago by greiner

  • Milestone set to Adblock-Plus-for-Firefox-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.