RESOLVED WORKSFORME 17063
SVGTextElement.getRotationOfChar() sometimes fails (and then test 78 of Acid3 fails)
https://bugs.webkit.org/show_bug.cgi?id=17063
Summary SVGTextElement.getRotationOfChar() sometimes fails (and then test 78 of Acid3...
Eric Seidel (no email)
Reported 2008-01-29 00:36:07 PST
SVGTextElement.getRotationOfChar() fails (Acid3 bug) Test 79: expected 90, got: 0 - getRotationOfChar(0) failed. function () { // test 79: SVG textPath and getRotationOfChar(), from Erik Dahlstrom // // The getRotationOfChar[4] method fetches the midpoint rotation // of a glyph defined by a character (in this testcase there is // a simple 1:1 correspondence between the two). The path is // defined in the empty.svg file, and consists of first a line // going down, then followed by a line that has a 45 degree // slope and then followed by a horizontal line. The length of // each path segment have been paired with the advance of each // glyph, so that each glyph will be on each of the three // different path segments (see text on a path layout rules[5]). // Thus the rotation of the first glyph is 90 degrees, the // second 45 degrees and the third 0 degrees. // // [4] http://www.w3.org/TR/SVG11/text.html#InterfaceSVGTextContentElement // [5] http://www.w3.org/TR/SVG11/text.html#TextpathLayoutRules var svgns = "http://www.w3.org/2000/svg"; var xlinkns = "http://www.w3.org/1999/xlink"; var svgdoc = kungFuDeathGrip.firstChild.contentDocument; assert(svgdoc, "contentDocument failed on <object> for svg document."); var svg = svgdoc.documentElement; var text = svgdoc.createElementNS(svgns, "text"); text.setAttribute("font-size", "4000"); text.setAttribute("font-family", "ACID3svgfont"); var textpath = svgdoc.createElementNS(svgns, "textPath"); textpath.setAttributeNS(xlinkns, "xlink:href", "#path"); var textContent = svgdoc.createTextNode("abc"); textpath.appendChild(textContent); text.appendChild(textpath); svg.appendChild(text); assertEquals(text.getRotationOfChar(0), 90, "getRotationOfChar(0) failed."); assertEquals(text.getRotationOfChar(1), 45, "getRotationOfChar(1) failed."); assertEquals(text.getRotationOfChar(2), 0, "getRotationOfChar(2) failed."); var code = -1000; try { var val = text.getRotationOfChar(-1) } catch(e) { code = e.code; } assertEquals(code, DOMException.INDEX_SIZE_ERR, "getRotationOfChar #1 exception failed."); code = -1000; try { var val = text.getRotationOfChar(4) } catch(e) { code = e.code; } assertEquals(code, DOMException.INDEX_SIZE_ERR, "getRotationOfChar #2 exception failed."); return 5; },
Attachments
Eric Seidel (no email)
Comment 1 2008-01-29 00:59:21 PST
I don't see where Acid3 ever bothers to load the empty.svg file... so I think this test is invalid.
Ian 'Hixie' Hickson
Comment 2 2008-01-29 11:18:58 PST
Right now they're loaded in test 65.
Eric Seidel (no email)
Comment 3 2008-01-29 11:47:50 PST
Ok, so the comment in the test is just wrong. it says "empty.svg" when you mean "svg.xml" http://www.hixie.ch/tests/evil/acid/003/svg.xml
Ian 'Hixie' Hickson
Comment 4 2008-01-30 16:15:08 PST
It's actually now empty.svg again.
Eric Seidel (no email)
Comment 5 2008-02-03 16:32:34 PST
Wow. How entertaining, this test fails intermittently. It seems to succeed on the first load, but fail on any successive reload. Test 79: expected: 90, got: 0 - getRotationOfChar(0) failed. I doubt that has anything to do with the SVG portion of this test.
Dave Hyatt
Comment 6 2008-02-21 17:13:34 PST
I think it does have to do with SVG. SVG is reporting an angle of 0 in its own code for the character. I suspect something going wrong with the SVG font, but I'm not sure what.
Dave Hyatt
Comment 7 2008-02-21 17:35:49 PST
This was a bug in the test. Eric was right. Because Hixie did not use the custom svg font at all, it never downloaded until attempts were made to use it in tests. But because the font downloaded async it isn't necessarily coming in in time. Acid3 has been changed so that svg.xml now uses the custom font, forcing it to load and delay the onload handler.
Robert Blaut
Comment 8 2008-02-24 12:24:39 PST
The test "Test 78: expected: 90, got: 0 - getRotationOfChar(0) failed." still sometimes fails. The behavior is similar to the one observed in test 80. I think we should reopen the bug to track the issue.
Eric Seidel (no email)
Comment 9 2008-03-03 17:58:53 PST
WildFox was having some trouble making the "use the font to delay the onload" handler trick work. Which would suggest that Acid3 is still timing dependent... and that Robert might not be seeing ghosts. :) @hyatt: WildFox said he'd ask you about it tomorrow.
Darin Adler
Comment 10 2008-03-15 18:34:50 PDT
I have not seen this failure at all in the last few weeks.
Robert Blaut
Comment 11 2008-03-16 02:09:34 PDT
(In reply to comment #10) > I have not seen this failure at all in the last few weeks. > Darin, I still able to reproduce the problem. Try to reload the Acid3 test a couple of times. The test should shows you 89/100 score sometimes or crash sometimes ;)
Ismail Donmez
Comment 12 2010-06-24 01:53:56 PDT
I can reproduce this on Qt/Windows CE, here is the exact error; Test 78 failed: expected '90' but got '89.99998474121094' - getRotationOfChar(0) failed. Looks like there is a rounding problem somewhere.
Chang Shu
Comment 13 2011-01-07 14:02:58 PST
I am not able to reproduce the problem on Mac. However, it's consistently reproducible on Qt Linux (Ubuntu 10.04). I will investigate it.
zalan
Comment 14 2011-01-11 05:59:25 PST
(In reply to comment #13) > I am not able to reproduce the problem on Mac. However, it's consistently reproducible on Qt Linux (Ubuntu 10.04). I will investigate it. for Qt, this is a regression, introduced by http://trac.webkit.org/changeset/66979 I have a fix on this and going to reopen https://bugs.webkit.org/show_bug.cgi?id=43837
Chang Shu
Comment 15 2011-01-12 07:32:53 PST
(In reply to comment #14) > (In reply to comment #13) > > I am not able to reproduce the problem on Mac. However, it's consistently reproducible on Qt Linux (Ubuntu 10.04). I will investigate it. > > for Qt, this is a regression, introduced by http://trac.webkit.org/changeset/66979 > I have a fix on this and going to reopen https://bugs.webkit.org/show_bug.cgi?id=43837 The problem I saw on QtLinux is the same as what Zalan is working on. But it's not related to the original problems reported earlier. I will get myself off the hook. :)
Dirk Schulze
Comment 16 2011-05-18 10:53:44 PDT
I run the test 2 dozen times and can't reproduce it on Mac. Does it still fail for someone else?
Dirk Schulze
Comment 17 2011-05-22 14:19:20 PDT
Closing the bug now. If someone can reproduce it, or better has a test, please reopen the bug again.
Note You need to log in before you can comment on or make changes to this bug.