OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
(...skipping 4648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4659 | 4659 |
4660 // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified | 4660 // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified |
4661 String Document::lastModified() const { | 4661 String Document::lastModified() const { |
4662 DateComponents date; | 4662 DateComponents date; |
4663 bool foundDate = false; | 4663 bool foundDate = false; |
4664 if (m_frame) { | 4664 if (m_frame) { |
4665 if (DocumentLoader* documentLoader = loader()) { | 4665 if (DocumentLoader* documentLoader = loader()) { |
4666 const AtomicString& httpLastModified = | 4666 const AtomicString& httpLastModified = |
4667 documentLoader->response().httpHeaderField(HTTPNames::Last_Modified); | 4667 documentLoader->response().httpHeaderField(HTTPNames::Last_Modified); |
4668 if (!httpLastModified.isEmpty()) { | 4668 if (!httpLastModified.isEmpty()) { |
4669 date.setMillisecondsSinceEpochForDateTime( | 4669 double dateValue = parseDate(httpLastModified); |
4670 convertToLocalTime(parseDate(httpLastModified))); | 4670 if (!std::isnan(dateValue)) { |
4671 foundDate = true; | 4671 date.setMillisecondsSinceEpochForDateTime( |
| 4672 convertToLocalTime(dateValue)); |
| 4673 foundDate = true; |
| 4674 } |
4672 } | 4675 } |
4673 } | 4676 } |
4674 } | 4677 } |
4675 // FIXME: If this document came from the file system, the HTML5 | 4678 // FIXME: If this document came from the file system, the HTML5 |
4676 // specificiation tells us to read the last modification date from the file | 4679 // specificiation tells us to read the last modification date from the file |
4677 // system. | 4680 // system. |
4678 if (!foundDate) | 4681 if (!foundDate) |
4679 date.setMillisecondsSinceEpochForDateTime( | 4682 date.setMillisecondsSinceEpochForDateTime( |
4680 convertToLocalTime(currentTimeMS())); | 4683 convertToLocalTime(currentTimeMS())); |
4681 return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, | 4684 return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, |
(...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6588 } | 6591 } |
6589 | 6592 |
6590 void showLiveDocumentInstances() { | 6593 void showLiveDocumentInstances() { |
6591 WeakDocumentSet& set = liveDocumentSet(); | 6594 WeakDocumentSet& set = liveDocumentSet(); |
6592 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6595 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6593 for (blink::Document* document : set) | 6596 for (blink::Document* document : set) |
6594 fprintf(stderr, "- Document %p URL: %s\n", document, | 6597 fprintf(stderr, "- Document %p URL: %s\n", document, |
6595 document->url().getString().utf8().data()); | 6598 document->url().getString().utf8().data()); |
6596 } | 6599 } |
6597 #endif | 6600 #endif |
OLD | NEW |