Empty title attribute should not show UA-provided tooltips
Reported by
bgros...@gmail.com,
Aug 8
|
||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36
Steps to reproduce the problem:
1. Create a webpage with an HTML element, such as <input type="file">
2. Load in Chrome, open Developer console
3. Try to set a new attribute on input to an empty string, such as: document.getElementsByTagName('input')[0].setAttribute("title","")
What is the expected behavior?
After running setAttribute(), the HTML should contain an attribute that looks like: title="", such that the new markup is:
<input type="file" title="">
What went wrong?
The empty string is ignored, and the markup produced is instead the following:
<input type="file" title>
In other words, it drops off the =""
Did this work before? N/A
Chrome version: 68.0.3440.84 Channel: n/a
OS Version: OS X 10.13.6
Flash Version: Shockwave Flash 30.0 r0
This works as expected in Firefox.
,
Aug 8
Ok. Perhaps I need to move this to a feature request? There are times when Chrome interprets title vs title="" differently. The <input type="file"> tag is a good example. If it has title, then Chrome creates its own tooltip for the element. If it has title="", then Chrome uses the empty string as the tooltip.
,
Aug 8
Following up, the spec says: Empty attribute syntax -- Just the attribute name. The value is implicitly the empty string. But in this case, Chrome is interpreting title differently than title="". This suggests the implicit value of title is not the same in both cases.
,
Aug 8
Since 'title' and 'title=""' are same as per HTML specification, it might make sense to submit a new bug report on Chrome's different handling of the tooltip, but that's for Chromium engineers to decide. BTW I don't see any difference in Windows - the standard tooltip is displayed in both cases as it should.
,
Aug 8
Thank you, that makes sense as a next step. And I now see I presumed my problem was the missing ="", but on the Mac I'm getting same behavior as you on Windows. Here's what I see: <input type="file"> ... produces a tooltip of "No file chosen" <input type="file" title> ... produces a tooltip of "No file chosen" <input type="file" title=""> ... produces a tooltip of "No file chosen" <input type="file" title="something"> ... produces a tooltip of "something" Given that title="something" produces a tooltip of "something" I would expect title="" to produce a tooltip of "", while an absent title attribute would lead Chrome to produce its own "No file chosen". I will file a new report re the tooltip handling--would this appropriately be a bug report or feature request? I'm guessing the latter.
,
Aug 9
,
Aug 9
As per comment #2 and #5, it seems to be a feature request. Hence, marking it as untriaged for further inputs from dev team. Thanks...!!
,
Aug 9
I'm pretty sure this is not Blink specific. The decision to what to show on tooltip is UI/Browser. Reassigning.
,
Aug 17
The default tooltip appears to be controlled here in blink: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/forms/file_input_type.cc?rcl=e6a59a6bf0c44a45fabe15389cd29373325eb4e8&l=413 kFileButtonNoFileSelectedLabel -> IDS_FORM_FILE_NO_FILE_LABEL -> "No file chosen"
,
Aug 18
,
Aug 23
The request sounds reasonable. The code is in blink::ChromeClient::SetToolTip().
,
Aug 23
Can I take a look at this issue?
,
Aug 24
donghee.na92@, please go ahead.
,
Aug 25
@tkent https://chromium-review.googlesource.com/c/chromium/src/+/1186930 CL is ready to review!
,
Aug 30
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6006113385396ec9d24faf9284756ea32cefd907 commit 6006113385396ec9d24faf9284756ea32cefd907 Author: Dong-hee Na <donghee.na92@gmail.com> Date: Thu Aug 30 08:34:53 2018 HTML: Fix tooltips with an empty title attribute Before this CL, the tooltip for an empty title attribute showed an element-specific default tooltip message like "No file chosen" for <input type=file>. But now it does not show any tooltip since the tooltip message is considered as "". The new behavior matches to Mozilla Firefox. Bug: 872413 Change-Id: I120a2bb7f9a6d244ceca660b79f9033e3a75af9e Reviewed-on: https://chromium-review.googlesource.com/1186930 Reviewed-by: Kent Tamura <tkent@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#587483} [modify] https://crrev.com/6006113385396ec9d24faf9284756ea32cefd907/content/test/test_blink_web_unit_test_support.cc [modify] https://crrev.com/6006113385396ec9d24faf9284756ea32cefd907/third_party/blink/renderer/core/page/chrome_client.cc [modify] https://crrev.com/6006113385396ec9d24faf9284756ea32cefd907/third_party/blink/renderer/core/page/chrome_client.h [modify] https://crrev.com/6006113385396ec9d24faf9284756ea32cefd907/third_party/blink/renderer/core/page/chrome_client_test.cc
,
Aug 30
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by woxxom@gmail.com
, Aug 8