RESOLVED FIXED 15494
SVGZoomAndPan constants are missing from window object
https://bugs.webkit.org/show_bug.cgi?id=15494
Summary SVGZoomAndPan constants are missing from window object
Eric Seidel (no email)
Reported 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++).
Attachments
Patch (18.30 KB, patch)
2012-05-19 11:38 PDT, Nikolas Zimmermann
no flags
Patch v2 (19.85 KB, patch)
2012-05-19 15:09 PDT, Nikolas Zimmermann
no flags
Patch v3 (33.66 KB, patch)
2012-05-22 02:44 PDT, Nikolas Zimmermann
no flags
Patch v4 (35.17 KB, patch)
2012-05-22 07:59 PDT, Nikolas Zimmermann
no flags
Patch v5 (35.80 KB, patch)
2012-05-22 08:58 PDT, Nikolas Zimmermann
no flags
Patch v6 (45.44 KB, patch)
2012-05-23 00:42 PDT, Nikolas Zimmermann
no flags
Patch v7 (45.44 KB, patch)
2012-05-23 01:40 PDT, Nikolas Zimmermann
rwlbuis: review+
Nikolas Zimmermann
Comment 1 2012-05-19 11:38:19 PDT
Early Warning System Bot
Comment 2 2012-05-19 11:53:31 PDT
Early Warning System Bot
Comment 3 2012-05-19 11:57:29 PDT
Gyuyoung Kim
Comment 4 2012-05-19 12:03:04 PDT
Build Bot
Comment 5 2012-05-19 12:05:36 PDT
WebKit Review Bot
Comment 6 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
Build Bot
Comment 7 2012-05-19 12:50:56 PDT
Build Bot
Comment 8 2012-05-19 13:11:58 PDT
Nikolas Zimmermann
Comment 9 2012-05-19 15:09:34 PDT
Created attachment 142883 [details] Patch v2
WebKit Review Bot
Comment 10 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
Build Bot
Comment 11 2012-05-19 15:36:37 PDT
Nikolas Zimmermann
Comment 12 2012-05-22 02:44:50 PDT
Created attachment 143244 [details] Patch v3
Build Bot
Comment 13 2012-05-22 03:13:32 PDT
Early Warning System Bot
Comment 14 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
Early Warning System Bot
Comment 15 2012-05-22 03:23:36 PDT
Build Bot
Comment 16 2012-05-22 03:54:17 PDT
WebKit Review Bot
Comment 17 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
Build Bot
Comment 18 2012-05-22 04:31:20 PDT
Nikolas Zimmermann
Comment 19 2012-05-22 07:59:37 PDT
Created attachment 143301 [details] Patch v4
Build Bot
Comment 20 2012-05-22 08:25:02 PDT
WebKit Review Bot
Comment 21 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
Nikolas Zimmermann
Comment 22 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.
Nikolas Zimmermann
Comment 23 2012-05-22 08:58:19 PDT
Created attachment 143311 [details] Patch v5
Build Bot
Comment 24 2012-05-22 09:20:53 PDT
Nikolas Zimmermann
Comment 25 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.
Nikolas Zimmermann
Comment 26 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.
Nikolas Zimmermann
Comment 27 2012-05-23 00:42:10 PDT
Created attachment 143488 [details] Patch v6
WebKit Review Bot
Comment 28 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
Nikolas Zimmermann
Comment 29 2012-05-23 01:40:04 PDT
Oops, still a typo in CodeGeneratorV8.pm, so good that we have the EWS :-)
Nikolas Zimmermann
Comment 30 2012-05-23 01:40:48 PDT
Created attachment 143499 [details] Patch v7
Hajime Morrita
Comment 31 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.
Nikolas Zimmermann
Comment 32 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.
Rob Buis
Comment 33 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.
Nikolas Zimmermann
Comment 34 2012-05-24 05:21:18 PDT
Jessie Berlin
Comment 35 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.
Nikolas Zimmermann
Comment 36 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.
Jessie Berlin
Comment 37 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.
Note You need to log in before you can comment on or make changes to this bug.