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

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: add todos 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
« no previous file with comments | « java/org/chromium/distiller/DomUtil.java ('k') | java/org/chromium/distiller/webdocument/WebText.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cd68677d66f4df0428de73727cf2d460f5572940 100644
--- a/java/org/chromium/distiller/webdocument/WebImage.java
+++ b/java/org/chromium/distiller/webdocument/WebImage.java
@@ -43,9 +43,13 @@ public class WebImage extends WebElement {
@Override
public String generateOutput(boolean textOnly) {
if (textOnly) return "";
- Element container = Document.get().createDivElement();
+
ImageElement ie = ImageElement.as(Element.as(imgElement.cloneNode(false)));
+ ie.setSrc(ie.getSrc());
DomUtil.makeSrcSetAbsolute(ie);
+ DomUtil.stripImageElement(ie);
+
+ Element container = Document.get().createDivElement();
container.appendChild(ie);
return container.getInnerHTML();
}
« no previous file with comments | « java/org/chromium/distiller/DomUtil.java ('k') | java/org/chromium/distiller/webdocument/WebText.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698