Commit 797a3802 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Eliminate NOSCRIPT element from TranslateHelper text dump

TranslateHelper uses a sample of the page text to determine the page
language. This patch eliminates content of NOSCRIPT elements from the
text dump, so that non-text contents in NOSCRIPT elements are not passed
to TranslateHelper.

Bug: 813009
Change-Id: Icf1781a69d17538103574bd149cb3d5851852a08
Reviewed-on: https://chromium-review.googlesource.com/924111Reviewed-by: default avatarRachel Blum <groby@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537557}
parent 1a4f08ce
...@@ -159,7 +159,8 @@ class InnerTextDumper final { ...@@ -159,7 +159,8 @@ class InnerTextDumper final {
}; };
bool TextContentDumperIgnoresElement(const Element& element) { bool TextContentDumperIgnoresElement(const Element& element) {
return IsHTMLStyleElement(element) || IsHTMLScriptElement(element); return IsHTMLStyleElement(element) || IsHTMLScriptElement(element) ||
IsHTMLNoScriptElement(element);
} }
bool IsWhiteSpace(UChar ch) { bool IsWhiteSpace(UChar ch) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment