Summary: | history.pushState / replaceState's title parameter is unsatisfactory | ||
---|---|---|---|
Product: | WebKit | Reporter: | Justin Lebar <justin.lebar+bug> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | beidson, darin, eric |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Description
Justin Lebar
2010-08-09 10:10:05 PDT
At some point webkit started respecting the title parameter... I'm not sure when. FF also did. AFAICT (and I wrote this code) Firefox does not respect the title parameter. Notice that the |aTitle| parameter is not used anywhere in this function. http://hg.mozilla.org/mozilla-central/file/c4de6de47382/docshell/base/nsDocShell.cpp#l10132 Sorry, I started using History.js and that must have "Fixed" this bug for me. Apologies for the confusion: https://github.com/balupton/History.js/ It appears that we store the title information in our HistoryItems, but must not use it on restore: http://trac.webkit.org/browser/trunk/Source/WebCore/loader/HistoryController.cpp#L862 I'm not particularly familiar with the history sub-system, and am no on my work computer with a checkout atm. :) So... we clearly use it as Eric spotted. What is the bug? Please don't point to outside sources - Attach an example with a step to reproduce that still repros in a WebKit nightly. (In reply to comment #5) > So... we clearly use it as Eric spotted. What is the bug? > > Please don't point to outside sources - Attach an example with a step to reproduce that still repros in a WebKit nightly. The point of this request being if you cannot attach an example because nothing still reproduces, we can close this bug instead. I think Justin's original request was to either remove or fix the title parameter. My understanding is that WebKit (in agreement with Mozilla) ignores title parameter, despite having it plumbed through the history system. I believe Justin is mostly sad about this ugly pushState API with an ignored parameter, which we presumably will never change to not ignore its second argument. > I believe Justin is mostly sad about this ugly pushState API with an ignored
> parameter, which we presumably will never change to not ignore its second
> argument.
That's a pretty good description of how I feel. :)
I think we can close this bug, though, because like you say, we're presumably never going to be able to change this.
Saying that the parameter is ignored now doesn't mean it will always be ignored. Display of the title parameter is an individual user-agent concern more than a web engine concern. Thanks for the feedback that you'd like it not to be ignored. I can tell you from personal experiance, that I switched a web app of mine from using history.pushState directly to History.js and was very surprised to see the title being respected (and thus the title of my app being reset to default). I previously had used "" for the title parameter. Mozilla's docs even recommend using "": https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history#The_pushState().C2.A0method But doing so with Hisotry.js causes clearing of the title (where in Moz/WebKit it's ignored). I guess what I'm saying is that we are likely stuck ignoring it (or at least ignoring "") in the future, as I'm sure much larger web apps than mine, may be depending on ignoring the title attribute now. :) (The fact that History.js doesn't ignore "" for backwards compat with mozilla's docs seems like a bug here too.) |