Closed Bug 218938 Opened 21 years ago Closed 21 years ago

document.lastModified returns current time for local file

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: harunaga, Assigned: keeda)

Details

(Keywords: regression)

Attachments

(1 file)

document.lastModified returns the current time for a local file on Mozilla 1.4b or later. This is introduced by Bug 116598. Steps: 1. Make html file like as follows. <script type="text/javascript"> <!-- document.write(document.lastModified); // --> </script> 2. Open the local file. Actual: document.lastModified returns the current time. Expected: document.lastModified should return the last modified time like as IE and NN 4.x. Related to Bug 36681.
+ if (mLastModified.IsEmpty()) { + modDate = PR_Now(); + } This should be done if modDate == LL_ZERO, not if mLastModified.IsEmpty() (which it always is), no?
Attached patch FixSplinter Review
mLastModified will not be empty if the channel was a http channel and it had a last modified header. I think this is the correct fix.
Attachment #131326 - Flags: superreview?(bz-vacation)
Attachment #131326 - Flags: review?(caillon)
Comment on attachment 131326 [details] [diff] [review] Fix sr=bzbarsky
Attachment #131326 - Flags: superreview?(bz-vacation) → superreview+
Comment on attachment 131326 [details] [diff] [review] Fix r/sr=jst, duh! :-)
Attachment #131326 - Flags: review?(caillon) → review+
Taking
Assignee: dom_bugs → keeda
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: