RESOLVED WORKSFORME 82246
REGRESSION: r107883 broke loading the mobile Orange.fr site
https://bugs.webkit.org/show_bug.cgi?id=82246
Summary REGRESSION: r107883 broke loading the mobile Orange.fr site
Simon Fraser (smfr)
Reported 2012-03-26 14:17:13 PDT
Attempting to load http://orange.fr (with an iOS user-agent) fails after r107883. Console shows: TypeError: 'true' is not a function (evaluating '$("page1").translate("100%","100%")')
Attachments
Simon Fraser (smfr)
Comment 1 2012-03-26 14:21:29 PDT
The page does: if (wink.isUndefined(HTMLElement.prototype.translate)) HTMLElement.prototype.translate = HTMLElement.prototype.winkTranslate;
Radar WebKit Bug Importer
Comment 2 2012-03-26 14:22:29 PDT
Adam Barth
Comment 3 2012-03-26 14:44:54 PDT
Is wink a library of some sort, or is it specific to this site? If enough sites use this library, we'll probably need to change the spec to use a name other than "translate" for the translation feature.
Andy Estes
Comment 4 2012-03-26 14:48:07 PDT
(In reply to comment #3) > Is wink a library of some sort, or is it specific to this site? If enough sites use this library, we'll probably need to change the spec to use a name other than "translate" for the translation feature. Possibly <http://www.winktoolkit.org>?
Simon Fraser (smfr)
Comment 6 2012-03-26 14:51:30 PDT
Adam Barth
Comment 7 2012-03-26 14:51:54 PDT
I'll send an email to the WhatWG.
Adam Barth
Comment 8 2012-03-26 14:57:10 PDT
Sent. Let's see if folks there have thoughts on what we should do here.
Pablo Flouret
Comment 9 2012-03-26 15:01:20 PDT
I can take care of making any necessary changes if there's a need.
Theresa O'Connor
Comment 10 2012-03-26 15:43:14 PDT
rakesh makluri
Comment 11 2012-04-11 21:34:54 PDT
Hi Adam, With this support our product is breaking now. Present we are loading and using the translate() API on HTML elements to translate. But now with this change it is breaking. Is there any way to override this attribute. We can change the API but, so many existing customers and our internal components are also using this. Please help with this.
Adam Barth
Comment 12 2012-04-11 21:58:30 PDT
Hi Rakesh, From <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-March/035199.html>, I was under the impression that the Wink Toolkit folks have resolved the issue on their end. Have you discussed the issue with Jérôme ? Generally, it's not a good idea to squat on property names on HTMLElements (like translate). As HTML evolves, it will use more and more of these names.
rakesh makluri
Comment 13 2012-04-11 22:08:41 PDT
Hi Adam, Thank you very much for the quick reply. Am not discussed the issue with Jérôme. Am not able to comment in the above link. I saw a discussion in progress to change the name of the attribute. Is it going to be changed? Our code exist for last 4 to 5 years, now changing the API means a lot of effort. Need to communicate to all customers and change the internal components code. And is there any way(hack) to override this attribute? (In reply to comment #12) > Hi Rakesh, > > From <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-March/035199.html>, I was under the impression that the Wink Toolkit folks have resolved the issue on their end. Have you discussed the issue with Jérôme ? > > Generally, it's not a good idea to squat on property names on HTMLElements (like translate). As HTML evolves, it will use more and more of these names.
Adam Barth
Comment 14 2012-04-11 22:26:31 PDT
Oh, I think I misunderstood your earlier comment. Are you using the Wink Toolkit? It sounds like you're problem might be separate from the Wink issue. There is an ugly way to hack around the issue. You can delete the translate property from each element. For example: delete document.body.translate; alert(document.body.translate); ^^^ Now the translate property is gone. It's a bit tricky because the property is on each element rather than on the prototype chain. I'm not sure what constraints you face, but that might be one option to explore.
rakesh makluri
Comment 15 2012-04-11 22:43:38 PDT
Yah my problem is separate from the Wink Toolkit. Thank you for the work around. I tested with sample page it is working fine. My assumption now is, "translate" attribute name is not going to be chagned? Thanks & Regards Rakesh (In reply to comment #14) > Oh, I think I misunderstood your earlier comment. Are you using the Wink Toolkit? It sounds like you're problem might be separate from the Wink issue. > > There is an ugly way to hack around the issue. You can delete the translate property from each element. For example: > > delete document.body.translate; > alert(document.body.translate); > ^^^ Now the translate property is gone. > > It's a bit tricky because the property is on each element rather than on the prototype chain. I'm not sure what constraints you face, but that might be one option to explore.
Ryosuke Niwa
Comment 16 2012-04-11 23:42:30 PDT
(In reply to comment #15) >My assumption now is, "translate" attribute name is not going to be chagned? As far as I know, we won't be changing the name of the content attribute. So you should eventually rename the function. In general, you should prefix your function names to avoid name conflicts like this.
rakesh makluri
Comment 17 2012-04-11 23:46:32 PDT
hmmm... :-) Ok, we will change the name of the API. Thanks you for spending time and giving information. Regards, Raeksh (In reply to comment #16) > (In reply to comment #15) > >My assumption now is, "translate" attribute name is not going to be chagned? > > As far as I know, we won't be changing the name of the content attribute. So you should eventually rename the function. In general, you should prefix your function names to avoid name conflicts like this.
David Kilzer (:ddkilzer)
Comment 18 2012-06-09 05:42:19 PDT
Loading orange.fr with an iPhone user agent seems to work now. I don't see that message in the console anymore.
rakesh makluri
Comment 19 2012-08-07 22:42:45 PDT
Hi Adam, With the option "delete document.body.translate", am facing issue in Mac Safari6. With this operation not able to delete the "translate" attribute. Where as in chrome it is working fine. Do you have any idea? (In reply to comment #14) > Oh, I think I misunderstood your earlier comment. Are you using the Wink Toolkit? It sounds like you're problem might be separate from the Wink issue. > > There is an ugly way to hack around the issue. You can delete the translate property from each element. For example: > > delete document.body.translate; > alert(document.body.translate); > ^^^ Now the translate property is gone. > > It's a bit tricky because the property is on each element rather than on the prototype chain. I'm not sure what constraints you face, but that might be one option to explore.
Alexey Proskuryakov
Comment 20 2012-08-08 09:22:36 PDT
This bug is resolved. If something broke again, please file a new bug. That said, renaming translate in your code to not conflict with HTML5 is the best way to resolve this.
Note You need to log in before you can comment on or make changes to this bug.