Backed out changeset 005d447749ec (bug 1370646) mochitest failure at layout/style/test/test_font_loading_api.html. On a CLOSED TREE

This commit is contained in:
Daniel Varga 2019-03-29 10:38:13 +02:00
parent 0bc3e10232
commit bd12eaff99
3 changed files with 3 additions and 41 deletions

View File

@ -5223,20 +5223,9 @@ bool SVGTextFrame::UpdateFontSizeScaleFactor() {
mFontSizeScaleFactor = contextScale;
} else if (maxSize / minSize > CLAMP_MAX_SIZE / CLAMP_MIN_SIZE) {
// We can't scale the font sizes so that all of the text frames lie
// within our ideal font size range.
// Heuristically, if the maxTextRunSize is within the CLAMP_MAX_SIZE
// as a reasonable value, it's likely to be the user's intent to
// get a valid font for the maxTextRunSize one, we should honor it.
// The same for minTextRunSize.
if (maxTextRunSize <= CLAMP_MAX_SIZE) {
mFontSizeScaleFactor = CLAMP_MAX_SIZE / maxSize;
} else if (minTextRunSize >= CLAMP_MIN_SIZE) {
mFontSizeScaleFactor = CLAMP_MIN_SIZE / minSize;
} else {
// So maxTextRunSize is too big, minTextRunSize is too small,
// we can't really do anything for this case, just leave it as is.
mFontSizeScaleFactor = contextScale;
}
// within our ideal font size range, so we treat the minimum as more
// important and just scale so that minSize = CLAMP_MIN_SIZE.
mFontSizeScaleFactor = CLAMP_MIN_SIZE / minSize;
} else if (minTextRunSize < CLAMP_MIN_SIZE) {
mFontSizeScaleFactor = CLAMP_MIN_SIZE / minSize;
} else {

View File

@ -11,5 +11,4 @@ support-files =
file_yellow_black.svg
[test_hover_near_text.html]
[test_multiple_font_size.html]
[test_use_tree_cycle.html]

View File

@ -1,26 +0,0 @@
<!DOCTYPE HTML>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1370646">Mozilla Bug 1370646</a>
<svg xmlns="http://www.w3.org/2000/svg" width="440" height="100" viewBox="0 0 440 100">
<text>
<tspan id="a" style="font-size:100px">3</tspan>
</text>
<text>
<tspan id="b" style="font-size:100px">3</tspan>
<tspan style="font-size:0.1px">0</tspan>
</text>
</svg>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
let alen = document.getElementById("a").getComputedTextLength(),
blen = document.getElementById("b").getComputedTextLength();
SimpleTest.isfuzzy(alen, blen, 5, "lengths should be close");
SimpleTest.finish();
</script>