Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: Source/WebCore/history/HistoryItem.cpp

Issue 10918017: Merge 126839 - REGRESSION(r109480): Form state for iframe content is not restored (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/history/HistoryItem.h ('k') | Source/WebCore/loader/HistoryController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 bool HistoryItem::hasChildren() const 525 bool HistoryItem::hasChildren() const
526 { 526 {
527 return !m_children.isEmpty(); 527 return !m_children.isEmpty();
528 } 528 }
529 529
530 void HistoryItem::clearChildren() 530 void HistoryItem::clearChildren()
531 { 531 {
532 m_children.clear(); 532 m_children.clear();
533 } 533 }
534 534
535 bool HistoryItem::isAncestorOf(const HistoryItem* item) const
536 {
537 for (size_t i = 0; i < m_children.size(); ++i) {
538 HistoryItem* child = m_children[i].get();
539 if (child == item)
540 return true;
541 if (child->isAncestorOf(item))
542 return true;
543 }
544 return false;
545 }
546
535 // We do same-document navigation if going to a different item and if either of the following is true: 547 // We do same-document navigation if going to a different item and if either of the following is true:
536 // - The other item corresponds to the same document (for history entries create d via pushState or fragment changes). 548 // - The other item corresponds to the same document (for history entries create d via pushState or fragment changes).
537 // - The other item corresponds to the same set of documents, including frames ( for history entries created via regular navigation) 549 // - The other item corresponds to the same set of documents, including frames ( for history entries created via regular navigation)
538 bool HistoryItem::shouldDoSameDocumentNavigationTo(HistoryItem* otherItem) const 550 bool HistoryItem::shouldDoSameDocumentNavigationTo(HistoryItem* otherItem) const
539 { 551 {
540 if (this == otherItem) 552 if (this == otherItem)
541 return false; 553 return false;
542 554
543 if (stateObject() || otherItem->stateObject()) 555 if (stateObject() || otherItem->stateObject())
544 return documentSequenceNumber() == otherItem->documentSequenceNumber(); 556 return documentSequenceNumber() == otherItem->documentSequenceNumber();
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 } // namespace WebCore 884 } // namespace WebCore
873 885
874 #ifndef NDEBUG 886 #ifndef NDEBUG
875 887
876 int showTree(const WebCore::HistoryItem* item) 888 int showTree(const WebCore::HistoryItem* item)
877 { 889 {
878 return item->showTree(); 890 return item->showTree();
879 } 891 }
880 892
881 #endif 893 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/history/HistoryItem.h ('k') | Source/WebCore/loader/HistoryController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698