New issue
Advanced search Search tips

Issue 717620 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Print preview: Compile JS with Closure compiler

Project Member Reported by dpa...@chromium.org, May 2 2017

Issue description

There is currently a compiled_resources.gyp file at [1], which does not seem to be referenced anywhere, and therefore I don't think print preview's JS code is being type checked. The file at [1] also follows the older gyp format, see example of the newer format at [2]


[1] https://cs.chromium.org/chromium/src/chrome/browser/resources/print_preview/compiled_resources.gyp
[2] https://cs.chromium.org/chromium/src/chrome/browser/resources/md_downloads/compiled_resources2.gyp

dbeam@ mentioned that there might be an older CL that attempted to add compilation for print preview but was never landed. Either way, I think it would be an improvement to start type checking PP code as we start making more changes to it.
 
Owner: dpa...@chromium.org
Status: Assigned (was: Available)
Thanks for the links. I'll start by:

 - migrating print_preview/compiled_resources.gyp to compiled_resources2.gyp format 
 - adding it to the list at [1] locally
 - See how many errors/warnings we currently get.

and go from there.

[1] https://cs.chromium.org/chromium/src/third_party/closure_compiler/compiled_resources2.gyp?l=14
Currently I am getting 278 errors and 2 warnings (see attachment too). If someone wants to help, here are some instructions

1) Un-comment the line at 
   https://cs.chromium.org/chromium/src/third_party/closure_compiler/compiled_resources2.gyp?l=35,36
2) Execute the following command to compile only print preview
   ./third_party/closure_compiler/run_compiler print_preview
3) Perhaps mention on this bug which errors (files or folders)
   you are fixing to avoid multiple people working on the same errors.
4) Look at the "unlanded" CLs mentioned by dbeam@ at comment #1 for help. 
errors.txt
101 KB View Download
I will start working on the errors from the print_preview/settings folder, since I've changed/added a lot of things in there recently.
Project Member

Comment 6 by bugdroid1@chromium.org, May 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63120f6b07e2315545b80732bb94aa1930ae58cb

commit 63120f6b07e2315545b80732bb94aa1930ae58cb
Author: rbpotter <rbpotter@chromium.org>
Date: Thu May 04 20:44:24 2017

Fix the print preview closure compiler errors from files in
chrome/browser/resources/print_preview/settings/*

After this CL, there are 2 warnings and 222 errors when
running the closure compiler.

BUG= 717620 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2861713004
Cr-Commit-Position: refs/heads/master@{#469456}

[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/common/overlay.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/data/print_ticket_store.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/data/ticket_items/header_footer.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/data/ticket_items/landscape.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/data/ticket_items/margins_type.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/data/ticket_items/media_size.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/native_layer.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/preview_generator.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/previewarea/margin_control_container.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/advanced_options_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/color_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/copies_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/destination_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/dpi_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/layout_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/margin_settings.html
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/margin_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/media_size_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/more_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/other_options_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/page_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/scaling_settings.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/settings_section.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/browser/resources/print_preview/settings/settings_section_select.js
[modify] https://crrev.com/63120f6b07e2315545b80732bb94aa1930ae58cb/chrome/test/data/webui/print_preview.js

Working on the data/ folder now (ticket items/app state/etc)
Project Member

Comment 8 by bugdroid1@chromium.org, May 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/04bee6a1d135e6665c04d1e748cf7baeb6769788

commit 04bee6a1d135e6665c04d1e748cf7baeb6769788
Author: rbpotter <rbpotter@chromium.org>
Date: Fri May 05 01:22:12 2017

Print Preview: Make getChildElement return required HTMLElement

In most locations callers assumed the function returned !HTMLElement
already. Changed the one location (in advanced_settings.js line 177)
that did not assume this to not call the function, and changed
getChildElement to return !HTMLElement.

Also removed some asserts that are no longer necessary.

This CL reduces print preview closure compiler errors to 180.

BUG= 717620 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2857983007
Cr-Commit-Position: refs/heads/master@{#469564}

[modify] https://crrev.com/04bee6a1d135e6665c04d1e748cf7baeb6769788/chrome/browser/resources/print_preview/component.js
[modify] https://crrev.com/04bee6a1d135e6665c04d1e748cf7baeb6769788/chrome/browser/resources/print_preview/settings/advanced_options_settings.js
[modify] https://crrev.com/04bee6a1d135e6665c04d1e748cf7baeb6769788/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.js
[modify] https://crrev.com/04bee6a1d135e6665c04d1e748cf7baeb6769788/chrome/browser/resources/print_preview/settings/color_settings.js
[modify] https://crrev.com/04bee6a1d135e6665c04d1e748cf7baeb6769788/chrome/browser/resources/print_preview/settings/copies_settings.js
[modify] https://crrev.com/04bee6a1d135e6665c04d1e748cf7baeb6769788/chrome/browser/resources/print_preview/settings/destination_settings.js
[modify] https://crrev.com/04bee6a1d135e6665c04d1e748cf7baeb6769788/chrome/browser/resources/print_preview/settings/layout_settings.js

Cc: -rbpotter@chromium.org
Owner: rbpotter@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 10 by bugdroid1@chromium.org, May 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4356478ea0f780d9aaebefad24439437bc7b13e

commit d4356478ea0f780d9aaebefad24439437bc7b13e
Author: rbpotter <rbpotter@chromium.org>
Date: Mon May 08 20:43:57 2017

Print Preview: Fix data/ errors

Fix closure compiler errors in data/ directory of print_preview.

Reduces print preview closure compiler errors to 91, and eliminates
all remaining warnings.

BUG= 717620 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2862203002
Cr-Commit-Position: refs/heads/master@{#470114}

[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/cloud_print_interface.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/app_state.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/capabilities_holder.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/cloud_parsers.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/coordinate2d.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/destination.js
[add] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/destination_match.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/destination_store.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/document_info.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/invitation.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/invitation_store.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/local_parsers.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/margins.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/measurement_system.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/page_number_set.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/print_ticket_store.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/printable_area.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/size.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/collate.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/color.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/copies.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/css_background.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/custom_margins.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/dpi.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/duplex.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/fit_to_page.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/header_footer.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/landscape.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/margins_type.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/media_size.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/page_range.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/rasterize.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/scaling.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/selection_only.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/ticket_items/vendor_items.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/data/user_info.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/native_layer.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/preview_generator.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/previewarea/margin_control.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/previewarea/margin_control_container.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/print_preview.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/print_preview_utils.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/search/destination_list_item.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/search/destination_search.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/browser/resources/print_preview/search/provisional_destination_resolver.js
[modify] https://crrev.com/d4356478ea0f780d9aaebefad24439437bc7b13e/chrome/test/data/webui/print_preview_destination_search_test.js

Project Member

Comment 11 by bugdroid1@chromium.org, May 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/881669afc5906b5190097dd5f8108465b238ea25

commit 881669afc5906b5190097dd5f8108465b238ea25
Author: rbpotter <rbpotter@chromium.org>
Date: Tue May 09 20:19:04 2017

Print Preview: Fix top level directory compile errors

Fix closure compile errors for the print_preview/ top level directory.

Also fix linter errors.

Reduces closure compiler errors to 50.

BUG= 717620 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2863183004
Cr-Commit-Position: refs/heads/master@{#470413}

[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/cloud_print_interface.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/common/overlay.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/common/search_box.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/component.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/data/destination_store.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/data/invitation_store.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/metrics.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/native_layer.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/preview_generator.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/previewarea/preview_area.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/print_header.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/print_preview.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/print_preview_animations.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/print_preview_focus_manager.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/browser/resources/print_preview/print_preview_utils.js
[modify] https://crrev.com/881669afc5906b5190097dd5f8108465b238ea25/chrome/test/data/webui/print_preview.js

Project Member

Comment 12 by bugdroid1@chromium.org, May 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/419bda2ce75c18c90e66fae1d03fdd1e5479ce04

commit 419bda2ce75c18c90e66fae1d03fdd1e5479ce04
Author: rbpotter <rbpotter@chromium.org>
Date: Wed May 10 19:51:07 2017

Fix all remaining print preview closure compiler errors

BUG= 717620 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2865633004
Cr-Commit-Position: refs/heads/master@{#470677}

[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/pdf/pdf_scripting_api.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/data/destination_store.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/preview_generator.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/previewarea/margin_control.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/previewarea/margin_control_container.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/previewarea/preview_area.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/print_preview.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/search/cloud_destination_list.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/search/destination_list.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/search/destination_list_item.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/search/destination_search.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/search/provisional_destination_resolver.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/search/recent_destination_list.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/settings/destination_settings.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/chrome/browser/resources/print_preview/settings/more_settings.js
[modify] https://crrev.com/419bda2ce75c18c90e66fae1d03fdd1e5479ce04/third_party/closure_compiler/compiled_resources2.gyp

Fixed?
Status: Fixed (was: Started)

Sign in to add a comment