Opened on 06/20/2017 at 08:20:55 PM

Closed on 08/10/2017 at 02:25:00 PM

Last modified on 09/25/2017 at 02:07:38 PM

#5339 closed change (fixed)

Properly select element from pseudo-element

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

https://codereview.adblockplus.org/29481700

Description (last modified by trev)

Background

We need to be able to match CSS properties in the ::before and ::after pseudo elements.

What to change

When styles from a pseudo-element like foo::before match a CSS properties filter, make sure to hide the actual DOM element (this would be foo here).

See also

Attachments (0)

Change History (16)

comment:1 Changed on 06/20/2017 at 08:21:24 PM by hfiguiere

  • Summary changed from Implement :-abp-properties-before and -abp-properties-after to Implement :-abp-properties-before and :-abp-properties-after

comment:2 Changed on 06/20/2017 at 08:22:52 PM by hfiguiere

  • Cc fhd trev arthur added

comment:3 follow-up: Changed on 06/21/2017 at 11:26:29 AM by sebastian

  • Cc sebastian added

Is there any particular website in the wild, where we'd need this for?

comment:4 Changed on 06/21/2017 at 12:47:28 PM by mapx

  • Cc mapx added

comment:5 in reply to: ↑ 3 Changed on 06/21/2017 at 12:47:46 PM by mapx

Replying to sebastian:

Is there any particular website in the wild, where we'd need this for?

https://github.com/uBlockOrigin/uAssets/issues/357

comment:6 Changed on 07/06/2017 at 08:16:54 PM by hfiguiere

  • Owner set to hfiguiere
  • Review URL(s) modified (diff)

comment:7 Changed on 07/06/2017 at 08:17:03 PM by hfiguiere

  • Status changed from new to reviewing

comment:8 Changed on 07/24/2017 at 09:16:31 PM by hfiguiere

  • Blocking 5000 added

comment:9 Changed on 07/27/2017 at 02:54:30 PM by greiner

  • Cc greiner added

comment:10 Changed on 08/08/2017 at 11:20:15 AM by trev

The way I see it, we will already process CSS rules for ::before and ::after pseudo-elements. However, if these CSS rules match a filter, we will try to hide the pseudo-element rather than the real element. In some cases (pure CSS properties) this succeeds while not producing sufficient results, in others (CSS properties and :-abp-has() combination) it doesn't because the pseudo-elements don't correspond to any DOM elements.

I don't see why we should single out these two pseudo-elements, there are way more listed under https://drafts.csswg.org/css-pseudo-4/. Nor am I convinced that introducing new syntax here is justified. How about we just trim selectors produced for CSS property filters in order to remove the part following ::? This way we could have :-abp-properties(content: "Advertisement") work even if the CSS rule is defined for a pseudo-element.

comment:11 Changed on 08/08/2017 at 05:01:08 PM by hfiguiere

  • Description modified (diff)
  • Summary changed from Implement :-abp-properties-before and :-abp-properties-after to Properly select element from pseudo-element.

comment:12 Changed on 08/08/2017 at 05:01:32 PM by hfiguiere

  • Summary changed from Properly select element from pseudo-element. to Properly select element from pseudo-element

comment:13 Changed on 08/10/2017 at 02:24:12 PM by abpbot

A commit referencing this issue has landed:
Issue 5339 - Properly select element for pseudo-element

comment:14 Changed on 08/10/2017 at 02:25:00 PM by hfiguiere

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

comment:15 Changed on 08/29/2017 at 06:49:44 AM by trev

  • Description modified (diff)
  • Priority changed from Unknown to P2
  • Ready set

comment:16 Changed on 09/25/2017 at 02:07:38 PM by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Done. Can match properties in pseudo elements with filters.

ABP 1.13.3.1838
Chrome 52 / 61 / Windows 7
Opera 40 / 47 / Windows 7

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 hfiguiere.
 
Note: See TracTickets for help on using tickets.