Bug 102789 - svg/hixie/data-types/002.xhtml fails
Summary: svg/hixie/data-types/002.xhtml fails
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 102793 102798 102799 102782 102796 102797
  Show dependency treegraph
 
Reported: 2012-11-20 03:20 PST by Kangil Han
Modified: 2022-07-15 15:46 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.52 KB, patch)
2012-11-20 03:24 PST, Kangil Han
no flags Details | Formatted Diff | Diff
patch (2.06 KB, patch)
2012-11-20 04:46 PST, Kangil Han
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kangil Han 2012-11-20 03:20:59 PST
The two bars are not identical.
Comment 1 Kangil Han 2012-11-20 03:24:38 PST
Created attachment 175180 [details]
Patch
Comment 2 Build Bot 2012-11-20 03:55:35 PST
Comment on attachment 175180 [details]
Patch

Attachment 175180 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14899560

New failing tests:
svg/hixie/data-types/002.xhtml
Comment 3 Kangil Han 2012-11-20 04:46:34 PST
Created attachment 175190 [details]
patch

Change case as reftest.
Comment 4 Raphael Kubo da Costa (:rakuco) 2012-11-20 05:05:46 PST
This is an imported test case. AFAIK we normally don't change them like this, as they were probably designed the way the were for a reason; you should instead check if there's a new, more correct version of it and then import it. Or investigate what's causing the wrong behavior in WebKit, if there's really one.
Comment 5 Dominik Röttsches (drott) 2012-11-20 05:08:06 PST
Comment on attachment 175190 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=175190&action=review

> LayoutTests/svg/hixie/data-types/002.xhtml:14
> +  <svg height="40px" width="10em" viewBox="0 0 10em 40px" xmlns="http://www.w3.org/2000/svg">

This is not the right way to fix this. It's actually part of the logic of the text to have a square viewbox. Maybe rather check how you can change the aspect-ratio so that the contents of the viewbox are scaled up to the full size of the svg container.
Comment 6 Kangil Han 2012-11-20 05:18:30 PST
drott, rakuco : Okay, I will investigate more. :)
Comment 7 Kangil Han 2012-11-20 06:00:25 PST
Got some points. :)


  <svg height="40px" width="10em" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
   <rect x="0" y="0" width="100" height="100" fill="navy"/>
  </svg>

100 UUheight and 40 px -> 0.4px per 1 UUheight
100 UUwidth and 10em -> 0.1em per 1 UUwidth

Therefore, rect should be like this:
  height = 0.4px * 100 = 40px
  width = 0.1em * 100 = 10em

these are exactly same with <div> and it means that I should dig more into WebKit code side. :)

Thx, drott and rakuco!
Comment 8 Kangil Han 2012-11-20 06:00:51 PST
Comment on attachment 175190 [details]
patch

Wrong approach.
Comment 9 Nikolas Zimmermann 2012-11-26 14:55:22 PST
Comment on attachment 175180 [details]
Patch

This test is important from an early set of hixies SVG test. Are you sure it's wrong? What do the other browsers do?
Comment 10 Dirk Schulze 2013-01-02 10:43:18 PST
(In reply to comment #9)
> (From update of attachment 175180 [details])
> This test is important from an early set of hixies SVG test. Are you sure it's wrong? What do the other browsers do?

Actually all browsers act the same. This is very surprising for me. I would expect that the same as Ian did: The viewBox scales the content to the whole dimension of the SVG, but it doesn't. Instead the size of the viewBox is used to get a scale ratio and is fits into the SVG area by the value of preserveAspectRatio. Need to read the spec here.
Comment 11 Kangil Han 2013-01-02 21:37:28 PST
(In reply to comment #9)
> (From update of attachment 175180 [details])
> This test is important from an early set of hixies SVG test. Are you sure it's wrong? What do the other browsers do?

oops.. sorry for my overlooking. :-(
Fortunately, dirk kindly answered on your question. :) Thx!

In addition, <http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute> describes 'The value of the ‘viewBox’ attribute is a list of four numbers <min-x>, <min-y>, <width> and <height>' and I couldn't find any more specific information from web search.

In my last investigation in source level, I've found this test case fails in parsing viewBox because current implementation only considers numbers with few exception but not 'em'.

Therefore, given information, I am still not sure which direction would be the best approach for this test case.
Comment 12 Brent Fulgham 2022-07-15 15:43:28 PDT
Safari, Chrome, and Firefox all produce incorrect results.
Comment 13 Radar WebKit Bug Importer 2022-07-15 15:46:16 PDT
<rdar://problem/97098369>