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

Issue 747923004: webui: minimize webui flicker. (Closed)

Created:
6 years, 1 month ago by Dan Beam
Modified:
6 years ago
CC:
chromium-reviews, dbeam+watch-options_chromium.org, arv+watch_chromium.org, oshima+watch_chromium.org, Pat Meenan, jam, Charlie Reis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

webui: minimize webui flicker. Recently a CL landed in blink to allow rendering to start before synchronous script execution starts. This affects WebUI as it does a lot of processing in JavaScript to populate styles and text in our pages. This CL moves some reflow-causing styles to a new stylesheet named text_defaults.css which is dynamically processsed by the chrome://resources/ data handler to have the right fonts and text direction earlier in the page load (so pages don't flicker as much). chrome_shared.css automatically includes this new file, but to include it separately, do something like this in your page: <link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> I've also gone through and removed all the: <body i18n-content="fontFamily:fontfamily;fontSize:fontSize"> cruft for pages that already include chrome_shared.css (as this is now redundant). R=estade@chromium.org,davidben@chromium.org,kalman@chromium.org BUG=434974 Committed: https://crrev.com/41c9c724399008d33cb785ff2b4357bd99478b2a Cr-Commit-Position: refs/heads/master@{#305775}

Patch Set 1 #

Total comments: 5

Patch Set 2 : add text_defaults.css #

Patch Set 3 : merge #

Total comments: 6

Patch Set 4 : remove WebUITextStyles #

Patch Set 5 : creis@ + davidben@ review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -53 lines) Patch
M chrome/browser/resources/certificate_viewer.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/chromeos/bluetooth_pair_device.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/chromeos/certificate_manager_dialog.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/chromeos/proxy_settings.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/chromeos/set_time.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/downloads/downloads.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/extensions/extension_info.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/extensions/extensions.html View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/resources/help/help.html View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/resources/history/history.html View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/resources/history/history_mobile.css View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resources/local_discovery/local_discovery.html View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/resources/options/options.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/policy.html View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/resources/print_preview/print_preview.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/set_as_default_browser.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/uber/uber_frame.html View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/webui/shared_resources_data_source.h View 1 2 chunks +7 lines, -3 lines 0 comments Download
M content/browser/webui/shared_resources_data_source.cc View 1 2 3 4 3 chunks +31 lines, -5 lines 0 comments Download
M extensions/browser/renderer_startup_helper.cc View 1 2 1 chunk +3 lines, -7 lines 0 comments Download
M ui/base/webui/web_ui_util.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M ui/base/webui/web_ui_util.cc View 1 2 chunks +25 lines, -16 lines 0 comments Download
M ui/webui/resources/css/chrome_shared.css View 1 1 chunk +1 line, -0 lines 0 comments Download
A ui/webui/resources/css/text_defaults.css View 1 1 chunk +22 lines, -0 lines 0 comments Download
M ui/webui/resources/webui_resources.grd View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (6 generated)
Dan Beam
wdyt about these 2 ideas, Evan? https://codereview.chromium.org/747923004/diff/1/chrome/browser/ui/webui/options/options_ui.cc File chrome/browser/ui/webui/options/options_ui.cc (right): https://codereview.chromium.org/747923004/diff/1/chrome/browser/ui/webui/options/options_ui.cc#newcode185 chrome/browser/ui/webui/options/options_ui.cc:185: GetRawDataResource(IDR_OPTIONS_HTML).as_string()); this probably ...
6 years, 1 month ago (2014-11-22 04:27:12 UTC) #1
Dan Beam
well, 3 ideas I guess (font-size, :empty::after, pre-processing) +pmeenan@ as FYI
6 years, 1 month ago (2014-11-22 04:27:46 UTC) #2
Evan Stade
https://codereview.chromium.org/747923004/diff/1/ui/base/webui/web_ui_util.cc File ui/base/webui/web_ui_util.cc (right): https://codereview.chromium.org/747923004/diff/1/ui/base/webui/web_ui_util.cc#newcode56 ui/base/webui/web_ui_util.cc:56: } nit: // namespace https://codereview.chromium.org/747923004/diff/1/ui/webui/resources/css/chrome_shared.css File ui/webui/resources/css/chrome_shared.css (right): https://codereview.chromium.org/747923004/diff/1/ui/webui/resources/css/chrome_shared.css#newcode114 ...
6 years, 1 month ago (2014-11-22 05:14:44 UTC) #3
Dan Beam
https://codereview.chromium.org/747923004/diff/1/ui/webui/resources/css/widgets.css File ui/webui/resources/css/widgets.css (right): https://codereview.chromium.org/747923004/diff/1/ui/webui/resources/css/widgets.css#newcode15 ui/webui/resources/css/widgets.css:15: font-size: 75%; On 2014/11/22 05:14:44, Evan Stade wrote: > ...
6 years ago (2014-11-25 19:52:34 UTC) #5
Evan Stade
sweetness, lgtm
6 years ago (2014-11-25 20:33:55 UTC) #7
Dan Beam
+jam@ for content/ (see also: *content_client*)
6 years ago (2014-11-25 21:54:44 UTC) #9
Dan Beam
-jam@, +davidben@
6 years ago (2014-11-25 22:05:14 UTC) #11
davidben
https://codereview.chromium.org/747923004/diff/80001/content/public/common/content_client.h File content/public/common/content_client.h (right): https://codereview.chromium.org/747923004/diff/80001/content/public/common/content_client.h#newcode67 content/public/common/content_client.h:67: struct CONTENT_EXPORT WebUITextStyles { Should this be in its ...
6 years ago (2014-11-25 22:26:25 UTC) #12
davidben
https://codereview.chromium.org/747923004/diff/80001/content/browser/webui/shared_resources_data_source.cc File content/browser/webui/shared_resources_data_source.cc (right): https://codereview.chromium.org/747923004/diff/80001/content/browser/webui/shared_resources_data_source.cc#newcode84 content/browser/webui/shared_resources_data_source.cc:84: if (idr == IDR_WEBUI_CSS_TEXT_DEFAULTS) { It is also a ...
6 years ago (2014-11-25 22:29:34 UTC) #13
Dan Beam
https://codereview.chromium.org/747923004/diff/80001/content/browser/webui/shared_resources_data_source.cc File content/browser/webui/shared_resources_data_source.cc (right): https://codereview.chromium.org/747923004/diff/80001/content/browser/webui/shared_resources_data_source.cc#newcode84 content/browser/webui/shared_resources_data_source.cc:84: if (idr == IDR_WEBUI_CSS_TEXT_DEFAULTS) { On 2014/11/25 22:29:34, David ...
6 years ago (2014-11-25 22:49:31 UTC) #14
not at google - send to devlin
extensions lgtm. could you email or file a bug against me and mek@ to fix ...
6 years ago (2014-11-25 22:58:42 UTC) #16
Dan Beam
On 2014/11/25 22:58:42, kalman wrote: > extensions lgtm. could you email or file a bug ...
6 years ago (2014-11-25 23:10:16 UTC) #17
davidben
content lgtm (Uncertainty about the IDR/path thing aside, but we can sort that out when ...
6 years ago (2014-11-25 23:19:18 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/747923004/110001
6 years ago (2014-11-26 02:41:33 UTC) #20
commit-bot: I haz the power
Committed patchset #5 (id:110001)
6 years ago (2014-11-26 03:59:13 UTC) #21
commit-bot: I haz the power
6 years ago (2014-11-26 03:59:55 UTC) #22
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/41c9c724399008d33cb785ff2b4357bd99478b2a
Cr-Commit-Position: refs/heads/master@{#305775}

Powered by Google App Engine
This is Rietveld 408576698