Bug 15494 - SVGZoomAndPan constants are missing from window object
Summary: SVGZoomAndPan constants are missing from window object
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nikolas Zimmermann
URL:
Keywords:
Depends on: 20430
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-13 21:54 PDT by Eric Seidel (no email)
Modified: 2012-05-25 09:07 PDT (History)
15 users (show)

See Also:


Attachments
Patch (18.30 KB, patch)
2012-05-19 11:38 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v2 (19.85 KB, patch)
2012-05-19 15:09 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v3 (33.66 KB, patch)
2012-05-22 02:44 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v4 (35.17 KB, patch)
2012-05-22 07:59 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v5 (35.80 KB, patch)
2012-05-22 08:58 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v6 (45.44 KB, patch)
2012-05-23 00:42 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v7 (45.44 KB, patch)
2012-05-23 01:40 PDT, Nikolas Zimmermann
rwlbuis: 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) 2007-10-13 21:54:47 PDT
SVGZoomAndPan constants are missing from window object

Unfortunately we can't just turn on "GeneratesContructor" for SVGZoomAndPan and have everything work right.  There need to be modifications to the autogen system to generate window properties which just define constants but don't actually let you construct them (because, as in this case, they're only virtual base classes in C++).
Comment 1 Nikolas Zimmermann 2012-05-19 11:38:19 PDT
Created attachment 142874 [details]
Patch
Comment 2 Early Warning System Bot 2012-05-19 11:53:31 PDT
Comment on attachment 142874 [details]
Patch

Attachment 142874 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/12727658
Comment 3 Early Warning System Bot 2012-05-19 11:57:29 PDT
Comment on attachment 142874 [details]
Patch

Attachment 142874 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/12730206
Comment 4 Gyuyoung Kim 2012-05-19 12:03:04 PDT
Comment on attachment 142874 [details]
Patch

Attachment 142874 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/12726769
Comment 5 Build Bot 2012-05-19 12:05:36 PDT
Comment on attachment 142874 [details]
Patch

Attachment 142874 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12733215
Comment 6 WebKit Review Bot 2012-05-19 12:08:21 PDT
Comment on attachment 142874 [details]
Patch

Attachment 142874 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12724837
Comment 7 Build Bot 2012-05-19 12:50:56 PDT
Comment on attachment 142874 [details]
Patch

Attachment 142874 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12730210
Comment 8 Build Bot 2012-05-19 13:11:58 PDT
Comment on attachment 142874 [details]
Patch

Attachment 142874 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12734206
Comment 9 Nikolas Zimmermann 2012-05-19 15:09:34 PDT
Created attachment 142883 [details]
Patch v2
Comment 10 WebKit Review Bot 2012-05-19 15:33:54 PDT
Comment on attachment 142883 [details]
Patch v2

Attachment 142883 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12734235
Comment 11 Build Bot 2012-05-19 15:36:37 PDT
Comment on attachment 142883 [details]
Patch v2

Attachment 142883 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12734236
Comment 12 Nikolas Zimmermann 2012-05-22 02:44:50 PDT
Created attachment 143244 [details]
Patch v3
Comment 13 Build Bot 2012-05-22 03:13:32 PDT
Comment on attachment 143244 [details]
Patch v3

Attachment 143244 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12759029
Comment 14 Early Warning System Bot 2012-05-22 03:15:14 PDT
Comment on attachment 143244 [details]
Patch v3

Attachment 143244 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/12733938
Comment 15 Early Warning System Bot 2012-05-22 03:23:36 PDT
Comment on attachment 143244 [details]
Patch v3

Attachment 143244 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/12736919
Comment 16 Build Bot 2012-05-22 03:54:17 PDT
Comment on attachment 143244 [details]
Patch v3

Attachment 143244 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12742559
Comment 17 WebKit Review Bot 2012-05-22 04:03:10 PDT
Comment on attachment 143244 [details]
Patch v3

Attachment 143244 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12738784
Comment 18 Build Bot 2012-05-22 04:31:20 PDT
Comment on attachment 143244 [details]
Patch v3

Attachment 143244 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12749280
Comment 19 Nikolas Zimmermann 2012-05-22 07:59:37 PDT
Created attachment 143301 [details]
Patch v4
Comment 20 Build Bot 2012-05-22 08:25:02 PDT
Comment on attachment 143301 [details]
Patch v4

Attachment 143301 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12748457
Comment 21 WebKit Review Bot 2012-05-22 08:45:44 PDT
Comment on attachment 143301 [details]
Patch v4

Attachment 143301 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12761060
Comment 22 Nikolas Zimmermann 2012-05-22 08:56:54 PDT
I think I finally found the V8 build problem, v5 should fix chromium. Speculative fix for the toJS() overload problem on win is included, let's see.
Comment 23 Nikolas Zimmermann 2012-05-22 08:58:19 PDT
Created attachment 143311 [details]
Patch v5
Comment 24 Build Bot 2012-05-22 09:20:53 PDT
Comment on attachment 143311 [details]
Patch v5

Attachment 143311 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12749354
Comment 25 Nikolas Zimmermann 2012-05-22 23:47:29 PDT
The win build makes me sad :(

4>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Debug\obj\WebCore\DerivedSources\JSSVGDocument.cpp(149) : error C2668: 'WebCore::toJS' : ambiguous call to overloaded function
4>        c:\cygwin\home\buildbot\webkit\webkitbuild\debug\obj\webcore\derivedsources\JSNode.h(111): could be 'JSC::JSValue WebCore::toJS(JSC::ExecState *,WebCore::JSDOMGlobalObject *,WebCore::Node *)'
4>        c:\cygwin\home\buildbot\webkit\webkitbuild\debug\obj\webcore\derivedsources\JSSVGZoomAndPan.h(88): or 'JSC::JSValue WebCore::toJS(JSC::ExecState *,WebCore::JSDOMGlobalObject *,WebCore::SVGZoomAndPan *)'
4>        while trying to match the argument list '(JSC::ExecState *, WebCore::JSDOMGlobalObject *, WebCore::SVGSVGElement *)'

It can't figure out if it's supposed to call toJS(Node*) or toJS(SVGZoomAndPan*) for a SVGSVGElement.
It doesn't clash with SVGFitToViewBox toJS, or SVGTests toJS, and I don't get that. It only complains that toJS(Node*) / toJS(SVGZoomAndPan*) clashes - why is that? :(

Here's the offending code from JSSVGDocument.cpp:

JSValue jsSVGDocumentRootElement(ExecState* exec, JSValue slotBase, PropertyName)
{
    JSSVGDocument* castedThis = jsCast<JSSVGDocument*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    SVGDocument* impl = static_cast<SVGDocument*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->rootElement()));
    return result;
}

Of course a static_cast would solve this, but I'd rather find the problem for real instead of adding work-arounds to CodeGeneratorJS.pm, just for win & SVGSVGElement.
Comment 26 Nikolas Zimmermann 2012-05-23 00:41:43 PDT
I've had a nice discussion with Hajime on IRC and the problem is nailed down. Patch v6 should hopefully work everywhere.
Comment 27 Nikolas Zimmermann 2012-05-23 00:42:10 PDT
Created attachment 143488 [details]
Patch v6
Comment 28 WebKit Review Bot 2012-05-23 01:28:32 PDT
Comment on attachment 143488 [details]
Patch v6

Attachment 143488 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12769140
Comment 29 Nikolas Zimmermann 2012-05-23 01:40:04 PDT
Oops, still a typo in CodeGeneratorV8.pm, so good that we have the EWS :-)
Comment 30 Nikolas Zimmermann 2012-05-23 01:40:48 PDT
Created attachment 143499 [details]
Patch v7
Comment 31 Hajime Morrita 2012-05-23 04:09:55 PDT
Comment on attachment 143499 [details]
Patch v7

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

> Source/WebCore/svg/SVGViewElement.h:44
> +    using SVGStyledElement::deref;

Do we need these?

> Source/WebCore/svg/SVGViewSpec.h:35
> +                    public SVGFitToViewBox {

Do we need this change?

> Source/WebCore/svg/SVGViewSpec.h:55
> +    void setZoomAndPan(unsigned short, ExceptionCode&);

It looks there is no implementation of this function.

> Source/WebCore/svg/SVGZoomAndPan.h:81
> +    // These are never called, and thus ASSERT_NOT_REACHED.

Maybe inlining help to save the code size.
Comment 32 Nikolas Zimmermann 2012-05-23 04:45:34 PDT
(In reply to comment #31)
> (From update of attachment 143499 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=143499&action=review
> 
> > Source/WebCore/svg/SVGViewElement.h:44
> > +    using SVGStyledElement::deref;
> 
> Do we need these?
Yes, SVGViewElement has ref/deref via SVGStyledElement inheritance (inherits from Node). SVGZoomAndPan also has ref/deref, but it's never used (can't be removed as the generated JSSVG* code depends on the existence of ref/deref).

> > Source/WebCore/svg/SVGViewSpec.h:35
> > +                    public SVGFitToViewBox {
> 
> Do we need this change?
Yes, it mimics the W3C IDL again - consider it a progression.

> 
> > Source/WebCore/svg/SVGViewSpec.h:55
> > +    void setZoomAndPan(unsigned short, ExceptionCode&);
> 
> It looks there is no implementation of this function.
There is:
NO_RETURN_DUE_TO_ASSERT void SVGZoomAndPan::setZoomAndPan(unsigned short)
It only exists so that we don't need to special case the CodeGenerators for SVGZoomAndPan.

> > Source/WebCore/svg/SVGZoomAndPan.h:81
> > +    // These are never called, and thus ASSERT_NOT_REACHED.
> 
> Maybe inlining help to save the code size.
Hm, does it really help? I usually don't inline without having checked it helps.
Comment 33 Rob Buis 2012-05-23 10:02:44 PDT
Comment on attachment 143499 [details]
Patch v7

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

Looks good! A welcome cleanup.

> Source/WebCore/ChangeLog:20
> +        MSVC can't decide wheteher it should call toJS(Node*) or toJS(SVGZoomAndPan*) for a SVGSVGElement.

Typo: whether.

> Source/WebCore/ChangeLog:26
> +

Maybe reference the test section here, why you do not need to add new tests.
Comment 34 Nikolas Zimmermann 2012-05-24 05:21:18 PDT
Committed r118353: <http://trac.webkit.org/changeset/118353>
Comment 35 Jessie Berlin 2012-05-24 08:42:23 PDT
(In reply to comment #34)
> Committed r118353: <http://trac.webkit.org/changeset/118353>

This broke the Mac tests:

http://build.webkit.org/results/Lion%20Debug%20(Tests)/r118365%20(6929)/fast/js/global-constructors-pretty-diff.html

I will check in updated results this time, but please watch the bots next time you make a change.
Comment 36 Nikolas Zimmermann 2012-05-25 03:37:58 PDT
(In reply to comment #35)
> (In reply to comment #34)
> > Committed r118353: <http://trac.webkit.org/changeset/118353>
> 
> This broke the Mac tests:
> 
> http://build.webkit.org/results/Lion%20Debug%20(Tests)/r118365%20(6929)/fast/js/global-constructors-pretty-diff.html
> 
> I will check in updated results this time, but please watch the bots next time you make a change.

Sorry Jessie! To my defense: as you can see the cr-linux EWS, which runs all tests, is green. I didn't realize fast/js/global-constructors.html is skipped for Chromium.
Comment 37 Jessie Berlin 2012-05-25 09:07:56 PDT
(In reply to comment #36)
> (In reply to comment #35)
> > (In reply to comment #34)
> > > Committed r118353: <http://trac.webkit.org/changeset/118353>
> > 
> > This broke the Mac tests:
> > 
> > http://build.webkit.org/results/Lion%20Debug%20(Tests)/r118365%20(6929)/fast/js/global-constructors-pretty-diff.html
> > 
> > I will check in updated results this time, but please watch the bots next time you make a change.
> 
> Sorry Jessie! To my defense: as you can see the cr-linux EWS, which runs all tests, is green. I didn't realize fast/js/global-constructors.html is skipped for Chromium.

Now that we have the Mac Lion bots green (or pretty close to green at any given time), please try to look at them as well *after* you commit.