Opened on 12/24/2014 at 09:46:14 PM

Closed on 11/10/2017 at 11:17:30 AM

#1735 closed defect (rejected)

Element Hiding Helper selection not working when all elements are positioned absolutely

Reported by: Khrin Assignee:
Priority: P3 Milestone:
Module: Extensions-for-Adblock-Plus Keywords:
Cc: mapx, trev, greiner Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Verified working:
Review URL(s):

Description (last modified by trev)

Environment

Using the latest version of Element Hiding Helper (on Firefox 35 beta 6, ABP 2.6.6.3881, EHH 1.3.0.472) it's impossible to correctly highlight elements on pages where all elements are positioned absolutely.

How to reproduce

  1. Go to http://www.energyfmsa.co.za/
  2. Open Element Hiding Helper, to select an element on the page.
  3. Look at the red rectangle used to highlight elements.

Observed behaviour

The red rectangle will be stuck at the top of page. This is merely a visualization issue, as it will still be possible to click the element and open the assistant window.

Expected behaviour

The red rectangle should be positioned correctly around the relevant element.

Analysis

Viewport size is being determined incorrectly, document.documentElement.clientHeight returns 0. It obviously doesn't consider all the absolutely positioned elements.

Attachments (0)

Change History (8)

comment:1 Changed on 12/25/2014 at 08:18:24 AM by mapx

  • Cc mapx added
  • Component changed from Unknown to Extensions-for-Adblock-Plus

comment:2 Changed on 01/06/2015 at 11:35:58 AM by philll

  • Cc trev added

Highlighting also doesn't show up on other pages like web.de

comment:3 Changed on 01/06/2015 at 01:40:34 PM by trev

I can reproduce the reported issue in both Firefox 34 and Firefox 37.0a1 nightly. I cannot see any problem on web.de however.

On www.energyfmsa.co.za positioning is indeed off, I see top: -2px being used for each element.

Last edited on 01/06/2015 at 01:42:18 PM by trev

comment:4 Changed on 01/06/2015 at 02:06:53 PM by trev

  • Cc greiner added

The problem is that the height of this document is being determined incorrectly. document.documentElement.clientHeight gives 0 because all elements are positioned absolutely. window.innerHeight would give the correct value here but not on websites with a horizontal scrollbar.

Thomas, any idea how we can reliably get viewport size (minus scrollbars)? Special handling for document.documentElement.clientHeight == 0 and falling back to window.innerHeight won't do, as some elements might not be positioned absolutely even if the majority of them is. I'm getting the impression that one needs to track down all absolutely positioned elements and get their position for the correct result.

comment:5 Changed on 01/06/2015 at 02:16:42 PM by trev

  • Description modified (diff)
  • Priority changed from Unknown to P3
  • Ready set
  • Summary changed from Element Hiding Helper highlighting bug. to Element Hiding Helper selection not working when all elements are positioned absolutely

comment:6 Changed on 01/07/2015 at 04:13:41 PM by greiner

Interestingly, unlike Firefox, Chrome Element.clientHeight does not return 0 and neither does IE 11. The spec defines it as follows:

  1. If the element has no associated CSS layout box or if the CSS layout box is inline, return zero.
  1. If the element is the root element and the element's document is not in quirks mode, or if the element is the HTML body element and the element's document is in quirks mode, return the viewport height excluding the size of a rendered scroll bar (if any).

I didn't find any issues using window.innerHeight when playing around inserting and targeting elements in the page with position: static. It does include the height of the horizontal scrollbar but we are already using window.innerWidth to determine the viewport width.

comment:7 Changed on 05/20/2015 at 02:22:39 PM by philll

  • Platform changed from Firefox/Firefox Mobile to Firefox

Made Firefox and Firefox mobile available as seperate platforms.

comment:8 Changed on 11/10/2017 at 11:17:30 AM by trev

  • Resolution set to rejected
  • Status changed from new to closed

Mass-closing all bugs in the Extensions for Adblock Plus module, these extensions no longer work as of Adblock Plus 3.0 / Firefox 57.

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