[Webkit-unassigned] [Bug 55750] New: SVG <image> referenced by <use> is displayed incorrectly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 4 00:00:09 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=55750

           Summary: SVG <image> referenced by <use> is displayed
                    incorrectly
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ctruta at chromium.org
                CC: zimmermann at kde.org


This is a Chromium-specific bug. The original test case runs well on Safari and on the other non-Chromium browsers.
Here is the original bug report:
http://code.google.com/p/chromium/issues/detail?id=42465

Underneath, however, all platforms need fixing.

The difference in behavior between Chromium and the other browsers is caused by the difference between KURL and KURLGoogle. The two URL implementation classes are slightly different in their handling of invalid URLs. However, in principle, this difference should not cause issues.

The KURL constructor takes the arguments (base, relative). When base is the empty string, and relative has no scheme (i.e. base="", relative="foo.svg"), the resulting KURL object is invalid. Both KURL and KURLGoogle agree on this.
The difference is that the KURL string (upon failure) is set to the relative part, while the KURLGoogle string (also upon failure) is set to the empty string:

base = ""
relative = "foo.svg"
----
KURL(base, relative).isValid() == false
KURL(base, relative).string() = "foo.svg"
----
KURLGooglePrivate(base, relative).isValid() == false
KURLGooglePrivate(base, relative).string() = ""

Neither of the two URL implementations is "right" or "wrong", it's just that KURL happens to work with this test case, while KURLGoogle, unluckily, doesn't.
The real problem here, which needs fixing, is that the resulting URL should not be invalid. The test case is perfectly legitimate.

The fix consists in setting the base part to the correct value, which is the URL of the document that contains the <image> element. This will lead to:
base = "scheme://path/to/base.svg"
relative = "foo.svg"
-----
KURL(base, relative).isValid() == KURLGooglePrivate(base, relative).isValid() == true
KURL(base, relative).string() == KURLGooglePrivate(base, relative).string() == "scheme://path/to/foo.svg"

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list