[webkit-dev] Exposing CSS pixel metrics to the scripting environment

Charles Pritchard chuck at jumis.com
Sat Nov 27 03:08:43 PST 2010

The whatwg thread had no outcome other than the response of Mozilla reiterating their prior conclusion. I've posted to WebKit for further feedback.

I don't see what broad base might develop within whatwg. In all pragmatic aspects, webkit-dev seems to me the appropriate forum.

Moz has stated clearly, repeatedly, that they do not wish to make the information easily accessible. This conclusion was made prior to my defect report and was unaltered by it. As of this date, I do not believe any webkit contributors have voiced their opinion. I'd prefer to focus on the technical aspects and likelihood of adoption. I'm posting to webkit, as I like to see this issue resolved within the webkit code base.


On Nov 26, 2010, at 10:13 PM, James Robinson <jamesr at google.com> wrote:

> Are you posting here because there is something specific to WebKit in
> your query or because you dislike the outcome of the WHATWG thread?
> Most of us follow the WHATWG closely and generally prefer to discuss
> standardization issues such as this in that forum to get a broader
> feedback base.
> - James
> On Friday, November 26, 2010, Charles Pritchard <chuck at jumis.com> wrote:
>> Recently I brought this issue up to the WHATWG mailing list, without much luck.
>> Currently, mobile devices are given access to window.devicePixelRatio, used for managing what are essentially higher resolution displays. See the iPhone, Android, etc. Within the desktop environment, devicePixelRatio is not updated on zoom events. I don't think it should be, but it's something to consider. Such information is critical to adjusting the resolution of bitmaps, be they from an image source or a canvas source, to be as crisp as can be.
>> Microsoft has gone ahead in IE9 and just exposed a collection of metrics data:
>> deviceXDPI, logicalXDPI, systemXDPI and "Y" counterparts.
>> Source:
>> http://msdn.microsoft.com/en-us/library/ms535868(VS.85).aspx <http://msdn.microsoft.com/en-us/library/ms535868%28VS.85%29.aspx>
>> The task at hand is deciding whether or not to expose this information, and where. Technically, it's quite simple, as it's only a few floating point values which are already available to the WebKit environment. Zoom events always trigger a 'resize' event for window, as they alter the innerWidth and innerHeight of the layout. That resize event is the point in which the scripting environment would check to see if CSS pixel metrics have changed, and adjust the page accordingly. I want to note, that I am not speaking at all about changing how zoom works, or in any way suggesting that zoom be controlled by the scripting environment / web authors.
>> I am recommending that we take a look at Microsoft's  .screen extensions, and decide whether they hold merit, and may be included in WebKit. Doing so would mean that an independent implementation has picked up the extension, and it may be on the fast track for standardization.
>> I had a rough time bringing this up with Mozilla. I'm hoping for a little more focus here, on this mailing list. Again, I'm merely looking to have CSS pixel metrics exposed, and I'm suggesting the MS proposal as it's certain to exist in their upcoming IE9 release. Their proposal exposes six floating point variables in the window.screen object, and is sufficient for current needs.
>> Please let me know thoughts on the matter, and try to keep focused on the fact that we're just looking to expose a few floating points to the scripting environment, we're not looking to change any existing behaviors in any existing elements.
>> -Charles
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

More information about the webkit-dev mailing list