Bug 143590 - Minimum font size pref breaks SVG text very badly
Summary: Minimum font size pref breaks SVG text very badly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-09 17:10 PDT by Said Abou-Hallawa
Modified: 2015-04-17 10:37 PDT (History)
3 users (show)

See Also:


Attachments
test case (253 bytes, image/svg+xml)
2015-04-09 17:10 PDT, Said Abou-Hallawa
no flags Details
Patch (8.96 KB, patch)
2015-04-09 18:13 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (9.33 KB, patch)
2015-04-15 18:04 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2015-04-09 17:10:39 PDT
Created attachment 250488 [details]
test case

Open the attached test case in Safari. Enable the "Never use font sizes smaller than:" pref in Safari preferences.

Result: The text is displayed with a very big font. Other examples are http://dbaron.org/log/20110225-blur-radius and http://orbis.stanford.edu. WebKit renders the text of these websites very badly if this perf is enabled.
Comment 1 Said Abou-Hallawa 2015-04-09 18:13:26 PDT
Created attachment 250492 [details]
Patch
Comment 2 Simon Fraser (smfr) 2015-04-15 12:01:34 PDT
Comment on attachment 250492 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250492&action=review

> Source/WebCore/style/StyleFontSizeFunctions.cpp:44
> +static float computedFontSizeFromSpecifiedSize(float specifiedSize, bool isAbsoluteSize, bool canApplyMinSizeRules, float zoomFactor, ESmartMinimumForFontSize useSmartMinimumForFontSize, const Settings* settings)

The bool param makes it hard to read at the call site. An enum would be better.
Comment 3 Said Abou-Hallawa 2015-04-15 18:04:23 PDT
Created attachment 250886 [details]
Patch
Comment 4 WebKit Commit Bot 2015-04-15 19:51:32 PDT
Comment on attachment 250886 [details]
Patch

Clearing flags on attachment: 250886

Committed r182876: <http://trac.webkit.org/changeset/182876>
Comment 5 WebKit Commit Bot 2015-04-15 19:51:38 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Said Abou-Hallawa 2015-04-15 20:01:53 PDT
rdar://problem/13601274
Comment 7 Darin Adler 2015-04-16 17:31:44 PDT
Comment on attachment 250886 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250886&action=review

> Source/WebCore/ChangeLog:11
> +        computed value after applying the minimum fort size rule. This means the

font, not fort

> Source/WebCore/style/StyleFontSizeFunctions.cpp:43
> +    DonNotApplyMinimumFontSize,

Typo: DonNot.

> Source/WebCore/style/StyleFontSizeFunctions.cpp:48
> +static float computedFontSizeFromSpecifiedSize(float specifiedSize, bool isAbsoluteSize, float zoomFactor, MinimumFontSizeRule minimumForFontSizeRule, const Settings* settings)

I think the argument name should be minimumSizeRule rather than minimumForFontSizeRule. Other argument names just say Size, not FontSize, and the For is not needed.
Comment 8 Said Abou-Hallawa 2015-04-17 10:37:20 PDT
(In reply to comment #7)
> Comment on attachment 250886 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=250886&action=review
> 
> > Source/WebCore/ChangeLog:11
> > +        computed value after applying the minimum fort size rule. This means the
> 
> font, not fort
> 
> > Source/WebCore/style/StyleFontSizeFunctions.cpp:43
> > +    DonNotApplyMinimumFontSize,
> 
> Typo: DonNot.
> 
> > Source/WebCore/style/StyleFontSizeFunctions.cpp:48
> > +static float computedFontSizeFromSpecifiedSize(float specifiedSize, bool isAbsoluteSize, float zoomFactor, MinimumFontSizeRule minimumForFontSizeRule, const Settings* settings)
> 
> I think the argument name should be minimumSizeRule rather than
> minimumForFontSizeRule. Other argument names just say Size, not FontSize,
> and the For is not needed.

Fixed. Committed r182955: <http://trac.webkit.org/changeset/182955>