Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Problem handling em-based media queries when zoomed #14359

Closed
ryanmark opened this issue Jun 16, 2016 · 1 comment
Closed

Problem handling em-based media queries when zoomed #14359

ryanmark opened this issue Jun 16, 2016 · 1 comment
Labels

Comments

@ryanmark
Copy link

ryanmark commented Jun 16, 2016

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version. 2.1.1
  2. What steps will reproduce the problem?
    1. Use this test script
    2. Compare outputs of phantomjs test-phantom.js https://duckduckgo.com 1 and phantomjs test-phantom.js https://duckduckgo.com 2
    3. The outputs of both script runs should be the same.
  3. Which operating system are you using? Mac OS X 10.11
  4. Did you use binary PhantomJS or did you compile it from source? Binary, via homebrew
  5. Please provide any additional information below.

It seems that PhantomJS is not properly handling em sizes in media queries when the zoomFactor is set to 2. My testing of actual css led me to write a test script that uses window.matchMedia to show this problem. Media queries using px sizes seem unaffected by zoomFactor.

The test script loads an arbitrary web page at a given zoomLevel, measures the size of an em by creating a div element, then tests an em-based media query and a px-based media query that are roughly equivalent using window.matchMedia.

The media query tested is min-width: windowWidth - 100 pixels. Adjusting the 100 pixels sometimes yields different results, but I haven't been able to determine a pattern there.

@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant