Fixed
Status Update
Comments
zi...@google.com <zi...@google.com> #3
Example 1. Just trying to attach your gmaps script.
If you open the developer console, you will see that gmaps init script is loaded, but "getScript("https://maps.gstatic.com/intl/en_us/mapfiles/api-3/9/8/main.js ");" line isn't working, there is no new script in the document after document.write.
If you open the developer console, you will see that gmaps init script is loaded, but "getScript("
nd...@gmail.com <nd...@gmail.com> #4
Example 2. Trying to use callback parameter. Init is loaded, main javascript file is loaded too. But not working, exception screenshot is in attach.
ad...@gmail.com <ad...@gmail.com> #5
For example 2 - your code:
...
lf.main = function(a) {
eval(a); // <-- Uncaught Error: Code generation from strings disallowed for this context
};
...
...
lf.main = function(a) {
eval(a); // <-- Uncaught Error: Code generation from strings disallowed for this context
};
...
am...@gmail.com <am...@gmail.com> #6
Just to poke this bug, using the asynchronous loading method has no effect on this. The only workaround is to roll back to manifest version 1 which is actively being phased out.
nd...@gmail.com <nd...@gmail.com> #7
Switched to Yandex Maps, it works well.
Thank you!
Thank you!
zw...@google.com <zw...@google.com> #8
As manifest version 1 won't be accepted by the Chrome Webstore starting in mid August, we really do need a workaround/fix.
Description
========
Google Maps API v3 is not optimally supporting Safari 8 for OS X, and suffers significantly degraded performance.
This is a regression from Safari 7, is related to user-agent string match behavior, is 100% replicable and likely relatively trivial to triage/fix.
Expected behavior:
==================
Safari 8 OS X's performance with Gmaps API v3 is on par with Safari 7.
Actual behavior:
================
Safari 8 OS X's performance is very poor, with frequent UI freezing / janking and low FPS.
Steps to reproduce:
===================
1. Open the sample test case .html in Safari 8 OS X
2. To make it easier to replicate, hit the button to add two raster layers. Or not.
3. Pan the map around, preferably with the arrow keys as they reproduce better than random mouse dragging. Note the terrible performance.
4. Click "Inject... Fix". Note the framerate immediately recovers and all freezing/janking is gone.
Never Lupus, Occasionally User Agent:
5. In Safari, click Develop -> User Agent -> Safari 7. (enable Developer Mode in Prefs if you don't see the Develop menu) Reload/retest.
6. Note with Safari 7 user agent, the performance is fine.
7. Click Develop -> User Agent -> Custom. Apply this, which is Chrome 41's useragent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36" [NB: DO NOT use Safari's built-in Chrome useragent, it is outdated]
8. Now reload/retest. Note with Chrome 41's useragent, Safari 8's performance is as expected.
Safari 7 Confirms Half-Life 3:
9. Now start Safari 7 OS X and retest. Performance is as expected.
10. Now, in Safari 7, click Develop -> User Agent -> Safari 8. Reload, retest.
11. Note Safari 7 with Safari 8's UA has extremely poor performance.
But Surely Chrome Can Survive Anor Londo:
12. Now fire up Chrome, and download an extension to use faux useragents.
13. Set Chrome's useragent to Firefox or Safari 8 OS X.
14. Note Chrome's performance with Firefox or Safari 8 UAs is also poor. Not as bad as Safari's, but hardly pleasant to use.
Summary:
Browser User Agent Result
--------------- ---------------- ------
Safari 8 OS X Default **FAIL** [current production behavior]
Safari 8 OS X Default OK [with injected CSS fix]
Safari 8 OS X Safari 7 OS X OK
Safari 8 OS X Safari 8 Mobile OK
Safari 8 OS X Chrome 41 OK
Chrome 40 OS X Default OK [current production behavior]
Chrome 40 OS X Firefox Fail
Chrome 41 OS X Default OK [current production behavior]
Chrome 41 OS X Firefox Fail
Safari 7 OS X Default OK [current production behavior]
Safari 7 OS X Safari 8 OS X Fail
(assuming the ASCII table whitespace doesn't get butchered)
Additional Notes:
=================
Spoiler warning!
Both Chrome and Safari do something called "layer squashing", which does not do tiled web map performance any favors.
To prevent this behavior, setting certain 3D transform type styles is necessary (-webkit-transform:translateZ(0px)). Google Maps API v3 does this for Chrome, Safari 7, and Safari 8 Mobile, yet not Safari 8 OS X.
The reason this fails is the translateZ hack/fix isn't being performed for Safari 8's useragent string. Simple as that. Either it never got updated, or there's a typo in some regex expression or something.
Perhaps ideally both Safari and Chrome should not require this, but any long-term solution seems... long-term. Thus a useful triage for every Safari 8 OS X / Gmaps API v3 user would be to make the useragent match work.
Performance Notes:
==================
Not all forced translateZ(0px)s are created equal. A significant performance difference was found in testing for Safari 8, where setting this on the tile div containers was far more performant than on the tile image elements.
(try it: inject the fix in the test case, then edit the style live and change div to img)
As part of a fix, I would suggest testing that not only for Safari 8 OS X, but also for browsers currently getting a Gmaps API-supplied translateZ(0px) such as Safari Mobile and Chrome. If the preliminary results from my testing hold up there as well, this could potentially represent a performance improvement for all WebKit/Blink-derived browsers. Which would be nice.
However, note that my fix in the test case is somewhat differently mechanically (CSS style selector) than what the Gmaps API is doing, and this requires further research in any case.
Also, speaking of performance, you guys have a memory leak, directly related to translateZ(0px). See below.
Related Bugs:
=============
1. WebKit
2. GMaps API
[1]
[2]
Testing Methodology:
====================
Two different MacBook Pros, running both OS X 10.10 and 10.9. Chrome 40, 41 for OS X. Safari 7, 8 for OS X. See WebKit
Attachments:
============
[safari8-gmaps.html] - this is your test case
[chrome40.png] - layer compositing borders on Chrome 40. Note they are aligned with map tiles.
[safari8.png] - layer compositing borders on Safari 8 by default, *while* panning the map. They only briefly appear, then get squashed.
[safari8fix.png] - layer compositing borders on Safari 8 with the hack fix in the test case. Also what Safari 7 looks like.
As you can see from the images, if you don't have yellow boxes around the tiles, to quote the South Park ski instructor, you're not gonna have a good time.