Bug 56195 - line 259 in svg/SVGElement.cpp fails to compile on Solaris10/SS12
Summary: line 259 in svg/SVGElement.cpp fails to compile on Solaris10/SS12
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Other
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-11 08:12 PST by Ben Taylor
Modified: 2011-03-19 06:09 PDT (History)
2 users (show)

See Also:


Attachments
Proposed patch which compiles correctly in qt-4.7.1 with webkit enabled on Solaris 10 with SS12 C++ compiler (1.41 KB, patch)
2011-03-12 07:12 PST, Ben Taylor
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Taylor 2011-03-11 08:12:49 PST
qt-everywhere-opensource-src-4.7.1/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp

Compiling qt-4.7.1 on Solaris 10 with a relatively patched Sun Studio 12 compiler

247 void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents)
248 {
249    RefPtr<SVGElement> currentTarget = this;
250    while (currentTarget && currentTarget->haveLoadedRequiredResources()) {
251        RefPtr<Node> parent;
252        if (sendParentLoadEvents)
253            parent = currentTarget->parentNode(); // save the next parent to dispatch too incase dispatching the event changes the tree
254        if (hasLoadListener(currentTarget.get())) {
255            RefPtr<Event> event = Event::create(eventNames().loadEvent, false, false);
256            event->setTarget(currentTarget);
257            currentTarget->dispatchGenericEvent(event.release());
258        }
259        currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast<SVGElement>(parent) : 0;
260     }
261 }

The error emitted by the compiler is:

"svg/SVGElement.cpp", line 259: Error: Ambiguous "?:" expression, second operand of type "WTF::RefPtr<WebCore::SVGElement>" and third operand of type "int" can be converted to one another.

This patch makes the compilation succeed.

--- qt-everywhere-opensource-src-4.7.1/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp.ORIG      2011-03-09 15:06:34.146973419 +0000
+++ qt-everywhere-opensource-src-4.7.1/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp   2011-03-09 14:40:15.952738383 +0000
@@ -256,7 +256,7 @@
             event->setTarget(currentTarget);
             currentTarget->dispatchGenericEvent(event.release());
         }
-        currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast<SVGElement>(parent) : 0;
+        currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast<SVGElement>(parent) : RefPtr<SVGElement>();
     }
 }
Comment 1 Nikolas Zimmermann 2011-03-12 02:07:30 PST
Can you submit a full patch please? http://www.webkit.org/coding/contributing.html
Flag it as r?, cq?, and I'll make sure it gets landed, thanks!
Comment 2 Ben Taylor 2011-03-12 07:12:52 PST
Created attachment 85592 [details]
Proposed patch which compiles correctly in qt-4.7.1 with webkit enabled on Solaris 10 with SS12 C++ compiler

This fix is against webkit head, but works for the webkit distributed with qt-4.7.1.  This fix is similar to one in bug 56198 which passed muster.
Comment 3 Nikolas Zimmermann 2011-03-19 04:42:44 PDT
Comment on attachment 85592 [details]
Proposed patch which compiles correctly in qt-4.7.1 with webkit enabled on Solaris 10 with SS12 C++ compiler

r=me, sorry for the delay, I've been ill.
Comment 4 WebKit Commit Bot 2011-03-19 06:09:14 PDT
Comment on attachment 85592 [details]
Proposed patch which compiles correctly in qt-4.7.1 with webkit enabled on Solaris 10 with SS12 C++ compiler

Clearing flags on attachment: 85592

Committed r81549: <http://trac.webkit.org/changeset/81549>
Comment 5 WebKit Commit Bot 2011-03-19 06:09:17 PDT
All reviewed patches have been landed.  Closing bug.