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

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

Issue 2285133003: Use .innerText in text-only mode (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: Created 4 years, 4 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
Index: java/org/chromium/distiller/webdocument/WebText.java
diff --git a/java/org/chromium/distiller/webdocument/WebText.java b/java/org/chromium/distiller/webdocument/WebText.java
index 18c7856c4c0bd20aea98ca9d5272473bf6964632..95827fb58e5a9502221ec6b0c87446bcdd24928e 100644
--- a/java/org/chromium/distiller/webdocument/WebText.java
+++ b/java/org/chromium/distiller/webdocument/WebText.java
@@ -142,9 +142,7 @@ public class WebText extends WebElement {
// get the innerHTML, otherwise these tags would be duplicated.
Element elementClonedRoot = Element.as(clonedRoot);
if (textOnly) {
- // TODO(wychen): .textContent should be identical to .innerText
- // in our use cases, but needs verification.
- return DomUtil.javascriptTextContent(elementClonedRoot);
+ return DomUtil.getInnerText(elementClonedRoot);
} else if (WebTag.canBeNested(elementClonedRoot.getTagName())) {
return elementClonedRoot.getInnerHTML();
}
« no previous file with comments | « java/org/chromium/distiller/webdocument/WebFigure.java ('k') | javatests/org/chromium/distiller/EmbedExtractorTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698