зеркало из https://github.com/mozilla/gecko-dev.git
Bug 935056 - Don't apply minimum font sizes to SVG text. r=dbaron
This commit is contained in:
Родитель
8e5818464a
Коммит
d47a2db4a3
|
@ -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>
|
|
@ -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>
|
|
@ -1786,3 +1786,4 @@ fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
|
|||
== 936670-1.svg 936670-1-ref.svg
|
||||
== 941940-1.html 941940-1-ref.html
|
||||
fails-if(winWidget&&!d2d) == 942672-1.html 942672-1-ref.html
|
||||
test-pref(font.minimum-size.x-western,32) == 935056-1.html 935056-1-ref.html
|
||||
|
|
|
@ -3109,6 +3109,8 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
|
|||
allowZoom = true;
|
||||
}
|
||||
aFont->EnableZoom(aPresContext, allowZoom);
|
||||
} else {
|
||||
allowZoom = true;
|
||||
}
|
||||
|
||||
// mLanguage must be set before before any of the CalcLengthWith calls
|
||||
|
@ -3571,14 +3573,18 @@ 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)
|
||||
// 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.
|
||||
if (fontSize > 0) {
|
||||
nscoord minFontSize = aPresContext->MinFontSize(aFont->mLanguage);
|
||||
if (minFontSize < 0) {
|
||||
minFontSize = 0;
|
||||
}
|
||||
if (fontSize < minFontSize && !aPresContext->IsChrome()) {
|
||||
if (fontSize < minFontSize && !aPresContext->IsChrome() && allowZoom) {
|
||||
// override the minimum font-size constraint
|
||||
fontSize = minFontSize;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче