Opened 5 years ago

Closed 5 years ago

#2391 closed change (duplicate)

Create a new filter class for CSS property filters

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

Description

Background

CSS property filters will use a syntax compatible with element hiding filters: example.com##.foo > [-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 (1)

comment:1 Changed 5 years ago by trev

  • Blocking 2389 removed
  • Resolution set to duplicate
  • Status changed from new to closed

Heh, Trac created two identical issues, see #2390.

Note: See TracTickets for help on using tickets.