From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/svg/test/test_SVGTransformListAddition.xhtml | 2 +- dom/svg/test/test_bounds.html | 6 +++--- dom/svg/test/test_bug1426594.html | 8 +++++--- dom/svg/test/test_fragments.html | 3 +-- dom/svg/test/test_selectSubString.xhtml | 2 +- dom/svg/test/test_text_selection.html | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) (limited to 'dom/svg/test') diff --git a/dom/svg/test/test_SVGTransformListAddition.xhtml b/dom/svg/test/test_SVGTransformListAddition.xhtml index b3b908466c..ca0a7e23ac 100644 --- a/dom/svg/test/test_SVGTransformListAddition.xhtml +++ b/dom/svg/test/test_SVGTransformListAddition.xhtml @@ -40,7 +40,7 @@ function Transform(type, angle) { this.angle = angle; } -function main(g) { +function main() { var cases = [ new AdditionTestCase("Not additive", "translate(150 50)", diff --git a/dom/svg/test/test_bounds.html b/dom/svg/test/test_bounds.html index 0cf0001065..3b17c62d25 100644 --- a/dom/svg/test/test_bounds.html +++ b/dom/svg/test/test_bounds.html @@ -115,7 +115,7 @@ function runTest() { const sin45 = Math.sin(Math.PI / 4); - isfuzzy(text1Bounds.left, 24, 1, "text1.getBoundingClientRect().left"); + isfuzzy(text1Bounds.left, 23, 1, "text1.getBoundingClientRect().left"); is(text2Bounds.left, text1Bounds.left + 100, "text2.getBoundingClientRect().left"); is(text2Bounds.top, text1Bounds.top, "text2.getBoundingClientRect().top"); @@ -194,9 +194,9 @@ function runTest() { var text2aBounds = doc.getElementById("text2a").getBoundingClientRect(); - isfuzzy(text1aBounds.left, 82, 1, "text1a.getBoundingClientRect().left"); + isfuzzy(text1aBounds.left, 81, 1, "text1a.getBoundingClientRect().left"); is(text1aBounds.width, text1Bounds.width + 4, "text1a.getBoundingClientRect().width"); - is(text1bBounds.width, text1Bounds.width, "text1b.getBoundingClientRect().width"); + isfuzzy(text1bBounds.width, text1Bounds.width + 170, 1, "text1b.getBoundingClientRect().width"); isfuzzy(text1bBounds.height, 196, 5, "text1b.getBoundingClientRect().height"); is(text2aBounds.left, text1aBounds.left + 100 - 3, "text2a.getBoundingClientRect().left"); diff --git a/dom/svg/test/test_bug1426594.html b/dom/svg/test/test_bug1426594.html index ac975093c8..a3f830e9d0 100644 --- a/dom/svg/test/test_bug1426594.html +++ b/dom/svg/test/test_bug1426594.html @@ -12,10 +12,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1426594 function runTests() { let textElement = document.getElementById("textId"), - tspanElement = document.getElementById("tspanId"); + textClientRect = textElement.getBoundingClientRect(), + tspanClientRect = document.getElementById("tspanId").getBoundingClientRect(); - isfuzzy(textElement.getBoundingClientRect().width, tspanElement.getBoundingClientRect().width, 5); - isfuzzy(textElement.getBoundingClientRect().height, tspanElement.getBoundingClientRect().height, 5); + // TODO: tspan bounds should account for stroke, decorations and text-shadow + isfuzzy(textClientRect.width, tspanClientRect.width, 6, "unexpected width"); + isfuzzy(textClientRect.height, tspanClientRect.height, 6, "unexpected height"); SimpleTest.finish(); } diff --git a/dom/svg/test/test_fragments.html b/dom/svg/test/test_fragments.html index b12833e899..e7d0f29714 100644 --- a/dom/svg/test/test_fragments.html +++ b/dom/svg/test/test_fragments.html @@ -21,8 +21,7 @@ var svg = $("svg"); SimpleTest.waitForExplicitFinish(); -function Test(svgFragmentIdentifier, viewBoxString, - preserveAspectRatioString, zoomAndPanString) { +function Test(svgFragmentIdentifier) { this.svgFragmentIdentifier = svgFragmentIdentifier; } diff --git a/dom/svg/test/test_selectSubString.xhtml b/dom/svg/test/test_selectSubString.xhtml index 6755b65c56..66038237cb 100644 --- a/dom/svg/test/test_selectSubString.xhtml +++ b/dom/svg/test/test_selectSubString.xhtml @@ -39,7 +39,7 @@ function runTests() { } } - function expectNoThrow(charnum, nchars, expected) { + function expectNoThrow(charnum, nchars) { try { text.selectSubString(charnum, nchars); ok(true, diff --git a/dom/svg/test/test_text_selection.html b/dom/svg/test/test_text_selection.html index 7160461db9..2f275ac436 100644 --- a/dom/svg/test/test_text_selection.html +++ b/dom/svg/test/test_text_selection.html @@ -78,7 +78,7 @@ function testSelection() { deselect(); // Drag from left of the text to the right of the text to select it. - drag(90, 50, 110 + text[0].getComputedTextLength(), 50); + drag(101, 50, 99 + text[0].getComputedTextLength(), 50); selection_is("hello there", "selecting entire simple text by dragging around it"); deselect(); -- cgit v1.2.3