Bug 6018 - WebKit+SVG should pass all of Hixie's test (and adopt them)
Summary: WebKit+SVG should pass all of Hixie's test (and adopt them)
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P4 Normal
Assignee: Nobody
URL: http://hixie.ch/tests/adhoc/svg/svg-p...
Keywords:
Depends on: 9938 9976 9999 11005 11006 11014 11015 11017
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-08 18:14 PST by Eric Seidel (no email)
Modified: 2022-09-25 14:57 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2005-12-08 18:14:24 PST
WebKit+SVG should pass all of Hixie's test (and adopt them)
http://hixie.ch/tests/adhoc/svg/svg-plugin-ua.html

Looks like we pass many of them already.
Comment 2 Helder Magalhães 2008-12-31 05:03:18 PST
(In reply to comment #1)
> Looking again we seem to fail quite a number of these.
Revisiting this issue with revision 39474, using a nightly [1] on Windows XP SP3...


> Failures:
> http://hixie.ch/tests/adhoc/svg/cascade/001.xml
Now OK.


> http://hixie.ch/tests/adhoc/svg/cascade/002.xml
Now OK.


> http://hixie.ch/tests/adhoc/svg/data-types/002.xhtml
I believe there is an error in the test itself. To force SVG content to resize to the SVG canvas, one needs to set "preserveAspectRatio" property to "none" (the lacuna value is "xMidYMid"). By making the following modification, the test passes (same in Firefox 3.2a):

-  <svg height="40px" width="10em" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
+  <svg height="40px" width="10em" viewBox="0 0 100 100" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">


> http://hixie.ch/tests/adhoc/svg/dynamic/005.xml (opera also fails, firefox
> passes)
Now OK.


> http://hixie.ch/tests/adhoc/svg/error/002.xml
Not sure about this one. The test states that:

  I'm assuming, here, that the UA doesn't support XLink itself
  in an SVG context, but that it merely supports XLink's attributes in
  an SVG context as defined by SVG, and that therefore the
  xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
  attributes are all simply ignored.

Thing is I'm not sure if it should be ignored, at least not according to a recent version of the specification [3]...
Another thing that confuses me in this test is that linking to an external style sheet should be done using the "xml-stylesheet" element...
Finally, the text seems to contradict the test itself. If the external style information was to be ignored, than one should read "This line should be red." or the test needed to be modified in accordance.
In my personal opinion, I believe this is a "pass".


> http://hixie.ch/tests/adhoc/svg/error/003.xml
Now OK. I'd add that the default stroke length (1) is also pretty thin to be seen, specially in TFT monitors using anti-aliasing. I'd propose increasing the stroke width to 3 or 5 in order to make the "rectangle with a blue border" more obvious:

- <rect x="0" y="0" width="300" height="200" stroke="blue" fill="url(#test)"/>
+ <rect x="0" y="0" width="300" height="200" stroke="blue" stroke-width="3" fill="url(#test)"/>

I also find the explanatory text a bit confusing...

  on the next line the given paint server is not valid, therefore it is
  unsupported and XXX raised as last call issue XXX


> http://hixie.ch/tests/adhoc/svg/error/006.xml
Not sure about this one. Nothing is displayed and, FWIW, Firefox 3.2a also displays nothing...

> http://hixie.ch/tests/adhoc/svg/error/012.xml
I believe there's an error in this test. According to document error processing, nothing is stated regarding partial document rendering: Webkit does display a "highly perceivable indication of error", although it displays the rendering up to the erroneous XML portion, which is a red rectangle and seems to point towards failure. The broken element as red sounds reasonable though. I'd say this is a "pass" and would suggest the following modification to the test:

- <rect x="10" y="10" width="200" height="200" fill="red"/>
+ <rect x="10" y="10" width="200" height="200" fill="green"/>


> http://hixie.ch/tests/adhoc/svg/error/013.xml
Partially failing. No "highly perceivable indication of error" is presented, although the document in failure isn't rendered (as expected).


> http://hixie.ch/tests/adhoc/svg/error/017.xml
Still fails. A circular reference (from element with identifier "d" to "a" which refers "b", "c" and "d" again) is an error [5].


> http://hixie.ch/tests/adhoc/svg/links/001.xml (we don't support link tabbing
> yet)
Still fails. No tab support exists, as stated. Opera 10a passes, but only if the iFrame is focused first (there's no tab navigation between the main and the iFrame document).


> http://hixie.ch/tests/adhoc/svg/links/002.xml
I believe there's an error in this test. Linking to an external style sheet should be done using the "xml-stylesheet" element... By making the following modification, the test passes (same in Firefox 3.2a):

- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-  <style xlink:href="002.css"/>
+ <?xml-stylesheet type="text/css" href="002.css"?>
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <text y="30" x="10" fill="red" font-size="20">This line should be green.</text>


> http://hixie.ch/tests/adhoc/svg/links/003.xml
Not sure about this one. Text states that:

  Spec says that <a> can only link to animation elements,
  otherwise it is invalid; that known attributes with
  unsupported values are treated as if they hadn't been
  specified when rendering; that if the attribute is not
  specified, the effect is as if an empty value ("") was
  specified; and that an empty attribute value (xlink:href="")
  means that no link traversal occurs upon activation of the 'a'
  element. So. Nothing should happen if you click it

But, at least according to SVG 1.2, there's nothing wrong about it [6]. I'd only mark this as "partially failed" as the target element's bounding box isn't centered as expected [7] after activating the link.



Few more test failures or commented tests (ones not listed here and previously are passing!):
 * http://hixie.ch/tests/adhoc/svg/links/pass.txt - probably this one shoudn't appear in the list...
 * http://hixie.ch/tests/adhoc/svg/markers/001.xml - invalid XML in the text case: apparently due to an "INCOMPLETE" status of the test. ;-)
 * http://hixie.ch/tests/adhoc/svg/mixed/001-demo.xml - apparently failed: missing content ("TEST a" to "TEST d"), although selecting all and pasting into a text editor shows that text is there (which may give a clue on what's happening). :-)
 * http://hixie.ch/tests/adhoc/svg/mixed/002-demo.xml - same as "mixed/001-demo.xml".
 * http://hixie.ch/tests/adhoc/svg/perf/007.xml - using the javascript array notation is not SVG conformant and apparently fails in Firefox 3.2a (and probably in ASV and Renesis also) [8]. By making the following modification, the test gains interoperability (with Firefox 3.2a only, ASV and Renesis would need a string as "setTimeout" argument...):

- var svg = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'svg')[0];
- var t = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'text')[2];
+ var svg = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'svg').item(0);
+ var t = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'text').item(2);

 * http://hixie.ch/tests/adhoc/svg/processing-model/001-demo-support.xml - I'm not quite sure what the result should be...
 * http://hixie.ch/tests/adhoc/svg/processing-model/001-demo.xml - there seems to be an issue with the test: file "001-demo-redirect.xml" doesn't exist so, currently, a black fill seems to be a "pass"...
 * http://hixie.ch/tests/adhoc/svg/processing-model/002-demo-support.xml - I'm not quite sure what the result should be...
 * http://hixie.ch/tests/adhoc/svg/processing-model/002-demo.xml - same as "processing-model/001-demo.xml".
 * http://hixie.ch/tests/adhoc/svg/processing-model/003.dtd - same as "links/pass.txt".
 * http://hixie.ch/tests/adhoc/svg/rendering-model/004.xhtml - no zoom support to perform test...
 * http://hixie.ch/tests/adhoc/svg/text/001.xml - partially failed: font is used in rendering (after local install) but the alignment is not perfect - glyph is positioned slightly above the expected location (Firefox 3.2a passes).
 * http://hixie.ch/tests/adhoc/svg/use/002.xml - there seems to be an issue with the test: file "002-test.xml" is not there so, currently, a the red rectangle seems to be a "pass"...

As stated, all items which are not here are considered OK, so this is quite a good progress! :-)

I'd ask Ian Hixie to review the tests with potential issues and post some follow up whenever possible. Thanks! ;-)

Happy new year,

 Helder Magalhães


[1] http://nightly.webkit.org/
[2] http://www.w3.org/TR/SVGTiny12/coords.html#PreserveAspectRatioAttribute
[3] http://www.w3.org/TR/SVGTiny12/linking.html
[4] http://www.w3.org/TR/SVGTiny12/implnote.html#ErrorProcessing
[5] http://www.w3.org/TR/SVGTiny12/linking.html#circular-iri
[6] http://www.w3.org/TR/SVGTiny12/linking.html#LinksIntoSVG
[7] http://www.w3.org/TR/SVGTiny12/linking.html#FragmentIdentifierTraversal
[8] http://blog.codedread.com/archives/2007/01/19/guide-to-deploying-svg-with-html/#nodelist
Comment 3 Helder Magalhães 2009-01-08 07:04:04 PST
@Ian Hixie

Just another tip regarding the tests themselves (sorry if this is going a bit off-topic, but as some comments about the tests were made in the previous comment...):

>  * http://hixie.ch/tests/adhoc/svg/text/001.xml - partially failed: font is
> used in rendering (after local install) but the alignment is not perfect -
> glyph is positioned slightly above the expected location (Firefox 3.2a passes).

As apparently most updated (nightly or pre-release) browser versions seem to support CSS Web fonts (at least Firefox, Webkit and Opera [1]), I'd suggest adding CSS Web font information to the test, which seems to be the only one from the suite which requires the Ahem font. Tests directory folder states that "These tests may require the Ahem font." [2], which would still be true for current state browsers, but it could ease testing a bit. :-)

-  <!-- if you don't have Ahem, see http://www.hixie.ch/resources/fonts/ -->
+  <!-- if you don't have a CSS Web font capable browser or Ahem font locally available, see http://www.hixie.ch/resources/fonts/ -->
+ <style type="text/css">
+  @font-face {
+   font-family: Ahem;
+   src: url(http://www.hixie.ch/resources/fonts/AHEM____.TTF) format("ttf");
+  }
+</style>

Using my local file system and a downloaded copy of the font in the same directory and changing the font URL to "AHEM____.TTF", (without the font installed in the system, naturally) Firefox 3.2a pass, Webkit r39474 and Opera 10.0a fail but I believe this has to do with security restrictions. This will likely work for all 3 browsers when both files are available in an HTTP server. :-)

[1] http://lists.w3.org/Archives/Public/www-svg/2009Jan/0019.html
[2] http://hixie.ch/tests/adhoc/svg/text/
Comment 4 Ian 'Hixie' Hickson 2009-03-16 11:37:47 PDT
Yeah some of those tests are buggy. Dunno when I'll get around to fixing them.
Comment 5 Rob Buis 2011-05-30 08:57:24 PDT
I agree with Helder's analysis of this one (sorry I react so late):

> http://hixie.ch/tests/adhoc/svg/links/002.xml
I believe there's an error in this test. Linking to an external style sheet should be done using the "xml-stylesheet" element... By making the following modification, the test passes (same in Firefox 3.2a):

- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-  <style xlink:href="002.css"/>
+ <?xml-stylesheet type="text/css" href="002.css"?>
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <text y="30" x="10" fill="red" font-size="20">This line should be green.</text>

I simply can't find anything in SVG or even HTML spec to use style foe external stylesheet linking.
Cheers,

Rob.
Comment 6 Eric Seidel (no email) 2011-05-30 09:18:54 PDT
Seems we should tell hixie
Comment 7 Helder Magalhães 2011-06-05 03:03:16 PDT
(In reply to comment #5)
> I simply can't find anything in SVG or even HTML spec to use style foe external stylesheet linking.

Doug Schepers has blogged [1] some time ago about this, and the final conclusion seems to point towards @import rules being the most interoperable (and apparently standard) way of doing it.

[1] http://schepers.cc/css-link-hack-in-svg
Comment 8 Ahmad Saleem 2022-09-25 14:57:34 PDT
Tested via STP 154.


http://hixie.ch/tests/adhoc/svg/cascade/002.xml - Show "Green" circle in Safari 154.

http://hixie.ch/tests/adhoc/svg/svg-plugin-ua.html - Other browsers does not show "Black" filled square with blue text and border.

http://hixie.ch/tests/adhoc/svg/error/013.xml - Pass in isolation but frame in 'Iframe', which is also the case in Chrome Canary 108 and only Firefox Nightly 107 show this proper in iframe.

http://hixie.ch/tests/adhoc/svg/links/003.xml - fails because document / page view scroll on clicking circle.

http://hixie.ch/tests/adhoc/svg/processing-model/001-demo.xml - All browsers differ.

____

Firefox Nightly 108 and Chrome Canary 107 match with each other:

http://hixie.ch/tests/adhoc/svg/mixed/009.xml

http://hixie.ch/tests/adhoc/svg/mixed/006.xml

http://hixie.ch/tests/adhoc/svg/mixed/011.xml

http://hixie.ch/tests/adhoc/svg/text/001.xml

http://hixie.ch/tests/adhoc/svg/processing-model/002-demo.xml