New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 658038 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Avoid using .className on <svg> elements

Project Member Reported by wychen@chromium.org, Oct 20 2016

Issue description

Calling .className on an <svg> element returns an SVGAnimatedString object, not a string.

In GWT, Element.getClassName() would be translated to .className. This is not specially handled by GWT (https://github.com/gwtproject/gwt/issues/9124), so we have to take care of it.

Workaround before GWT has a fix: use Element.getAttribute("class") instead.
 

Comment 1 by wychen@chromium.org, Oct 20 2016

Description: Show this description

Comment 2 by wychen@chromium.org, Oct 20 2016

We met this issue before ( issue 398230 ), and this kind of error is introduced again in https://codereview.chromium.org/2401853004.

The error this time is:

Error during distillation: TypeError: (c.className || "").indexOf is not a function

Comment 3 by wychen@chromium.org, Oct 21 2016

This issue is discovered by running the distillable-desktop-mhtml dataset. 2 out of ~1000 entries are affected.

Comment 4 Deleted

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a22aa4380f04d2d8aa18f1f3098393516646f181

commit a22aa4380f04d2d8aa18f1f3098393516646f181
Author: wychen <wychen@chromium.org>
Date: Mon Oct 24 19:38:13 2016

Roll DOM Distiller JavaScript distribution package

Diff since last roll:
https://github.com/chromium/dom-distiller/compare/d16a68c1b8...072fe57b48

Picked up changes:
072fe57 Recognize H4 to H6 as headings as well
52047b4 Avoid using getClassName() to avoid issues with <svg>
8cf93ce Bump ChromeDriver version to 2.24
d876125 Add gen_mhtml_corpus.py to convert MHTML to eval corpus
8b33c8b Amend "Fix partially hidden article"
3fd2017 Strip unwanted classNames from all nodes

BUG=593457,599121, 647098 , 658038 

Review-Url: https://codereview.chromium.org/2447453002
Cr-Commit-Position: refs/heads/master@{#427118}

[modify] https://crrev.com/a22aa4380f04d2d8aa18f1f3098393516646f181/DEPS
[modify] https://crrev.com/a22aa4380f04d2d8aa18f1f3098393516646f181/third_party/dom_distiller_js/README.chromium

Comment 6 by wychen@chromium.org, Oct 24 2016

Cc: k...@chromium.org
Status: Fixed (was: Started)

Sign in to add a comment