Bug 27586

Summary: URL appears in back/forward button menu instead of title for items with custom representation
Product: WebKit Reporter: Darin Adler <darin>
Component: HistoryAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
patch beidson: review+

Description Darin Adler 2009-07-22 16:44:35 PDT
To reproduce:

1. visit bookmarks
2. visit some other page
3. press and hold on the Back button in the location field

The menu contains "bookmarks:". It should contain "Bookmarks".

The history code expects that the DocumentLoader will store a copy of the title. This is subtly incompatible with having a title method on the representation -- we can ask what the title is, but we won't know when the title changes so we won't be able to update the title in the DocumentLoader.

Here are some ways to fix this:

    1) change the history item code to call via the client to get the title, so it can pass through the representation object in Mac WebKit

    2) have the WebDataSource call setTitle on the DocumentLoader, passing the current title from the representation, exactly once, after the representation gets its setDataSource: call

    3) same as (2), but after every method call from WebDataSource to the representation

    4) change the representation API so there's a setTitle: method on WebDataSource instead of a title method on the representation

I am planning to do (2) largely because we want to phase out this representation feature anyway.
Comment 1 Darin Adler 2009-07-22 16:44:45 PDT
<rdar://problem/5060337>
Comment 2 Darin Adler 2009-07-22 16:49:02 PDT
Created attachment 33307 [details]
patch
Comment 3 Brady Eidson 2009-07-22 18:14:12 PDT
Comment on attachment 33307 [details]
patch

Nice!