Opened on 07/18/2014 at 10:05:56 AM

Closed on 01/27/2015 at 10:56:01 AM

Last modified on 02/20/2015 at 12:29:40 PM

#1082 closed change (fixed)

Use Element.getBoundingClientRect to position overlay in "block element" feature

Reported by: greiner Assignee: sebastian
Priority: P3 Milestone: Adblock-Plus-1.8.11-for-Chrome-Opera-Safari
Module: Platform Keywords: goodfirstbug
Cc: mapx Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/6527157522137088

Description (last modified by sebastian)

Background

We currently determine the position of an element on a page ourselves by adding up offsets to its parent elements. This is required for the "Block element" feature. However, this functionality is already provided by the browser by getBoundingClientRect(). Moreover, our implementation doesn't work for framesets.

What to change

In include.postload.js:

  • Remove getAbsolutePosition function
  • Use Element.getBoundingClientRect in conjunction with window.scrollX and window.scrollY instead

Hints for testers

Verify that when using "Block element" the highlighted boxes are positioned as before this change. That means that the yellow boxes should be located on top of the elements underneath the mouse cursor and that the red boxes should be located on top of the elements matching the suggested filter.

Test on Chromium based browsers and Safari.

Attachments (0)

Change History (9)

comment:1 Changed on 07/18/2014 at 11:17:00 AM by mapx

  • Cc mapx added

comment:2 Changed on 07/18/2014 at 06:19:35 PM by sebastian

How about adding some information to this issue, like why this approach is preferable, and what the expected results are, and how to test it?

comment:3 Changed on 07/18/2014 at 06:19:35 PM by sebastian

Last edited on 08/27/2014 at 05:46:28 PM by sebastian

comment:4 Changed on 09/24/2014 at 02:09:46 PM by greiner

  • Description modified (diff)

Added "Hints for testers" section.

comment:5 Changed on 09/26/2014 at 10:09:50 AM by sebastian

  • Description modified (diff)
  • Platform changed from Chrome to Unknown
  • Priority changed from P3 to P4
  • Ready set

comment:6 Changed on 01/26/2015 at 11:02:23 AM by sebastian

  • Owner set to sebastian
  • Priority changed from P4 to P3

Increasing priority, since the current approach beside being obsolete, causes issues with framesets.

comment:7 Changed on 01/26/2015 at 11:13:10 AM by sebastian

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

comment:8 Changed on 01/27/2015 at 10:56:01 AM by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:9 Changed on 02/20/2015 at 12:29:40 PM by sebastian

  • Description modified (diff)

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