Bug 264702

Summary: Handle empty title attribute tooltips
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, annevk, karlcow, mike, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2023-11-12 05:18:44 PST
Hi Team,

While going through Blink's commit, I came across another potential merge and to fix the bugs.

Blink Commit: https://chromium.googlesource.com/chromium/blink/+/a57f7f4625cd5d699a41154c67436ae423f7a5e1

WebKit Source: https://searchfox.org/wubkat/rev/6e975c79b0d4766d80b0421a6dedeae64ca84b63/Source/WebCore/rendering/HitTestResult.cpp#281

Test Case: https://jsfiddle.net/2fsd1La3/

^ hover on 'PageTitle' and you will get tooltip while if you hover on 'span element..', in STP182, you will get parent's tooltip. While Chrome Canary 121 and Firefox Nightly 121 does not show parent's tooltip.

Just wanted to raise and fix it.

Thanks!
Comment 1 Ahmad Saleem 2023-11-12 05:21:14 PST
Web-Spec: https://html.spec.whatwg.org/#the-title-attribute

The advisory information of an element is the value that the following algorithm returns, with the algorithm being aborted once a value is returned. When the algorithm returns the empty string, then there is no advisory information.

If the element has a title attribute, then return its value.

If the element has a parent element, then return the parent element's advisory information.

Return the empty string.
Comment 2 Ahmad Saleem 2023-11-16 01:13:01 PST
@Aditya - do we have any 'test mechanism' for 'tooltips' like Blink / Chromium in WebKit?

The attached test from PR or from source.chromium.org does not work 1-1 in WebKit and also I checked WPT, if we have any similar test (which we might be failing etc.).

In local testing, this PR does fix the issue in Test Case from Comment 0.
Comment 3 Radar WebKit Bug Importer 2023-11-19 05:19:14 PST
<rdar://problem/118619793>
Comment 4 Ahmad Saleem 2024-01-04 15:31:15 PST
PR - https://github.com/WebKit/WebKit/pull/22403

Manage to make test. Yuppee!!
Comment 5 EWS 2024-01-04 18:50:02 PST
Committed 272667@main (e7d1f5b567cb): <https://commits.webkit.org/272667@main>

Reviewed commits have been landed. Closing PR #22403 and removing active labels.