Opened on 02/19/2016 at 05:56:40 PM

Closed on 02/26/2016 at 04:31:22 PM

#3670 closed change (fixed)

[abp2blocklist] Make rules case-sensitive whereever possible

Reported by: sebastian Assignee: kzar
Priority: P3 Milestone:
Module: Platform Keywords:
Cc: kzar, CraftyDeano Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29336787/

Description (last modified by sebastian)

Background

By default the regular expression given by trigger.url-filter matches case-insensitive. That's fine as it is the default behavior of Adblock Plus filters as well.

However, when the block list is compiled to a finite state machine by Safari, case-insensitive rules compile slower, result in larger code, and are slightly slower at runtime, as outlined in an official blog post.

While Adblock Plus filters are supposed to match case-insensitive (by default), it doesn't matter much for filters that can only possibly match the protocol + host part, as that part is always lowercase anyway.

Moreover, there is the $match_case filter option which is currently ignored when converting Adblock Plus filters to WebKit blocking rules.

What to change

Set trigger.url-filter-is-case-sensitive to true for rules generated from filters that either specify the $match_case option, or filters that can potentially only match the protocol + host part. These are:

  • Element hiding filters, as those can only be limited to a domain in the first place
  • Blocking filters and exception rules ...
    • with implied begin of host (starting with ||) or protocol delimiter (://)
    • that don't match any further alpha characters after the next occurrence of any of these:
      • / (begin of path)
      • ? (begin of query)
      • * (wildcard)
      • ^ (boundary)

Attachments (0)

Change History (5)

comment:1 Changed on 02/19/2016 at 06:02:42 PM by sebastian

  • Description modified (diff)

comment:2 Changed on 02/19/2016 at 06:13:12 PM by kzar

  • Owner set to kzar

comment:3 Changed on 02/19/2016 at 07:11:28 PM by sebastian

  • Description modified (diff)

comment:4 Changed on 02/21/2016 at 01:50:18 PM by kzar

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

comment:5 Changed on 02/26/2016 at 04:31:22 PM by kzar

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

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from kzar.
 
Note: See TracTickets for help on using tickets.