Commit 9f258c65 authored by dpapad's avatar dpapad Committed by Commit Bot

Fix web_dev_style violations in DOM Distiller.

This is in preparation of turning on such PRESUBMIT checks for src/components.

Bug: 1019312
Change-Id: Iefc41c84b6bba151e8eb6961871fa9cbf596e44e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900250
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarEric Noyau <noyau@chromium.org>
Reviewed-by: default avatarBen Greenstein <bengr@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713108}
parent 673eb7ed
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// On iOS, |distiller_on_ios| was set to true before this script.
var distiller_on_ios;
if (typeof distiller_on_ios === 'undefined') {
distiller_on_ios = false;
// On iOS, |distillerOnIos| was set to true before this script.
var distillerOnIos;
if (typeof distillerOnIos === 'undefined') {
distillerOnIos = false;
}
function addToPage(html) {
......@@ -126,7 +126,7 @@ function maybeSetWebFont() {
// fetched, which can take a long time on slow networks.
// In Blink, it times out after 3 seconds and uses fallback fonts.
// See crbug.com/711650
if (distiller_on_ios) {
if (distillerOnIos) {
return;
}
......
......@@ -8,11 +8,8 @@
try {
function initialize() {
// This include will be processed at build time by grit.
// Note: this <include> is not behind a single-line comment because the
// first line of the file is source code (so the first line would be
// skipped) instead of a licence header.
// clang-format off
<include src="../../../../third_party/dom_distiller_js/dist/js/domdistiller.js"/>
// <include src="../../../../third_party/dom_distiller_js/dist/js/domdistiller.js">
// clang-format on
}
window.setTimeout = function() {};
......@@ -30,8 +27,9 @@ try {
return res;
} catch (e) {
window.console.error('Error during distillation: ' + e);
if (e.stack != undefined)
if (e.stack != undefined) {
window.console.error(e.stack);
}
}
return undefined;
})($$OPTIONS, $$STRINGIFY)
})($$OPTIONS, $$STRINGIFY);
......@@ -81,7 +81,7 @@ void DistillerViewer::OnArticleReady(
std::string html_and_script(html);
html_and_script +=
"<script> distiller_on_ios = true; " + js_buffer_ + "</script>";
"<script> distillerOnIos = true; " + js_buffer_ + "</script>";
callback_.Run(url_, html_and_script, images, article_proto->title());
} else {
callback_.Run(url_, std::string(), {}, std::string());
......
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