|
|
Created:
6 years, 3 months ago by joleksy Modified:
5 years, 3 months ago Reviewers:
Peter Lundblad, Elliot Glaysher, eseidel, dmazzoni, jln (very slow on Chromium), jochen (gone - plz use gerrit) CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, nasko+codewatch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionAllow default font size changing on Linux.
Currently base rendering font size on Linux is hardcoded to 16.0 with no possibility of changing it. This patch add such possibility in RendererPreferences.
Webkit part: https://codereview.chromium.org/570243002/
BUG=
Committed: https://crrev.com/f0bc1a926d8f0326ef38b8374e42bc8e244dd2ba
Cr-Commit-Position: refs/heads/master@{#344746}
Patch Set 1 #
Total comments: 1
Patch Set 2 : CHECK font size. #Patch Set 3 : Use PlatformFont::CreateDefault() for default font size. #Patch Set 4 : Rebase #Patch Set 5 : Remove CHECKs #
Total comments: 1
Patch Set 6 : Add braces. #Patch Set 7 : Remove failing test. #Patch Set 8 : Disabled test instead of removing. #Patch Set 9 : Rebase #Patch Set 10 : Win compile fix. #
Messages
Total messages: 67 (22 generated)
joleksy@opera.com changed reviewers: + jln@chromium.org
@reviewer: does it look ok to you?
I am not a good reviewer for this. You would probably want to add a reviewer for content/
joleksy@opera.com changed reviewers: + jamesr@chromium.org
On 2014/09/11 20:40:12, jln wrote: > I am not a good reviewer for this. You would probably want to add a reviewer for > content/ Sorry for this, it was a suggesting from git cl upload. Adding jamesr@chromium.org.
jamesr@chromium.org changed reviewers: - jamesr@chromium.org
I'm not a content/ reviewer either.
joleksy@opera.com changed reviewers: + jochen@chromium.org
On 2014/09/13 00:55:46, jamesr wrote: > I'm not a content/ reviewer either. I am not giving up, added jochen.
lgtm still needs an IPC review
https://chromiumcodereview.appspot.com/549303004/diff/1/content/renderer/rend... File content/renderer/render_view_linux.cc (right): https://chromiumcodereview.appspot.com/549303004/diff/1/content/renderer/rend... content/renderer/render_view_linux.cc:94: WebFontRendering::setDefaultFontSize(prefs.default_font_size); Could you add some basic sanity-checking on the font size here before passing it to WebFontRenderering? (Maybe checking that it's between 0 and 1000 for instance).
wait, can you explain how this interacts with WebSettings::setDefaultFontSize()? can we avoid the duplication somehow? maybe address https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit... instead of adding this?
On 2014/09/16 14:51:24, jochen wrote: > wait, can you explain how this interacts with WebSettings::setDefaultFontSize()? > > can we avoid the duplication somehow? > > maybe address > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit... > instead of adding this? WebSettings::setDefaultFontSize() relates to WebPreferences (see content/public/common/web_preferences.h), while WebFontRendering::setDefaultFontSize() relates to RendererPreferences (see content/public/common/renderer_preferences.h). In the comment for RendererPreferences: "A struct for managing browser's settings that apply to the renderer or its webview. These differ from WebPreferences since they apply to Chromium's glue layer rather than applying to just WebKit." My understanding is that RendererPreferences::default_font_size is used globally for calculating size of render fonts (like font:menu in css). I am not sure what WebPreferences::default_font_size applies to, but I would guess that this is used for the font that is set by the webpage (like basefont in HTML file). Note: it looks like RenderThemeChromiumSkia::setDefaultFontSize() is not used at all.
On 2014/09/17 at 07:17:20, joleksy wrote: > On 2014/09/16 14:51:24, jochen wrote: > > wait, can you explain how this interacts with WebSettings::setDefaultFontSize()? > > > > can we avoid the duplication somehow? > > > > maybe address > > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit... > > instead of adding this? > > WebSettings::setDefaultFontSize() relates to WebPreferences (see content/public/common/web_preferences.h), while WebFontRendering::setDefaultFontSize() relates to RendererPreferences (see content/public/common/renderer_preferences.h). > > In the comment for RendererPreferences: > "A struct for managing browser's settings that apply to the renderer or its webview. These differ from WebPreferences since they apply to Chromium's glue layer rather than applying to just WebKit." > > My understanding is that RendererPreferences::default_font_size is used globally for calculating size of render fonts (like font:menu in css). > I am not sure what WebPreferences::default_font_size applies to, but I would guess that this is used for the font that is set by the webpage (like basefont in HTML file). > > > Note: it looks like RenderThemeChromiumSkia::setDefaultFontSize() is not used at all. we don't really have a glue layer anymore. i don't really know how the font:menu stuff is handled, can you please find a reviewer familiar with how this is handled typically, we modify css defaults by directly editing the default stylesheet. i'll gladly approve the content changes once a css reviewer confirmed that this is the way to go. It will help if you could explain what the usecase for this method is
On 2014/09/17 14:53:52, jochen wrote: > On 2014/09/17 at 07:17:20, joleksy wrote: > > On 2014/09/16 14:51:24, jochen wrote: > > > wait, can you explain how this interacts with > WebSettings::setDefaultFontSize()? > > > > > > can we avoid the duplication somehow? > > > > > > maybe address > > > > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit... > > > instead of adding this? > > > > WebSettings::setDefaultFontSize() relates to WebPreferences (see > content/public/common/web_preferences.h), while > WebFontRendering::setDefaultFontSize() relates to RendererPreferences (see > content/public/common/renderer_preferences.h). > > > > In the comment for RendererPreferences: > > "A struct for managing browser's settings that apply to the renderer or its > webview. These differ from WebPreferences since they apply to Chromium's glue > layer rather than applying to just WebKit." > > > > My understanding is that RendererPreferences::default_font_size is used > globally for calculating size of render fonts (like font:menu in css). > > I am not sure what WebPreferences::default_font_size applies to, but I would > guess that this is used for the font that is set by the webpage (like basefont > in HTML file). > > > > > > Note: it looks like RenderThemeChromiumSkia::setDefaultFontSize() is not used > at all. > > we don't really have a glue layer anymore. > > i don't really know how the font:menu stuff is handled, can you please find a > reviewer familiar with how this is handled > > typically, we modify css defaults by directly editing the default stylesheet. > > i'll gladly approve the content changes once a css reviewer confirmed that this > is the way to go. It will help if you could explain what the usecase for this > method is font:menu is set in void RenderThemeChromiumFontProvider::systemFont(CSSValueID valueID, FontDescription& fontDescription), it is defined in RenderThemeChromiumFontProviderLinux.cpp and RenderThemeChromiumFontProviderWin.cpp. For Windows font size is being read from the system (see e.g. case CSSValueMenu in the switch), for Linux it is just hardcoded to 16 (and I did not find any place where it can be changed). Usecase: changing the font size globally:-)
joleksy@opera.com changed reviewers: + eseidel@chromium.org
jochen@chromium.org changed reviewers: + erg@chromium.org
+erg ah, makes sense. Elliot, is there a way to figure out the default font size on linux? joleksy@, can you add the code that sets this preference to this patch?
On 2014/09/18 18:31:02, jochen wrote: > +erg > > ah, makes sense. > > Elliot, is there a way to figure out the default font size on linux? > > joleksy@, can you add the code that sets this preference to this patch? I don't know what you mean by default font size. If you mean what the user has set as their font description, you can get that through LinuxFontDelegate::GetDefaultPangoFontDescription().
On 2014/09/18 19:05:42, Elliot Glaysher wrote: > On 2014/09/18 18:31:02, jochen wrote: > > +erg > > > > ah, makes sense. > > > > Elliot, is there a way to figure out the default font size on linux? > > > > joleksy@, can you add the code that sets this preference to this patch? > > I don't know what you mean by default font size. If you mean what the user has > set as their font description, you can get that through > LinuxFontDelegate::GetDefaultPangoFontDescription(). Any progress an this one?
I didn't realize you had uploaded a new patchset version. lgtm
The CQ bit was checked by joleksy@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/549303004/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu/builds/65309) win_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu/builds/70177) android_aosp on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_aosp/bu...) android_arm64_dbg_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_arm64_d...) android_chromium_gn_compile_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromiu...) android_chromium_gn_compile_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromiu...) android_clang_dbg_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_clang_d...) android_dbg_tests_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_tes...) chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_gn_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_gn_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) win8_chromium_rel on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_rel...) win_chromium_compile_dbg on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...) win_chromium_rel_swarming on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...) win_chromium_x64_rel_swarming on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
Needs to be rebased, but anyway cannot be integrated before Webkit part (https://codereview.chromium.org/570243002/).
The CQ bit was checked by joleksy@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/549303004/60001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
On 2014/10/08 06:30:16, I haz the power (commit-bot) wrote: > Try jobs failed on following builders: > chromium_presubmit on tryserver.chromium.linux > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) The error: Missing LGTM from an OWNER for these files: content/common/view_messages.h @jln: could you take a look?
On 2014/10/08 at 06:34:40, joleksy wrote: > On 2014/10/08 06:30:16, I haz the power (commit-bot) wrote: > > Try jobs failed on following builders: > > chromium_presubmit on tryserver.chromium.linux > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) > > The error: Missing LGTM from an OWNER for these files: content/common/view_messages.h > > @jln: could you take a look? since you have to wait for jln anyway maybe the two CHECKS are a bit overkill, since the IPC is coming from the browser what about just ignoring the setting if it's outside of the acceptable range?
On 2014/10/08 14:58:00, jochen wrote: > maybe the two CHECKS are a bit overkill, since the IPC is coming from the > browser > > what about just ignoring the setting if it's outside of the acceptable range? lgtm for content/common/view_messages.h. Feel free to ignore if outside of acceptable range instead of CHECK, but please make sure there is a range check in place even in release mode.
On 2014/10/08 17:20:36, jln wrote: > On 2014/10/08 14:58:00, jochen wrote: > > > maybe the two CHECKS are a bit overkill, since the IPC is coming from the > > browser > > > > what about just ignoring the setting if it's outside of the acceptable range? > > lgtm for content/common/view_messages.h. > Feel free to ignore if outside of acceptable range instead of CHECK, but please > make sure there is a range check in place even in release mode. Removed CHECKs, sorry for the delay.
lgtm https://codereview.chromium.org/549303004/diff/80001/content/renderer/render_... File content/renderer/render_view_linux.cc (right): https://codereview.chromium.org/549303004/diff/80001/content/renderer/render_... content/renderer/render_view_linux.cc:96: prefs.default_font_size <= kMaxDefaultFontSize) nit add { }
The CQ bit was checked by joleksy@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/549303004/100001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
On 2014/10/16 11:06:22, I haz the power (commit-bot) wrote: > Try jobs failed on following builders: > linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux > (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) There is a failure in a test CvoxShadowUnitTest.MultilineWrap. This test seems to be making some assumptions of how the text in a textarea is split into lines (i.e. it assumes that each word in "One two thr fou fiv six sev eig" will go into separate row). Now with the font size no longer hardcoded, we can easily end up with it being very small (on my system it defaults to 23px now, if I set it manually to 10px I get 4 rows in the test) or very large. I am not sure how it should be fixed. One quick "fix" - if we know the configuration of test server - may be to use longer or shorter strings. Alternative is to make the test aware of the issue and adjust itself appropriately (but how?). Any suggestions?
On 2014/10/16 12:48:54, joleksy wrote: > On 2014/10/16 11:06:22, I haz the power (commit-bot) wrote: > > Try jobs failed on following builders: > > linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > > There is a failure in a test CvoxShadowUnitTest.MultilineWrap. > > This test seems to be making some assumptions of how the text in a textarea is > split into lines (i.e. it assumes that each word in "One two thr fou fiv six sev > eig" will go into separate row). > > Now with the font size no longer hardcoded, we can easily end up with it being > very small (on my system it defaults to 23px now, if I set it manually to 10px I > get 4 rows in the test) or very large. > > I am not sure how it should be fixed. One quick "fix" - if we know the > configuration of test server - may be to use longer or shorter strings. > > Alternative is to make the test aware of the issue and adjust itself > appropriately (but how?). > > Any suggestions? My immediate suggestion is to just disable the test. I'm not convinced that relying on specific font sizing behaviour is valid, though you should get the person who wrote the test on the review.
joleksy@opera.com changed reviewers: + dmazzoni@chromium.org
On 2014/10/16 17:42:18, Elliot Glaysher wrote: > On 2014/10/16 12:48:54, joleksy wrote: > > On 2014/10/16 11:06:22, I haz the power (commit-bot) wrote: > > > Try jobs failed on following builders: > > > linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux > > > > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > > > > There is a failure in a test CvoxShadowUnitTest.MultilineWrap. > > > > This test seems to be making some assumptions of how the text in a textarea is > > split into lines (i.e. it assumes that each word in "One two thr fou fiv six > sev > > eig" will go into separate row). > > > > Now with the font size no longer hardcoded, we can easily end up with it being > > very small (on my system it defaults to 23px now, if I set it manually to 10px > I > > get 4 rows in the test) or very large. > > > > I am not sure how it should be fixed. One quick "fix" - if we know the > > configuration of test server - may be to use longer or shorter strings. > > > > Alternative is to make the test aware of the issue and adjust itself > > appropriately (but how?). > > > > Any suggestions? > > My immediate suggestion is to just disable the test. I'm not convinced that > relying on specific font sizing behaviour is valid, though you should get the > person who wrote the test on the review. Added the author. @dmazzoni: is it ok to remove the test?
joleksy@opera.com changed reviewers: + plundblad@chromium.org
On 2014/10/17 06:31:06, joleksy wrote: > On 2014/10/16 17:42:18, Elliot Glaysher wrote: > > On 2014/10/16 12:48:54, joleksy wrote: > > > On 2014/10/16 11:06:22, I haz the power (commit-bot) wrote: > > > > Try jobs failed on following builders: > > > > linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux > > > > > > > > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > > > > > > There is a failure in a test CvoxShadowUnitTest.MultilineWrap. > > > > > > This test seems to be making some assumptions of how the text in a textarea > is > > > split into lines (i.e. it assumes that each word in "One two thr fou fiv six > > sev > > > eig" will go into separate row). > > > > > > Now with the font size no longer hardcoded, we can easily end up with it > being > > > very small (on my system it defaults to 23px now, if I set it manually to > 10px > > I > > > get 4 rows in the test) or very large. > > > > > > I am not sure how it should be fixed. One quick "fix" - if we know the > > > configuration of test server - may be to use longer or shorter strings. > > > > > > Alternative is to make the test aware of the issue and adjust itself > > > appropriately (but how?). > > > > > > Any suggestions? > > > > My immediate suggestion is to just disable the test. I'm not convinced that > > relying on specific font sizing behaviour is valid, though you should get the > > person who wrote the test on the review. > > Added the author. > > @dmazzoni: is it ok to remove the test? The tests were added here: https://codereview.chromium.org/298653011 @dmazzoni, @plundblad: is it ok to remove the test?
> The tests were added here: https://codereview.chromium.org/298653011 > > @dmazzoni, @plundblad: is it ok to remove the test? OK to delete the test. It's probably possible to get it to work with an explicit font size or for sure with some javascript to detect the font size and set the width appropriately, but don't worry about it. Luckily we're planning to retire the function this is testing later this year and I doubt we'll change it before then.
On 2015/02/23 16:49:49, dmazzoni wrote: > > The tests were added here: https://codereview.chromium.org/298653011 > > > > @dmazzoni, @plundblad: is it ok to remove the test? > > OK to delete the test. It's probably possible to get it to work with an explicit > font size or for sure with some javascript to detect the font size and set the > width appropriately, but don't worry about it. Luckily we're planning to retire > the function this is testing later this year and I doubt we'll change it before > then. Removed test in patch set 7.
On 2015/02/24 07:50:26, joleksy wrote: > On 2015/02/23 16:49:49, dmazzoni wrote: > > > The tests were added here: https://codereview.chromium.org/298653011 > > > > > > @dmazzoni, @plundblad: is it ok to remove the test? > > > > OK to delete the test. It's probably possible to get it to work with an > explicit > > font size or for sure with some javascript to detect the font size and set the > > width appropriately, but don't worry about it. Luckily we're planning to > retire > > the function this is testing later this year and I doubt we'll change it > before > > then. > > Removed test in patch set 7. Can you please disable the test instead of removing it?
On 2015/03/16 11:43:35, Peter Lundblad wrote: > Can you please disable the test instead of removing it? Done.
lgtm
The CQ bit was checked by joleksy@opera.com
The patchset sent to the CQ was uploaded after l-g-t-m from jochen@chromium.org, jln@chromium.org Link to the patchset: https://codereview.chromium.org/549303004/#ps140001 (title: "Disabled test instead of removing.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/549303004/140001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ni...) mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...) (exceeded global retry quota)
The CQ bit was checked by joleksy@opera.com
The patchset sent to the CQ was uploaded after l-g-t-m from jochen@chromium.org, erg@chromium.org, jln@chromium.org Link to the patchset: https://codereview.chromium.org/549303004/#ps160001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/549303004/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/549303004/160001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/...)
The CQ bit was checked by joleksy@opera.com
The patchset sent to the CQ was uploaded after l-g-t-m from jochen@chromium.org, erg@chromium.org, jln@chromium.org Link to the patchset: https://codereview.chromium.org/549303004/#ps180001 (title: "Win compile fix.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/549303004/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/549303004/180001
Message was sent while issue was closed.
Committed patchset #10 (id:180001)
Message was sent while issue was closed.
Patchset 10 (id:??) landed as https://crrev.com/f0bc1a926d8f0326ef38b8374e42bc8e244dd2ba Cr-Commit-Position: refs/heads/master@{#344746}
Message was sent while issue was closed.
On 2015/08/21 13:11:00, commit-bot: I haz the power wrote: > Patchset 10 (id:??) landed as > https://crrev.com/f0bc1a926d8f0326ef38b8374e42bc8e244dd2ba > Cr-Commit-Position: refs/heads/master@{#344746} Looks like this triggered a regression: https://code.google.com/p/chromium/issues/detail?id=525176
Message was sent while issue was closed.
A revert of this CL (patchset #10 id:180001) has been created in https://codereview.chromium.org/1319613004/ by kochi@chromium.org. The reason for reverting is: This caused a regression: https://code.google.com/p/chromium/issues/detail?id=525176. |