This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27817 - Value of lastModified probably shouldn't change during the lifetime of the document
Summary: Value of lastModified probably shouldn't change during the lifetime of the do...
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#sandbox...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-13 02:56 UTC by contributor
Modified: 2015-08-28 16:18 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2015-01-13 02:56:47 UTC
Specification: https://html.spec.whatwg.org/
Multipage: https://html.spec.whatwg.org/multipage/#sandboxCookies
Complete: https://html.spec.whatwg.org/#sandboxCookies
Referrer: 

Comment:
Value of lastModified probably shouldn't change during the lifetime of the
document

Posted from: 98.110.194.132
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:37.0) Gecko/20100101 Firefox/37.0
Comment 1 Boris Zbarsky 2015-01-13 02:57:24 UTC
In particular, the "current time" thing should be a snapshot taken at a well-defined point in document setup instead of having a lastModified that changes every time you access it.  In my opinion, of course.
Comment 2 Simon Pieters 2015-01-13 08:32:41 UTC
Why?
Comment 3 Boris Zbarsky 2015-01-13 13:20:22 UTC
Why which?  Why should it not change?

Conceptually, lastModified is when the HTML the browser is rendering was last modified.  This can obviously be sometime before the browser received the HTML, but, still conceptually, it can't be _after_ the browser has received it, because it's already received it.

So let me turn this around.  Why should this value possibly change during the document lifetime?  That's completely nonsensical behavior.
Comment 4 Simon Pieters 2015-01-13 15:37:28 UTC
(In reply to Boris Zbarsky from comment #3)
> Why which?  Why should it not change?

Right.

> Conceptually, lastModified is when the HTML the browser is rendering was
> last modified.  This can obviously be sometime before the browser received
> the HTML, but, still conceptually, it can't be _after_ the browser has
> received it, because it's already received it.
> 
> So let me turn this around.  Why should this value possibly change during
> the document lifetime?  That's completely nonsensical behavior.

It's what the majority of implementations do (WebKit/Blink/IE11/Presto). So it's a shorter path to interop for Gecko to change to match everyone else.

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3363
Comment 5 Boris Zbarsky 2015-01-13 15:48:31 UTC
That's fair, but it seems to me that converging on nonsensical behavior is not a success story, even if it achieves interop.

If we can't achieve interop in any other way, then maybe it's worth it.  But it's very definitely a tradeoff, and I'm not convinced we can't achieve interop in any other way.
Comment 6 Ian 'Hixie' Hickson 2015-01-13 23:10:58 UTC
lastModified is crazy town anyway. I would just pretend it wasn't there.
Comment 7 Boris Zbarsky 2015-01-14 02:15:03 UTC
I would totally love to do that, but people are insisting on writing test suites that test its behavior.
Comment 8 Simon Pieters 2015-01-14 09:29:16 UTC
(In reply to Boris Zbarsky from comment #5)
> That's fair, but it seems to me that converging on nonsensical behavior is
> not a success story, even if it achieves interop.

In this case I think both behaviors are basically not useful. The author wants the date when the document was actually last modified, not the current date and not the date when the document was loaded (nor the date when the server generated the page and put that in Last-Modified). So which we pick doesn't matter as far as usefulness of the API goes.
Comment 9 Ian 'Hixie' Hickson 2015-01-15 19:26:05 UTC
What do browsers do today, with respect to the issue in this bug?
Comment 10 Ian 'Hixie' Hickson 2015-01-15 19:27:22 UTC
Looking at the test in comment 4, it seems like the spec matches the majority of implementations already. I see no value in changing the spec here.
Comment 11 Boris Zbarsky 2015-01-15 19:43:44 UTC
OK.  I'm not going to waste more time on this; I guess we'll just update to the pointless behavior everyone else picked, yet again...