Changeset 67513 in webkit
- Timestamp:
- Sep 14, 2010 4:29:38 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r67512 r67513 1 2010-09-14 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 document.lastModified gives no output if the response doesn't have a Last-Modified header 6 https://bugs.webkit.org/show_bug.cgi?id=8475 7 8 * http/tests/misc/last-modified-parsing-expected.txt: Added. 9 * http/tests/misc/last-modified-parsing.html: Added. 10 - Tests some details of our date parsing and serialization. The 11 serialization format is kind of goofy, but that's what the spec 12 seems to want. 13 * http/tests/misc/no-last-modified-expected.txt: Added. 14 * http/tests/misc/no-last-modified.html: Added. 15 - Test was happens if the server doesn't send a Last-Modified 16 header. We're supposed to use the current date and time. 17 * http/tests/resources/last-modified.php: Added. 18 - PHP helper script. 19 1 20 2010-09-14 Adam Barth <abarth@webkit.org> 2 21 -
trunk/WebCore/ChangeLog
r67512 r67513 1 2010-09-14 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 document.lastModified gives no output if the response doesn't have a Last-Modified header 6 https://bugs.webkit.org/show_bug.cgi?id=8475 7 8 Implement document.lastModified as per HTML5. 9 10 Tests: http/tests/misc/last-modified-parsing.html 11 http/tests/misc/no-last-modified.html 12 13 * dom/Document.cpp: 14 (WebCore::Document::lastModified): 15 1 16 2010-09-14 Adam Barth <abarth@webkit.org> 2 17 -
trunk/WebCore/dom/Document.cpp
r67512 r67513 44 44 #include "CookieJar.h" 45 45 #include "CustomEvent.h" 46 #include "DateComponents.h" 46 47 #include "DOMImplementation.h" 47 48 #include "DOMWindow.h" … … 3612 3613 } 3613 3614 3615 // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified 3614 3616 String Document::lastModified() const 3615 3617 { 3616 Frame* f = frame(); 3617 if (!f) 3618 return String(); 3619 DocumentLoader* loader = f->loader()->documentLoader(); 3620 if (!loader) 3621 return String(); 3622 return loader->response().httpHeaderField("Last-Modified"); 3618 DateComponents date; 3619 bool foundDate = false; 3620 if (m_frame) { 3621 String httpLastModified = m_frame->loader()->documentLoader()->response().httpHeaderField("Last-Modified"); 3622 if (!httpLastModified.isEmpty()) { 3623 date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified)); 3624 foundDate = true; 3625 } 3626 } 3627 // FIXME: If this document came from the file system, the HTML5 3628 // specificiation tells us to read the last modification date from the file 3629 // system. 3630 if (!foundDate) 3631 date.setMillisecondsSinceEpochForDateTime(currentTimeMS()); 3632 return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, date.monthDay(), date.fullYear(), date.hour(), date.minute(), date.second()); 3623 3633 } 3624 3634
Note: See TracChangeset
for help on using the changeset viewer.