Bug 29870 - Actual points string is lost, Webkit normalizes it
Summary: Actual points string is lost, Webkit normalizes it
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-29 06:49 PDT by Jeff Schiller
Modified: 2022-08-18 13:16 PDT (History)
6 users (show)

See Also:


Attachments
Test case revealing the problem. (383 bytes, image/svg+xml)
2009-09-29 06:49 PDT, Jeff Schiller
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Schiller 2009-09-29 06:49:02 PDT
Created attachment 40300 [details]
Test case revealing the problem.

This is similar to other webkit problems where we set a value into the DOM and we can't get that exact value back.  Attached is a test case exhibiting the problem.

<svg xmlns="http://www.w3.org/2000/svg">
  <polyline id="poly" fill="green" />
  <script><![CDATA[
  	var poly = document.getElementById("poly");
  	var points = "10,10 100,60 10,110";
  	poly.setAttribute("points", points);
  	if (poly.getAttribute("points") != points) {
  		alert("Pass failed, points attribute equals:\n" + poly.getAttribute("points"));
  	}
  ]]></script>
</svg>

The above passes in Firefox and Opera but not in Safari/Chrome because Webkit changes the points string into a space-separate list of numbers.  This can be a problem if we need to build up the value of the 'points' attribute and then need to check it at some point.  See http://code.google.com/p/svg-edit/issues/detail?id=245


P.S. The 'Version' box in Bugzilla seems to be missing many options (Safari 4?)
Comment 1 Rob Buis 2011-05-16 19:37:52 PDT
Seems fixed nowadays.
Cheers,

Rob.
Comment 2 Alexey Proskuryakov 2011-05-17 00:08:56 PDT
Rob, would it make sense to land the test, or do you expect this to be covered already?
Comment 3 Rob Buis 2011-05-17 05:29:15 PDT
Hi Alexey,

(In reply to comment #2)
> Rob, would it make sense to land the test, or do you expect this to be covered already?

Good point. I think poly-points-attribute-changes.svg comes really close. It just uses getAttributeNode instead of getAttribute. Assuming both getAttribute and getAttributeNode will use the same internal Attr (which I think is the case) then we do not need the test below. What do you think?
Cheers,

Rob.
Comment 4 Dirk Schulze 2011-05-22 14:10:24 PDT
(In reply to comment #1)
> Seems fixed nowadays.
> Cheers,
> 
> Rob.

The problem here is, that Jeff wants to get the unnormalizd (original string) back. At least if I get it correct. IIRC we don't do this, we just changed our code to comma separated the axis of a point. If you add a space or something else, you can't get the original string back right now. So it is not fixed.
Comment 5 Ahmad Saleem 2022-06-02 21:08:19 PDT
We match with other browser on attached test case but I don't know whether we have test coverage for the following or not. Appreciate if someone can confirm whether it needs test coverage or not. Else it can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!
Comment 6 Ahmad Saleem 2022-06-02 21:08:23 PDT
We match with other browser on attached test case but I don't know whether we have test coverage for the following or not. Appreciate if someone can confirm whether it needs test coverage or not. Else it can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!