New issue
Advanced search Search tips

Issue 875299 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

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:
 
test.html
203 bytes View Download
 Issue 875300  has been merged into this issue.
Components: -Blink Blink>JavaScript
Labels: Needs-Triage-M68
Cc: swarnasree.mukkala@chromium.org
Labels: Triaged-ET Target-70 M-70 FoundIn-70 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
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.!
Components: -Blink>JavaScript Blink
Components: -Blink Blink>DOM
Components: -Blink>DOM Blink>HTML
It looks document.lastModified is defined here:
https://html.spec.whatwg.org/#dom-document-lastmodified
Labels: -Arch-x86_64 -FoundIn-70 -Target-70 -M-70 -Needs-Triage-M68 Hotlist-GoodFirstBug
Status: Available (was: Untriaged)
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.
Owner: hs1217....@samsung.com
Status: Assigned (was: Available)
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?
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)
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