New issue
Advanced search Search tips

Issue 823556 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Translate broken with SVG when accessing .className

Reported by s...@selz.com, Mar 20 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.33 Safari/537.36

Example URL:
https://cdn.selzstatic.com/tmp/google-translate-test.html

Steps to reproduce the problem:
1. Go to above URL with example <svg> with title attribute
2. Right click in the body and click "Translate to English" 
3. Observe JavaScript error in the dev tools console which breaks other JavaScript execution

What is the expected behavior?
No JavaScript error

What went wrong?
Through some debugging I found the Google Translate JavaScript is looking for .className which with an SVG will return an SVGAnimatedString and not a real String. You need to use .getAttribute('class') instead. 

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 66.0.3359.33  Channel: beta
OS Version: OS X 10.13.4
Flash Version:
 
Labels: Needs-Triage-M66
Components: -Blink UI>Browser>Language>Translate
Owner: yyushkina@chromium.org
Status: Assigned (was: Unconfirmed)
Labels: -Pri-2 Pri-3
Status: Unconfirmed (was: Assigned)
Can't repro this. When I go to the example site, Translate works as intended. Tried this in Canary on 66 and on stable in 65, both on Mac.

Comment 5 by s...@selz.com, Mar 21 2018

Yes, the translation works. It also breaks JavaScript execution due to the error in the console. Here you go:
https://www.dropbox.com/s/mkbnrzqyaoeywr4/Kapture%202018-03-21%20at%2015.35.10.mp4?dl=0
Cc: yyushkina@chromium.org
Labels: -Needs-Triage-M66
Owner: anthonyvd@chromium.org
Status: Assigned (was: Unconfirmed)
Labels: Hotlist-TranslateElement

Sign in to add a comment