Bug 27243 - SVG JS bindings "context" pointer needs to move onto binding impls
Summary: SVG JS bindings "context" pointer needs to move onto binding impls
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nikolas Zimmermann
URL:
Keywords:
: 27278 (view as bug list)
Depends on: 20430
Blocks: 27088
  Show dependency treegraph
 
Reported: 2009-07-13 17:57 PDT by Eric Seidel (no email)
Modified: 2010-01-21 18:25 PST (History)
3 users (show)

See Also:


Attachments
Initial patch (61.46 KB, patch)
2009-12-21 13:09 PST, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Updated patch (61.13 KB, patch)
2009-12-21 13:22 PST, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v1 (61.26 KB, patch)
2009-12-21 15:11 PST, Nikolas Zimmermann
sam: review-
Details | Formatted Diff | Diff
Updated patch (57.29 KB, patch)
2010-01-21 17:31 PST, Nikolas Zimmermann
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-07-13 17:57:42 PDT
SVG JS bindings "context" pointer needs to move onto binding impls

Right now many SVG JS bindings have an extra context() parameter which is stored on the binding object.  That puts some SVG bindings up against the cell size limit.  The current plan for bug 27088 is to add a JSGlobaObject* on DOMObject.  That would put these SVG binding classes over the CELL_SIZE limit.

sub IsSVGTypeNeedingContextParameter
{
    my $implClassName = shift;
    if ($implClassName =~ /SVG/ and not $implClassName =~ /Element/) {
        return 1 unless $implClassName =~ /SVGPaint/ or $implClassName =~ /SVGColor/ or $implClassName =~ /SVGDocument/;
    }
    return 0;
}
Comment 1 Eric Seidel (no email) 2009-07-13 17:58:40 PDT
This might also be a good time to convert more of these custom impls into JSSVGPODTypes.
Comment 2 Nikolas Zimmermann 2009-12-21 12:58:33 PST
SVGAngle/SVGPreserveAspectRatio have been converted, the last two remaining types. Working on a patch to fix this bug.
Comment 3 Nikolas Zimmermann 2009-12-21 12:59:08 PST
*** Bug 27278 has been marked as a duplicate of this bug. ***
Comment 4 Nikolas Zimmermann 2009-12-21 13:09:15 PST
Created attachment 45344 [details]
Initial patch

This patch is NOT ready for review yet, I just want to see wheter V8 compiles or not ;-)
Comment 5 WebKit Review Bot 2009-12-21 13:12:36 PST
Attachment 45344 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/bindings/js/JSSVGPathSegCustom.cpp:23:  Found other header before a header this file implements. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
Skipping input 'WebCore/bindings/js/DOMObjectWithSVGContext.h': Can't open for reading
Total errors found: 1
Comment 6 Nikolas Zimmermann 2009-12-21 13:22:10 PST
Created attachment 45345 [details]
Updated patch

Still not r?, add some minor style changes to let EWS go on.
Comment 7 WebKit Review Bot 2009-12-21 13:23:00 PST
style-queue ran check-webkit-style on attachment 45345 [details] without any errors.
Comment 8 Nikolas Zimmermann 2009-12-21 15:11:22 PST
Created attachment 45353 [details]
Patch v1

I am not sure how to test the x-frame prototype chain stuff. I guess there are existing tests for HTML, Sam, please enlighten me :-)
Comment 9 WebKit Review Bot 2009-12-21 15:11:42 PST
style-queue ran check-webkit-style on attachment 45353 [details] without any errors.
Comment 10 Nikolas Zimmermann 2009-12-21 18:59:05 PST
Okay, I have tried abarths testcases on bug 27088 with and without this patch and it makes no difference (all SVG* objects say 'PASS'). Also the layout tests show no changes.

Now DOMObjectWithSVGContext is gone, and no one is using deprecatedLexicalGlobalObject anymore from SVG ... so I am wondering what I actually fixed here, besides removing the DOMOBjectWithSVGContext hack?

Can anyone come up with a testcase which fails without this bug? (Adam Barth pointed out that Eric might know :-)
Comment 11 Sam Weinig 2009-12-21 22:10:48 PST
Comment on attachment 45353 [details]
Patch v1

This looks good to me, though at some point I think we should take it a step further and move this stuff completely out of the bindings, and into the core implementation.  As for tests, fast/dom/prototype-inheritance.html and fast/dom/prototype-inheritance-2.html should be good tests to look at to test this, but they are probably not currently being hit, because the SVG objects don't all have interfaces on the window or because it takes more effort to make one of these guys that simply iterating the window object. I would say r=me, but I think you should try and make a test first.
Comment 12 Eric Seidel (no email) 2009-12-21 22:16:16 PST
bug 20430 is the reason why so many SVG constructor objects are missing.  I really should finish the patch I started for that so long ago...
Comment 13 Nikolas Zimmermann 2010-01-21 17:31:23 PST
Created attachment 47164 [details]
Updated patch

Updated this patch against ToT.

I am working on further patches in that area, that will touch all JSSVGPOD* files (as I'm going to rewrite the ANIMATED_PROPERTY_* declaration macros for svg/). This patch is blocking my further work, I am unable to create a testcase, and I only did this patch to cleanup code, there is no bug about prototype chain problems, and I don't fully understand what this patch is supposed to fix - for me it's just cleanup :-)

Let's get this landed please, Sam was already okay with the code, just a testcase should be created. No one came up with a testcase, so please let's move forward even without a testcase.
Comment 14 Eric Seidel (no email) 2010-01-21 17:42:47 PST
Attachment 47164 [details] did not build on mac:
Build output: http://webkit-commit-queue.appspot.com/results/204409
Comment 15 Sam Weinig 2010-01-21 17:50:05 PST
(In reply to comment #13)
> Created an attachment (id=47164) [details]
> Updated patch
> 
> Updated this patch against ToT.
> 
> I am working on further patches in that area, that will touch all JSSVGPOD*
> files (as I'm going to rewrite the ANIMATED_PROPERTY_* declaration macros for
> svg/). This patch is blocking my further work, I am unable to create a
> testcase, and I only did this patch to cleanup code, there is no bug about
> prototype chain problems, and I don't fully understand what this patch is
> supposed to fix - for me it's just cleanup :-)
> 
> Let's get this landed please, Sam was already okay with the code, just a
> testcase should be created. No one came up with a testcase, so please let's
> move forward even without a testcase.

That is okay with me.  Creating the test case has been hard, but it is not crucial in this edge case.  I will continue to work on it for the time being.
Comment 16 Nikolas Zimmermann 2010-01-21 18:06:29 PST
(In reply to comment #14)
> Attachment 47164 [details] did not build on mac:
> Build output: http://webkit-commit-queue.appspot.com/results/204409

Hmm, is it really not building? The log is empty, and it worked for me - tried a from scratch build on Leopard.
Comment 17 Sam Weinig 2010-01-21 18:17:06 PST
Comment on attachment 47164 [details]
Updated patch

r=me assuming you make sure everything builds.
Comment 18 Nikolas Zimmermann 2010-01-21 18:20:11 PST
(In reply to comment #17)
> (From update of attachment 47164 [details])
> r=me assuming you make sure everything builds.

Thanks a lot! During the Xcode project updates, I forgot to say the "Private" role for JSSVGContextCache.h - now WebKit builds fine.
Comment 19 Nikolas Zimmermann 2010-01-21 18:25:58 PST
Landed in r53666.