Bug 82246 - REGRESSION: r107883 broke loading the mobile Orange.fr site
Summary: REGRESSION: r107883 broke loading the mobile Orange.fr site
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://mobile.orange.fr/visiteur/PV?P...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-03-26 14:17 PDT by Simon Fraser (smfr)
Modified: 2012-08-08 09:22 PDT (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 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%")')
Comment 1 Simon Fraser (smfr) 2012-03-26 14:21:29 PDT
The page does:

if (wink.isUndefined(HTMLElement.prototype.translate))
    HTMLElement.prototype.translate = HTMLElement.prototype.winkTranslate;
Comment 2 Radar WebKit Bug Importer 2012-03-26 14:22:29 PDT
<rdar://problem/11122949>
Comment 3 Adam Barth 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.
Comment 4 Andy Estes 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>?
Comment 6 Simon Fraser (smfr) 2012-03-26 14:51:30 PDT
orange.fr is getting it via http://omldev.hopto.org:8080/snowdev/js/wink.min.js
Comment 7 Adam Barth 2012-03-26 14:51:54 PDT
I'll send an email to the WhatWG.
Comment 8 Adam Barth 2012-03-26 14:57:10 PDT
Sent.  Let's see if folks there have thoughts on what we should do here.
Comment 9 Pablo Flouret 2012-03-26 15:01:20 PDT
I can take care of making any necessary changes if there's a need.
Comment 10 Theresa O'Connor 2012-03-26 15:43:14 PDT
Adam's thread on the whatwg list: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-March/035173.html
Comment 11 rakesh makluri 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.
Comment 12 Adam Barth 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.
Comment 13 rakesh makluri 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.
Comment 14 Adam Barth 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.
Comment 15 rakesh makluri 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.
Comment 16 Ryosuke Niwa 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.
Comment 17 rakesh makluri 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.
Comment 18 David Kilzer (:ddkilzer) 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.
Comment 19 rakesh makluri 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.
Comment 20 Alexey Proskuryakov 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.