Summary: | window.performance object resets script-applied properties | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | e.a. nakashima <eanakashima> | ||||
Component: | WebCore JavaScript | Assignee: | Chris Dumez <cdumez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, alex.christensen, ap, aroben, cdumez, commit-queue, darin, esprehn+autocc, ggaren, godfreykfc, hartman.wiki, kondapallykalyan, krinklemail, rniwa, sam | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Mac (Intel) | ||||||
OS: | Other | ||||||
URL: | http://jsfiddle.net/dss8wudw/3/ | ||||||
Attachments: |
|
Description
e.a. nakashima
2014-10-03 14:50:34 PDT
I think this is an issue with the JavaScript bindings and not with the underlying C++ object that is wrapped, and it may be intentionally resetting something. Are there other built-in browser-provided objects that have similar behavior? I unfortunately don't have access to build WebKit on Yosemite right now, but I could look into something that behaves similarly on Mavericks. Bug 122770 could be an example, it fixed the same problem for window.crypto. Downstream report from Wikimedia where this caused fatal exceptions for Safari users reading Wikipedia: https://phabricator.wikimedia.org/T112287#1638614 Test case: http://codepen.io/Krinkle/debug/YywQJb It has three checkpoints: 1) Immediately after definition. 2) From a <script src> loaded script. 3) After window.onload. In Safari 8.0.8, sometimes 'performance.mark' is defined at all thee, sometimes only at #1, sometimes at #1 and #2. Also confirmed as a problem in Version 9.0 (10601.1.56) btw. There is still an issue in 9.1.3 I'll take a look soon. Created attachment 288603 [details]
Patch
We can recommend a workaround for affected sites if they want to work properly with older versions of WebKit. I think that putting this line of code in will work around the bug: window.keepPerformanceAlive = window.performance; Note, that’s just a guess. Someone would need to test to be sure that works! Comment on attachment 288603 [details] Patch Clearing flags on attachment: 288603 Committed r205823: <http://trac.webkit.org/changeset/205823> All reviewed patches have been landed. Closing bug. |