RESOLVED FIXED 47669
Title-Element has no popup on <svg>-Elements, but on <g>
https://bugs.webkit.org/show_bug.cgi?id=47669
Summary Title-Element has no popup on <svg>-Elements, but on <g>
Holger Jeromin
Reported 2010-10-14 07:02:32 PDT
Created attachment 70736 [details] SVG Demo for a title in svg and g element The standard http://www.w3.org/TR/SVG/struct.html#DescriptionAndTitleElements defines: "Each container element [...] in an SVG drawing can supply [...] a ‘title’ description string" where http://www.w3.org/TR/SVG/intro.html#TermContainerElement defines an container element as "Specifically: ‘a’, ‘defs’, ‘glyph’, ‘g’, ‘marker’, ‘mask’, ‘missing-glyph’, ‘pattern’, ‘svg’, ‘switch’ and ‘symbol’." However a title element is only rendered as a popup at mouseover in <g>, but not in a <svg> Element as you can see in the attached demo.
Attachments
SVG Demo for a title in svg and g element (524 bytes, image/svg+xml)
2010-10-14 07:02 PDT, Holger Jeromin
no flags
SVG Demo for a title in root svg, svg and g element (728 bytes, image/svg+xml)
2010-10-14 23:43 PDT, Holger Jeromin
no flags
Trivial patch (1.72 KB, patch)
2010-10-16 09:14 PDT, Rob Buis
zimmermann: review+
Andreas Kling
Comment 1 2010-10-14 07:18:33 PDT
From SVGStyledElement::title() in WebCore/svg/SVGStyledElement.cpp: // According to spec, we should not return titles when hovering over <svg> elements (those // <title> elements are the title of the document, not a tooltip) so we instantly return. if (hasTagName(SVGNames::svgTag)) return String();
Holger Jeromin
Comment 2 2010-10-14 07:56:03 PDT
(In reply to comment #1) > From SVGStyledElement::title() in WebCore/svg/SVGStyledElement.cpp: > // According to spec, we should not return titles when hovering over <svg> elements (those > // <title> elements are the title of the document, not a tooltip) so we instantly return. > if (hasTagName(SVGNames::svgTag)) > return String(); I see. I have not found this spec, but the title could not be the title of the document, if they are nested. The SVG Spec only references to the "outermost svg element".
Holger Jeromin
Comment 3 2010-10-14 23:43:25 PDT
Created attachment 70836 [details] SVG Demo for a title in root svg, svg and g element
Holger Jeromin
Comment 4 2010-10-14 23:46:19 PDT
(In reply to comment #2) > (In reply to comment #1) > > From SVGStyledElement::title() in WebCore/svg/SVGStyledElement.cpp: > > // According to spec, we should not return titles when hovering over <svg> elements (those > > // <title> elements are the title of the document, not a tooltip) so we instantly return. > > if (hasTagName(SVGNames::svgTag)) > > return String(); > > I see. > > I have not found this spec, but the title could not be the title of the document, if they are nested. The SVG Spec only references to the "outermost svg element". Firefox 4 shows the tooltip on svg-elements, but not on the outmost svg https://bugzilla.mozilla.org/show_bug.cgi?id=547854 Uploaded a new testcase.
Rob Buis
Comment 5 2010-10-16 09:14:17 PDT
Created attachment 70957 [details] Trivial patch
Rob Buis
Comment 6 2010-10-16 09:15:59 PDT
I uploaded a trivial patch to provide behaviour such as FireFox 4. I waited with the testcase implementation(which should be easy by just checking the title attribute) because for instance Opera does not give a tooltip for svg elements either. Cheers, Rob.
Andreas Kling
Comment 7 2010-10-16 09:20:36 PDT
Comment on attachment 70957 [details] Trivial patch View in context: https://bugs.webkit.org/attachment.cgi?id=70957&action=review > WebCore/svg/SVGStyledElement.cpp:72 > + SVGSVGElement* svg = static_cast<SVGSVGElement*>(const_cast<SVGStyledElement*>(this)); Would read better like this IMO: const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(this);
Holger Jeromin
Comment 8 2010-10-26 01:01:33 PDT
(In reply to comment #6) > I uploaded a trivial patch to provide behaviour such as FireFox 4. I waited with the testcase implementation(which should be easy by just checking the title attribute) because for instance Thanks. It would be very nice, if this changes would land in the webkit source. > Opera does not give a tooltip for svg elements either. I filed a bug in the opera bug wizard (DSK-316141) as well as in Microsoft Connect https://connect.microsoft.com/IE/feedback/details/614675/title-element-has-no-tooltip-on-svg-elements Perhaps it is too late for IE9 since MS marked the beta as feature complete. Holger
Nikolas Zimmermann
Comment 9 2010-10-26 12:47:45 PDT
Comment on attachment 70957 [details] Trivial patch Looks fine, r=me but Andreas suggestion is correct.
Eric Seidel (no email)
Comment 10 2010-11-10 14:13:33 PST
Attachment 70957 [details] was posted by a committer and has review+, assigning to Rob Buis for commit.
Rob Buis
Comment 11 2010-11-10 23:06:38 PST
Hi Eric, (In reply to comment #10) > Attachment 70957 [details] was posted by a committer and has review+, assigning to Rob Buis for commit. This was landed in r70617, I guess I forgot to close, doing that now :) Cheers, Rob.
Note You need to log in before you can comment on or make changes to this bug.