mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 01:08:21 +00:00
Bug 935056 - Don't apply minimum font sizes to SVG text. r=dbaron
This commit is contained in:
parent
86950df8f5
commit
45fe7b6de8
10
layout/reftests/bugs/935056-1-ref.html
Normal file
10
layout/reftests/bugs/935056-1-ref.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<style>
|
||||
p { font: 32px serif; }
|
||||
text { font: 16px serif; }
|
||||
</style>
|
||||
<p>This text should be affected by the minimum font size.</p>
|
||||
<svg width="800" height="40">
|
||||
<text x="10" y="20">This text should not be affected by the minimum font size.</text>
|
||||
</svg>
|
9
layout/reftests/bugs/935056-1.html
Normal file
9
layout/reftests/bugs/935056-1.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<style>
|
||||
p, text { font: 16px serif; }
|
||||
</style>
|
||||
<p>This text should be affected by the minimum font size.</p>
|
||||
<svg width="800" height="40">
|
||||
<text x="10" y="20">This text should not be affected by the minimum font size.</text>
|
||||
</svg>
|
@ -1779,6 +1779,7 @@ fuzzy(1,10000) fuzzy-if(Android&&AndroidVersion>=15,5,10000) == 902330-1.html 90
|
||||
fuzzy-if(Android,8,400) == 906199-1.html 906199-1-ref.html
|
||||
== 921716-1.html 921716-1-ref.html
|
||||
fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
|
||||
test-pref(font.minimum-size.x-western,32) == 935056-1.html 935056-1-ref.html
|
||||
== 936670-1.svg 936670-1-ref.svg
|
||||
== 931853.html 931853-ref.html
|
||||
== 931853-quirks.html 931853-quirks-ref.html
|
||||
|
@ -3554,9 +3554,15 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
|
||||
|
||||
nscoord fontSize = aFont->mSize;
|
||||
|
||||
// enforce the user' specified minimum font-size on the value that we expose
|
||||
// (but don't change font-size:0, since that would unhide hidden text)
|
||||
if (fontSize > 0) {
|
||||
// Enforce the user's specified minimum font-size on the value that we
|
||||
// expose (but don't change font-size:0, since that would unhide hidden
|
||||
// text).
|
||||
//
|
||||
// We don't do this for SVG text, which we can tell from the value of
|
||||
// -x-text-zoom. It's safe to look at mAllowZoom on this style struct
|
||||
// we're computing, since we know -x-text-zoom is only ever specified
|
||||
// on an <svg:text> element and is inherited otherwise.
|
||||
if (fontSize > 0 && aFont->mAllowZoom) {
|
||||
nscoord minFontSize = aPresContext->MinFontSize(aFont->mLanguage);
|
||||
if (minFontSize < 0) {
|
||||
minFontSize = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user