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

Unified Diff: java/org/chromium/distiller/webdocument/WebImage.java

Issue 1507373003: Clean up attributes of image elements (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: java/org/chromium/distiller/webdocument/WebImage.java
diff --git a/java/org/chromium/distiller/webdocument/WebImage.java b/java/org/chromium/distiller/webdocument/WebImage.java
index 491fdb73f9f07380e4d74d12c9d8061b7766754c..96da0df510ec75eddf1348201f3fca08e1516c0e 100644
--- a/java/org/chromium/distiller/webdocument/WebImage.java
+++ b/java/org/chromium/distiller/webdocument/WebImage.java
@@ -45,8 +45,14 @@ public class WebImage extends WebElement {
if (textOnly) return "";
Element container = Document.get().createDivElement();
ImageElement ie = ImageElement.as(Element.as(imgElement.cloneNode(false)));
+ ie.setSrc(ie.getSrc());
mdjones 2015/12/09 17:40:16 Instead of removing all the attributes manually, w
wychen 2015/12/09 22:27:53 Done.
DomUtil.makeSrcSetAbsolute(ie);
container.appendChild(ie);
+
+ DomUtil.stripIds(ie);
+ DomUtil.stripStyleAttributes(ie);
+ DomUtil.stripAlignAttributes(ie);
+
return container.getInnerHTML();
}

Powered by Google App Engine
This is Rietveld 408576698