Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intelligently detect header type elements without depending on the std_header selector? #198

Open
ghost opened this issue Oct 18, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 18, 2013

Try this:

repeat for y = 10, 20, 30, 40, 50

  • find the element at point (page_width/2, y), using document.elementFromPoint()
  • if it's different from all elements found so far, check if it has any ancestor which has position:fixed. check if such ancestor has both width and height > 100 (say) and lies within the top 300 pixels of the screen. if so, consider it a 'fixed header' type element for calculation of unusable space at the top.
  • if more than one fixed-header-type element is found, consider the bottom most one

(Even if this works, the std_header selector should still be part of urlData since it's useful semantic data anyway?)

@ghost ghost self-assigned this Oct 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants