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

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

Issue 2750973002: Make sure lazily-loaded images have absolute URL (Closed)
Patch Set: Created 3 years, 9 months 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 | « no previous file | javatests/org/chromium/distiller/EmbedExtractorTest.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 b1f8f7dbc2a36c98f4b48345eacf3d25763bb96f..456e4633549a45c8f1835370849b33fce18bfd90 100644
--- a/java/org/chromium/distiller/webdocument/WebImage.java
+++ b/java/org/chromium/distiller/webdocument/WebImage.java
@@ -19,7 +19,7 @@ import java.util.List;
public class WebImage extends WebElement {
// The main image element. Could be <img>, or <picture> containing <img>.
Element imgElement;
- // The absolute source of the image.
+ // The source of the image. Could be relative before cloneAndProcessNode().
private String srcUrl;
// The original width of the image in pixels.
private int width;
@@ -54,6 +54,7 @@ public class WebImage extends WebElement {
DomUtil.getFirstElementByTagNameInc(cloned, "IMG"));
if (!srcUrl.isEmpty()) {
ie.setSrc(srcUrl);
+ srcUrl = ie.getSrc();
}
// If computed width or height is zero, do not override them
// to keep them visible.
« no previous file with comments | « no previous file | javatests/org/chromium/distiller/EmbedExtractorTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698