Bug 57318 - Incorrect offset of svg <use> element which is in <symbol> element
Summary: Incorrect offset of svg <use> element which is in <symbol> element
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 54546
  Show dependency treegraph
 
Reported: 2011-03-29 02:36 PDT by Leo Yang
Modified: 2011-03-30 00:48 PDT (History)
3 users (show)

See Also:


Attachments
Patch (9.04 KB, patch)
2011-03-29 03:16 PDT, Leo Yang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Yang 2011-03-29 02:36:28 PDT
When a svg <use> is in <symbol> webkit won't take offset into account. The following code should be rendered
as a 100*100 green rectangle visually. Patch is coming soon...

<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" width="100" height="100">
    <defs>
        <symbol id="s" viewBox="0 0 1 2">
            <rect fill="green" width="1" height="2" />
        </symbol>
        <symbol id="s1" viewBox="0 0 2 2">
            <use xlink:href="#s" x="0" y="0" width="1" height="2" />
            <use xlink:href="#s" x="1" y="0" width="1" height="2" />
        </symbol>
    </defs>
    <use xlink:href="#s1" x="0" y="0" width="100" height="100" />
</svg>
Comment 1 Leo Yang 2011-03-29 03:16:13 PDT
Created attachment 87291 [details]
Patch
Comment 2 Dirk Schulze 2011-03-29 03:38:24 PDT
Comment on attachment 87291 [details]
Patch

Why does it just affect symbol? what about svg or other elements?
Comment 3 Nikolas Zimmermann 2011-03-29 03:47:52 PDT
Comment on attachment 87291 [details]
Patch

Great catch again! Dirk: SVGShadowTreeContainerElement is only used for symbols, thus that's the only way the bug can be triggered.
Leo, does this affect Sierpinski carpet?
Comment 4 WebKit Commit Bot 2011-03-29 06:28:33 PDT
Comment on attachment 87291 [details]
Patch

Clearing flags on attachment: 87291

Committed r82242: <http://trac.webkit.org/changeset/82242>
Comment 5 WebKit Commit Bot 2011-03-29 06:28:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Leo Yang 2011-03-29 18:57:57 PDT
(In reply to comment #3)
> (From update of attachment 87291 [details])
> Great catch again! Dirk: SVGShadowTreeContainerElement is only used for symbols, thus that's the only way the bug can be triggered.
> Leo, does this affect Sierpinski carpet?

Yes, webkit renders Sierpinski_carpet_6.svg fine with this patch.