Bug 48469 - Convert SVGAnimatedBoolean to the new SVGAnimatedPropertyTearOff concept
Summary: Convert SVGAnimatedBoolean to the new SVGAnimatedPropertyTearOff concept
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:
Depends on:
Blocks: 47905
  Show dependency treegraph
 
Reported: 2010-10-27 14:35 PDT by Nikolas Zimmermann
Modified: 2010-10-29 03:43 PDT (History)
8 users (show)

See Also:


Attachments
Patch (59.50 KB, patch)
2010-10-27 15:30 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v2 (59.61 KB, patch)
2010-10-27 15:36 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v3 (62.55 KB, patch)
2010-10-28 03:48 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v4 (63.35 KB, patch)
2010-10-28 05:33 PDT, Nikolas Zimmermann
krit: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolas Zimmermann 2010-10-27 14:35:59 PDT
Converting SVGAnimatedBoolean is trivial, but it needs a new type: SVGAnimatedStaticPropertyTearOff, which is used for properties that don't create tear offs when accessing baseVal/animVal.
For example with SVGLength you can do:
var foo = rect.x.baseVal; // SVGRectElement -> SVGAnimatedLength -> SVGLength
foo.value = 50;

In this case a SVGAnimatedPropertyTearOff is created, and a SVGPropertyTearOff to represent the SVGLength.

For SVGExternalResourcesRequired (one of the two SVGAnimatedBoolean types), this is not possible, as baseVal returns a POD type (boolean).
var blub = rect.externalResourcesRequired.baseVal; // blub is a boolean
blub = false; // does NOT effect the rect.externalResourcesRequired object

The old concept used JSSVGStaticPODTypeWrapper for these types, we need something similar in the new concept, called SVGAnimatedStaticPropertyTearOff.
Comment 1 Nikolas Zimmermann 2010-10-27 15:30:18 PDT
Created attachment 72096 [details]
Patch

Did not test on a local chrome build, let's wait for EWS to see whether it builds. But the CodeGenerator changes are trivial this time, so the likelihood is large, that it may just work.
Comment 2 WebKit Review Bot 2010-10-27 15:34:16 PDT
Attachment 72096 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/svg/SVGScriptElement.h:26:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 52 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Nikolas Zimmermann 2010-10-27 15:36:47 PDT
Created attachment 72097 [details]
Patch v2

Fix style issue.
Comment 4 Eric Seidel (no email) 2010-10-27 19:20:06 PDT
Attachment 72097 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/4850045
Comment 5 WebKit Review Bot 2010-10-27 23:19:14 PDT
Attachment 72097 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/4789056
Comment 6 Nikolas Zimmermann 2010-10-28 03:48:38 PDT
Created attachment 72167 [details]
Patch v3

Need to apply the same fix as ObjC received to V8, to avoid including "V8boolean.h".
Comment 7 Early Warning System Bot 2010-10-28 04:19:57 PDT
Attachment 72167 [details] did not build on qt:
Build output: http://queues.webkit.org/results/4837054
Comment 8 Nikolas Zimmermann 2010-10-28 05:33:18 PDT
Created attachment 72174 [details]
Patch v4

Oops, fix some last minute changes that broke the build. Reattaching a working version, tested a local mac leopard debug build, zero regressions.
Comment 9 Eric Seidel (no email) 2010-10-28 06:09:13 PDT
Attachment 72167 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/4846067
Comment 10 Eric Seidel (no email) 2010-10-28 06:27:01 PDT
Attachment 72167 [details] did not build on mac:
Build output: http://queues.webkit.org/results/4800064
Comment 11 Dirk Schulze 2010-10-28 07:16:55 PDT
(In reply to comment #10)
> Attachment 72167 [details] did not build on mac:
> Build output: http://queues.webkit.org/results/4800064

But you build it without regressions on Mac ;-)
Comment 12 Dirk Schulze 2010-10-28 07:25:09 PDT
Comment on attachment 72174 [details]
Patch v4

View in context: https://bugs.webkit.org/attachment.cgi?id=72174&action=review

Looks great, waiting for mac and chromium bots before I review it. (If no one else beats me)

> WebCore/svg/properties/SVGAnimatedProperty.h:-88
> -    RefPtr<SVGProperty> m_baseVal;
> -    RefPtr<SVGProperty> m_animVal;

I guess you moved this out, because animatedStaticPro doesn't need it.
Comment 13 Nikolas Zimmermann 2010-10-28 13:00:04 PDT
(In reply to comment #12)
> (From update of attachment 72174 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=72174&action=review
> 
> Looks great, waiting for mac and chromium bots before I review it. (If no one else beats me)
> 
> > WebCore/svg/properties/SVGAnimatedProperty.h:-88
> > -    RefPtr<SVGProperty> m_baseVal;
> > -    RefPtr<SVGProperty> m_animVal;
> 
> I guess you moved this out, because animatedStaticPro doesn't need it.
Yes, exactly - mac bot worked fine, and cr-mac as well.
Comment 14 Nikolas Zimmermann 2010-10-28 13:01:41 PDT
(In reply to comment #11)
> (In reply to comment #10)
> > Attachment 72167 [details] [details] did not build on mac:
> > Build output: http://queues.webkit.org/results/4800064
> 
> But you build it without regressions on Mac ;-)

Yes, if you look closer, that's the result from the last patch v3, not patch v4.
Comment 15 Dirk Schulze 2010-10-28 13:27:13 PDT
Comment on attachment 72174 [details]
Patch v4

r=me
Comment 16 Nikolas Zimmermann 2010-10-29 02:55:16 PDT
Landed in r70857. Waiting for bots before closing bug.
Comment 17 Nikolas Zimmermann 2010-10-29 03:32:59 PDT
(In reply to comment #16)
> Landed in r70857. Waiting for bots before closing bug.

Forgot to remove an alert() from LayoutTests/svg/dom/SVGScriptElement/resources/script-load4.js before landing, fixed in r70860.
Comment 18 WebKit Review Bot 2010-10-29 03:43:37 PDT
http://trac.webkit.org/changeset/70857 might have broken Qt Linux Release