-
Notifications
You must be signed in to change notification settings - Fork 122
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
Not working on latest Webkit Nightlies #37
Comments
Adding this would seem to help:
|
Thank you, but I'm not testing against nightlies. It's impossible to track all Moz/Webkit/Opera nightlies and their short living bugs and new features. I will have of course to check periodically to se if any of the prefixed properties I'm using have been removed or changed. |
Ok. I would assume this to break fairly soon in Safari/Chrome as well, but let's see. |
Well well... https://bugs.webkit.org/show_bug.cgi?id=56543 Need to find another way. Question is, should I use some other feature detection, or should I just sniff the user agent since it's becoming to stupid to track all the versions of everything...? |
My coworker and I dynamically created a svg element and check its currentScale property. It works great on Chrome and likely most browsers too. It works sometimes on FF if the zoom text only feature is turned off.
|
@PoyangLiu very interesting! I'll look into it, thanks |
@PoyangLiu I wrote this fiddle - http://jsfiddle.net/tombigel/HzQwr/ Am I doing something wrong? |
Your window.out definition should be in the body tag or after window is loaded. I couldn't get your fiddle to work even with the various options though. Maybe JSFiddle's options (eg. OnLoad) are not working?
|
Ok, something in jsFiddle breaking it, you html works for me. Do you have a retina mac around to see what is the initial scale on retina displays? |
1.0.4 has stopped working in Chrome Betas, only returns 1 for My exact version as of now is Version 27.0.1453.56 beta-m, I forgot to note the version before that also had the same problem. Combined the info in above comment with 1.0.4 and changed the webkit function to: var webkit = function () {
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
svg.setAttribute('version', '1.1');
document.body.appendChild(svg);
var zoom = svg.currentScale;
document.body.removeChild(svg);
zoom = Math.round(zoom * 100) / 100;
return {
zoom: zoom,
devicePxPerCssPx: zoom * devicePixelRatio()
};
}; This works, where the Note however that I have not been able to test this in older webkit! |
@tombigel . Sorry, I don't have retina mac for testing. |
There's always something.... Just discover that this won't work if the svg is within an iframe because the scale of the svg is relative of the frame that encloses it. TestScale.htm is the code I pasted in the previous comment.
|
In the latest webkit nightlies the zoom level is not detected. This is possibly due to the fact that "document.body.style.webkitTextSizeAdjust" returns undefined (not a string) on the webkit nightly.
My Webkit Nightly (Safari) version:
6.0.1 (8536.26.14, 537+)
Operating system: Os X
The text was updated successfully, but these errors were encountered: