document.lastModified using html access time vs. actual html modified time
Reported by
mariajca...@gmail.com,
Aug 17
|
|||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
Steps to reproduce the problem:
Create the following html file and save locally. Open in both Chrome and IE to see behavior difference.
<html>
<head>
<title>test</title>
</head>
<body>
<script language="Javascript">
document.write("Last Modified on: " +document.lastModified +"");
</SCRIPT>
<p id="demo"></p>
</body>
</html>
What is the expected behavior?
I expect to see the timestamp for when the file was saved (aka, the actual last modified time of the html file).
What went wrong?
When opening in chrome it displays the CURRENT time (aka last accessed time).
Did this work before? N/A
Chrome version: 68.0.3440.106 Channel: stable
OS Version: 10.0
Flash Version:
,
Aug 18
,
Aug 19
,
Aug 21
Able to reproduce the issue on chrome version on #60.0.3072.0, on reported version #68.0.3440.106 and on latest chrome #70.0.3528.0 using Windows 10, Ubuntu 17.10 and Mac OS 10.13.1, by following the steps in comment#0. This is a non-regression issue observed from old M-60 builds ,hence marking it as untriaged and requesting dev team to look into the issue. Thanks.!
,
Aug 27
,
Aug 28
,
Aug 28
It looks document.lastModified is defined here: https://html.spec.whatwg.org/#dom-document-lastmodified
,
Aug 28
The spec says: > The Document's source file's last modification date and time must be derived from relevant features of the networking protocols used, e.g. from the value of the HTTP `Last-Modified` header of the document, or from metadata in the file system for local files. If the last modification date and time are not known, the attribute must return the current date and time in the above format. Given that, it looks we should return the last modification date and time from metadata in the file system for local files.
,
Aug 31
i will take this issue. and i have a question. what is best way to make test? is it possible to load page as a local filesystem(file://) in LayoutTests?
,
Sep 3
sorry. never mind my question. according to a LayoutTest documents, "By default, tests are loaded as if via file: URLs." (https://chromium.googlesource.com/chromium/src/+/master/docs/testing/writing_layout_tests.md)
,
Sep 13
i tried to make a layout tests. but when git patch applied, the last modification date and time of file also changed. it seems to hard to make a tests. :( |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by e...@chromium.org
, Aug 18