Bug 18362 - protocol 'data' does not change/clear the page title
Summary: protocol 'data' does not change/clear the page title
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-08 06:10 PDT by Ariya Hidayat
Modified: 2008-04-22 22:31 PDT (History)
2 users (show)

See Also:


Attachments
patch to clear the title when loading starts (1.93 KB, patch)
2008-04-08 07:46 PDT, Ariya Hidayat
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ariya Hidayat 2008-04-08 06:10:50 PDT
Steps to reproduce:
(1) Open any website, e.g. slashdot.org
(2) The title is changed
(3) Put the following in the URL 
  data:text/html,<form></form>
and after that press Enter

What happens:
The title does not change

Expected:
The title should be emptied.
Comment 1 Ariya Hidayat 2008-04-08 07:46:16 PDT
Created attachment 20405 [details]
patch to clear the title when loading starts

This is a potential (unfortunately, rather ugly) workaround. It ensures that the loader's client gets an empty string so that if there no <title> element in the document, the title which is displayed by the loader's client is properly cleared at the beginning.
Comment 2 mitz 2008-04-08 07:53:58 PDT
In Safari, the window title changes to the URL, so I am not sure why this patch is needed.
Comment 3 Ariya Hidayat 2008-04-08 08:00:16 PDT
> In Safari, the window title changes to the URL, so I am not sure why 
> this patch is needed.

I think it is Safari-specific.

It is debatable whether the title should change to an empty or the URL. But the point is that WebKit does not notify the loader/client that the currently loaded URI does not have a title.
Comment 4 Ariya Hidayat 2008-04-08 08:53:03 PDT
Another proposal for solution:

IF
(1) the document has no <title> nor JavaScript that sets the title
(2) the loader never calls dispatchDidReceiveTitle() of its client
(3) the document finished loading

THEN
before calling dispatchDidFinishLoading() of the loader's client, it should also call dispatchDidReceiveTitle() with an empty title.
Comment 5 mitz 2008-04-08 09:05:50 PDT
(In reply to comment #3)
> WebKit does not notify the loader/client that the currently
> loaded URI does not have a title.

It seems sensible to notify when something has changed. I am not sure what is the change reflected by the proposed notification.
Comment 6 Ariya Hidayat 2008-04-08 13:45:23 PDT
On #webkit, Mitz Pettel suggested that this should be taken care by the platform loader client, i.e. it should assume that the currently loaded URI/document has no title. IMO this is likely the optimal approach.
Comment 7 Maciej Stachowiak 2008-04-22 22:31:49 PDT
Comment on attachment 20405 [details]
patch to clear the title when loading starts

Removing review flag since the patch is apparently withdrawn.