WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
46051
SVG: Make RenderPath DRT output platform-independent
https://bugs.webkit.org/show_bug.cgi?id=46051
Summary
SVG: Make RenderPath DRT output platform-independent
Andreas Kling
Reported
2010-09-19 09:05:45 PDT
DRT currently uses the port-specific Path::debugString() to dump RenderPath objects. We should switch to using a platform-independent output format for paths, and also simplify the format used for primitives (rect, circle, ellipse, line and polygon.) See also:
https://lists.webkit.org/pipermail/webkit-dev/2010-September/014419.html
Attachments
Proposed patch, first stab
(8.74 KB, patch)
2010-09-19 09:21 PDT
,
Andreas Kling
zimmermann
: review-
Details
Formatted Diff
Diff
Proposed patch v2
(4.29 KB, patch)
2010-09-20 06:11 PDT
,
Andreas Kling
zimmermann
: review+
Details
Formatted Diff
Diff
Mac layout test results
(
deleted
)
2010-10-08 02:29 PDT
,
Nikolas Zimmermann
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2010-09-19 09:21:50 PDT
Created
attachment 68026
[details]
Proposed patch, first stab A first modest attempt at this - not gonna bother rebaselining tests just yet.
WebKit Review Bot
Comment 2
2010-09-19 09:22:41 PDT
Attachment 68026
[details]
did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebCore/rendering/SVGRenderTreeAsText.cpp:65: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Antonio Gomes
Comment 3
2010-09-19 09:30:43 PDT
See also
bug 33784
.
Nikolas Zimmermann
Comment 4
2010-09-20 04:02:52 PDT
Comment on
attachment 68026
[details]
Proposed patch, first stab Looks good to me! I'd propose to not add those virtual methods (isRectElement) etc, just for the sake of DRT. Just compare the tag names: if (svgElement->hasTagName(SVGNames::rectTag)) { ...}
Andreas Kling
Comment 5
2010-09-20 06:11:53 PDT
Created
attachment 68073
[details]
Proposed patch v2 Using tag names instead of adding virtuals, as per Niko's request.
Nikolas Zimmermann
Comment 6
2010-09-20 08:19:55 PDT
Comment on
attachment 68073
[details]
Proposed patch v2 Looks great Andreas! Can you please upload a seperated patch including all rebaselines first? You also have to take special care of all platform specific results, not living in platform/mac. I'll r+ it afterwards.
Andreas Kling
Comment 7
2010-09-20 08:24:23 PDT
(In reply to
comment #6
)
> (From update of
attachment 68073
[details]
) > Looks great Andreas! Can you please upload a seperated patch including all rebaselines first? > You also have to take special care of all platform specific results, not living in platform/mac. > I'll r+ it afterwards.
I only have access to the Qt platform right now, so I can do those - would it be acceptable to use "webkit-patch rebaseline" to complete with results from bots after landing? (I will upload a patch with Qt rebaselines first.)
Nikolas Zimmermann
Comment 8
2010-09-20 08:41:51 PDT
(In reply to
comment #7
)
> (In reply to
comment #6
) > > (From update of
attachment 68073
[details]
[details]) > > Looks great Andreas! Can you please upload a seperated patch including all rebaselines first? > > You also have to take special care of all platform specific results, not living in platform/mac. > > I'll r+ it afterwards. > > I only have access to the Qt platform right now, so I can do those - would it be acceptable to use "webkit-patch rebaseline" to complete with results from bots after landing? (I will upload a patch with Qt rebaselines first.)
Hmm, that's a problem, as IIRC the bots exit after 20 failures, so it would require many iterations to fix all Mac bots. Can someone generate the mac results for you, my tree is hosed atm?
Andreas Kling
Comment 9
2010-09-23 06:24:25 PDT
I've asked Ossy to help with Qt results and Tor Arne with Mac.
Csaba Osztrogonác
Comment 10
2010-09-23 09:19:15 PDT
(In reply to
comment #8
)
> Hmm, that's a problem, as IIRC the bots exit after 20 failures, so it would require many iterations to fix all Mac bots.
No, fortunately bots use "--exit-after-n-crashes-or-timeouts 20" option instead of previous "--exit-after-n-failures 20". ;)
Csaba Osztrogonác
Comment 11
2010-09-23 09:22:42 PDT
(In reply to
comment #9
)
> I've asked Ossy to help with Qt results and Tor Arne with Mac.
I checked your patch, normally we should update ~140 expected files. But I thought over this task, and I have a better idea. :) We should update platform independent expected files first, and Qt specific after that. I hope we can remove some Qt specific files.
Andreas Kling
Comment 12
2010-09-23 09:42:31 PDT
(In reply to
comment #10
)
> No, fortunately bots use "--exit-after-n-crashes-or-timeouts 20" > option instead of previous "--exit-after-n-failures 20". ;)
> I checked your patch, normally we should update ~140 expected files. > But I thought over this task, and I have a better idea. :) We should > update platform independent expected files first, and Qt specific > after that. I hope we can remove some Qt specific files.
That would be fantastic. :) Nikolas, thoughts?
Dirk Schulze
Comment 13
2010-09-29 12:57:05 PDT
(In reply to
comment #12
)
> (In reply to
comment #10
) > > No, fortunately bots use "--exit-after-n-crashes-or-timeouts 20" > > option instead of previous "--exit-after-n-failures 20". ;) > > > I checked your patch, normally we should update ~140 expected files. > > But I thought over this task, and I have a better idea. :) We should > > update platform independent expected files first, and Qt specific > > after that. I hope we can remove some Qt specific files. > > That would be fantastic. :) Nikolas, thoughts?
To the patch. Please correct me if I'm wrong, but you may get just the relative values for rect or circle, if x,y,.. are in percentage. It would be great if we could get the repaintRect of the shape. On the other side, we'll get platform dependent results again, because RenderPath::repaintRectInLocalCoordinates() calls Path::strokeBoundaries and Path::fillBoundaries. So I'm still unsure if this is the right way to go. Niko, what is your opinion?
Dirk Schulze
Comment 14
2010-09-29 13:00:10 PDT
(In reply to
comment #11
)
> (In reply to
comment #9
) > > I've asked Ossy to help with Qt results and Tor Arne with Mac. > > I checked your patch, normally we should update ~140 expected files. > But I thought over this task, and I have a better idea. :) We should > update platform independent expected files first, and Qt specific > after that. I hope we can remove some Qt specific files.
Yes, it's better to test it on mac, create the reuslts and look if other platforms can reuse it afterwards. But we'll still end up with different results because of the fonts.
Nikolas Zimmermann
Comment 15
2010-10-01 03:10:10 PDT
Comment on
attachment 68073
[details]
Proposed patch v2 As discussed on IRC, the right way to go is to introduce a RenderSVGShape class whose repaintRectInLocalCoordinates can be dumped. The problem is that dumping RenderPath::repaintRectInLocalCoordinates, is that it's platform-dependant, as Path::boundingBox is used. As first step, I'd introduce RenderSVGShape : public RenderPath (which should be renamed and moved to rendering/svg/RenderSVGPath first) and let SVGCircle/RectElement etc. create RenderSVGShape instead of RenderSVGPath. Once that's done, we need to introduce platform-dependant ways to create rects, circles, instead of the home-brewn code in Path.cpp (addEllipse, etc.) Then we need to write a method which calculates the circle/rect/etc. boundaries in a _cross platform_ fashion. Then RenderSVGShape can use this new logic, and inherit from RenderSVGModelObject, and be completly decoupled from RenderSVGPath. Once that's done the DRT problem vanishes. (This is just a short summary of the IRC discussion).
Nikolas Zimmermann
Comment 16
2010-10-08 01:29:18 PDT
(In reply to
comment #15
)
> (From update of
attachment 68073
[details]
) > As discussed on IRC, the right way to go is to introduce a RenderSVGShape class whose repaintRectInLocalCoordinates can be dumped. > The problem is that dumping RenderPath::repaintRectInLocalCoordinates, is that it's platform-dependant, as Path::boundingBox is used. > > As first step, I'd introduce RenderSVGShape : public RenderPath (which should be renamed and moved to rendering/svg/RenderSVGPath first) > and let SVGCircle/RectElement etc. create RenderSVGShape instead of RenderSVGPath. > > Once that's done, we need to introduce platform-dependant ways to create rects, circles, instead of the home-brewn code in Path.cpp (addEllipse, etc.) > Then we need to write a method which calculates the circle/rect/etc. boundaries in a _cross platform_ fashion. > > Then RenderSVGShape can use this new logic, and inherit from RenderSVGModelObject, and be completly decoupled from RenderSVGPath. > Once that's done the DRT problem vanishes.
Ok, we had another discussion. This approach is fine. We'll just move SVG away from using the static Path::create* methods, and let them use Path::addEllipse etc. These methods already ask their platform specific implementations, and we don't need to decompose ellipses to paths etc. on our own. Andreas patch is just fine! I'll upload a baseline for mac, soon.
Nikolas Zimmermann
Comment 17
2010-10-08 01:31:10 PDT
Comment on
attachment 68073
[details]
Proposed patch v2 Ok, we made up our mind.
Nikolas Zimmermann
Comment 18
2010-10-08 02:29:08 PDT
Created
attachment 70215
[details]
Mac layout test results As mentioned on IRC, the patch is missing an " || svgElement->hasTagName(SVGNames::polylineTag)" branch, the rest is perfect. Please land your patch together with the mac results.
Andreas Kling
Comment 19
2010-10-08 02:50:24 PDT
Committed
r69386
: <
http://trac.webkit.org/changeset/69386
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug