Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Issue 1507373003: Clean up attributes of image elements (Closed)

Created:
5 years ago by wychen
Modified:
5 years ago
Reviewers:
mdjones
Base URL:
git@github.com:chromium/dom-distiller.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Clean up attributes of image elements Only retain some white-listed attributes of image elements. Also, do not add an empty "srcset" attribute. BUG=567955 R=mdjones@chromium.org Committed: 79912086f9340c8c57f46fe4203019b8f2a3f0e2

Patch Set 1 #

Total comments: 4

Patch Set 2 : address mdjones' comments #

Total comments: 2

Patch Set 3 : keep alt as well #

Total comments: 3

Patch Set 4 : fix attribute striping, keep title and dir #

Patch Set 5 : add todos #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -8 lines) Patch
M java/org/chromium/distiller/DomUtil.java View 1 2 3 3 chunks +35 lines, -1 line 0 comments Download
M java/org/chromium/distiller/webdocument/WebImage.java View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M java/org/chromium/distiller/webdocument/WebText.java View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M javatests/org/chromium/distiller/ContentExtractorTest.java View 1 2 3 4 5 chunks +19 lines, -6 lines 0 comments Download
M javatests/org/chromium/distiller/DomUtilTest.java View 1 2 3 3 chunks +18 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (6 generated)
wychen
PTAL https://codereview.chromium.org/1507373003/diff/20001/javatests/org/chromium/distiller/ContentExtractorTest.java File javatests/org/chromium/distiller/ContentExtractorTest.java (right): https://codereview.chromium.org/1507373003/diff/20001/javatests/org/chromium/distiller/ContentExtractorTest.java#newcode92 javatests/org/chromium/distiller/ContentExtractorTest.java:92: // Also test images in WebImage, WebText, and ...
5 years ago (2015-12-09 05:17:40 UTC) #3
mdjones
https://codereview.chromium.org/1507373003/diff/20001/java/org/chromium/distiller/webdocument/WebImage.java File java/org/chromium/distiller/webdocument/WebImage.java (right): https://codereview.chromium.org/1507373003/diff/20001/java/org/chromium/distiller/webdocument/WebImage.java#newcode48 java/org/chromium/distiller/webdocument/WebImage.java:48: ie.setSrc(ie.getSrc()); Instead of removing all the attributes manually, wouldn't ...
5 years ago (2015-12-09 17:40:16 UTC) #4
wychen
https://codereview.chromium.org/1507373003/diff/20001/java/org/chromium/distiller/webdocument/WebImage.java File java/org/chromium/distiller/webdocument/WebImage.java (right): https://codereview.chromium.org/1507373003/diff/20001/java/org/chromium/distiller/webdocument/WebImage.java#newcode48 java/org/chromium/distiller/webdocument/WebImage.java:48: ie.setSrc(ie.getSrc()); On 2015/12/09 17:40:16, mdjones wrote: > Instead of ...
5 years ago (2015-12-09 22:27:54 UTC) #5
mdjones
lgtm https://codereview.chromium.org/1507373003/diff/40001/java/org/chromium/distiller/DomUtil.java File java/org/chromium/distiller/DomUtil.java (right): https://codereview.chromium.org/1507373003/diff/40001/java/org/chromium/distiller/DomUtil.java#newcode219 java/org/chromium/distiller/DomUtil.java:219: stripImageElements(clonedSubtree); It could be argued that images as ...
5 years ago (2015-12-10 01:12:46 UTC) #6
wychen
Keep alt as well. I wonder what else is needed. I'm on the fence of ...
5 years ago (2015-12-10 05:39:17 UTC) #8
mdjones
I'm still in favor of using a white list at this point. There are a ...
5 years ago (2015-12-10 17:05:22 UTC) #9
wychen
5 years ago (2015-12-16 01:13:01 UTC) #13
Message was sent while issue was closed.
Committed patchset #5 (id:120001) manually as
79912086f9340c8c57f46fe4203019b8f2a3f0e2 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698