Commit 2409ec43 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Chromium LUCI CQ

Files app: Fix broken images when running as JS Modules.

When running as non-js-modules the <bread-crumb> has its images in-lined
by grit, however when running as JS modules the <bread-crumb> is
in-lined via rollup, then it runs from the path foreground/js/ instead
of its actual path foreground/js/ui/ making the relative address to its
images incompatible.  Fix by duplicating the 2 affected images, moving
them up 1 directory so the relative path is consistent.

NOTE: These 2 images are the only references to "/images" inside the ui/
directory. [1]

[1] - https://source.chromium.org/search?q=%22images%2F%22&sq=&ss=chromium%2Fchromium%2Fsrc:ui%2Ffile_manager%2Ffile_manager%2Fforeground%2Fjs%2Fui%2F

Bug: 1133186
Change-Id: I71a10286c325e54c3adecc0f079002aeab7a0344
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2640006Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845547}
parent 5918ed44
......@@ -403,6 +403,10 @@ generate_grd("build_grd") {
"image_loader/background.m.rollup.js",
# Fix broken images:
"file_manager/images/files/ui/arrow_right.svg",
"file_manager/images/files/ui/menu_ng.svg",
"file_manager/background/js/main_background.m.rollup.js",
"file_manager/foreground/elements/files_icon_button.m.js",
"file_manager/foreground/elements/files_ripple.m.js",
......@@ -441,6 +445,7 @@ generate_grd("build_grd") {
"//ui/file_manager/audio_player/js:build",
"//ui/file_manager/audio_player/js:build_background",
"//ui/file_manager/audio_player/js:build_worker",
"//ui/file_manager/file_manager:fix_broken_images",
"//ui/file_manager/file_manager/background/js:build",
"//ui/file_manager/file_manager/foreground/elements:elements",
"//ui/file_manager/file_manager/foreground/js:build",
......
......@@ -22,6 +22,15 @@ action("gen_main_html") {
]
}
# TODO: Remove this file copy when breadcrumb.js supports only JS modules.
copy("fix_broken_images") {
sources = [
"foreground/images/files/ui/arrow_right.svg",
"foreground/images/files/ui/menu_ng.svg",
]
outputs = [ "$target_gen_dir/images/files/ui/{{source_file_part}}" ]
}
generated_static_grdp = "$target_gen_dir/static_resources.grdp"
generate_grd("build_static_grdp") {
......
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