[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #18144 [Tor Browser]: about:tor update arrow position is wrong (Retina and zoom)



#18144: about:tor update arrow position is wrong (Retina and zoom)
-----------------------------------+-----------------------------------
 Reporter:  mcs                    |          Owner:  tbb-team
     Type:  defect                 |         Status:  needs_information
 Priority:  Medium                 |      Milestone:
Component:  Tor Browser            |        Version:
 Severity:  Normal                 |     Resolution:
 Keywords:  TorBrowserTeam201602R  |  Actual Points:
Parent ID:                         |         Points:
  Sponsor:                         |
-----------------------------------+-----------------------------------

Comment (by mcs):

 Replying to [comment:8 gk]:
 > Looking at the diff between the first and the second patch and at the
 comment that changed I am wondering why
 > {{{
 > tbXpos *= window.devicePixelRatio;
 > }}}
 > slipped in. I mean if `window.devicePixelRatio` is alaways `1.0` for
 non-Chrome windows (causing the bug we have here) why do we need to
 multiply `tbXpos` with it in the first place? What am I missing?

 Actually, window.devicePixelRatio will be 2.0 on a Retina display because
 'window' is the chrome window that contains the Torbutton toolbar item.
 And then dividing by the screenPixelsPerCSSPixel value from the content
 window converts the offset into device-independent units (aka CSS pixels).

 Another way to look at it: the new code is similar to the old code except
 we removed the "if ("devicePixelRatio" in window)" checks (FF 18 was a
 long time ago now) and instead of dividing by devicePixelRatio inside
 aboutTor.xhtml (the content window) we get the screenPixelsPerCSSPixel
 value inside torbutton.js and do the division there. This is necessary
 because screenPixelsPerCSSPixel is only available from privileged code
 (e.g., inside the Torbutton overlay).

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18144#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs