Summary: | Title-Element has no popup on <svg>-Elements, but on <g> | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Holger Jeromin <bugzillawebkit> | ||||||||
Component: | SVG | Assignee: | Rob Buis <rwlbuis> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | eric, kling, mdelaney7, rwlbuis, zimmermann | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Attachments: |
|
Description
Holger Jeromin
2010-10-14 07:02:32 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(); (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". Created attachment 70836 [details]
SVG Demo for a title in root svg, svg and g element
(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. Created attachment 70957 [details]
Trivial patch
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. 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); (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 Comment on attachment 70957 [details]
Trivial patch
Looks fine, r=me but Andreas suggestion is correct.
Attachment 70957 [details] was posted by a committer and has review+, assigning to Rob Buis for commit.
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. |