OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 // The following code was pulled from WebFrame.mm:_loadURL, with minor | 1622 // The following code was pulled from WebFrame.mm:_loadURL, with minor |
1623 // modifications. The purpose is to ensure we load the right HistoryItem for | 1623 // modifications. The purpose is to ensure we load the right HistoryItem for |
1624 // this child frame. | 1624 // this child frame. |
1625 HistoryItem* parent_item = frame_->loader()->currentHistoryItem(); | 1625 HistoryItem* parent_item = frame_->loader()->currentHistoryItem(); |
1626 FrameLoadType load_type = frame_->loader()->loadType(); | 1626 FrameLoadType load_type = frame_->loader()->loadType(); |
1627 FrameLoadType child_load_type = WebCore::FrameLoadTypeRedirectWithLockedHistor
y; | 1627 FrameLoadType child_load_type = WebCore::FrameLoadTypeRedirectWithLockedHistor
y; |
1628 KURL new_url = request.resourceRequest().url(); | 1628 KURL new_url = request.resourceRequest().url(); |
1629 | 1629 |
1630 // If we're moving in the backforward list, we might want to replace the | 1630 // If we're moving in the backforward list, we might want to replace the |
1631 // content of this child frame with whatever was there at that point. | 1631 // content of this child frame with whatever was there at that point. |
1632 // Reload will maintain the frame contents, LoadSame will not. | |
1633 if (parent_item && parent_item->children().size() != 0 && | 1632 if (parent_item && parent_item->children().size() != 0 && |
1634 (isBackForwardLoadType(load_type) || | 1633 isBackForwardLoadType(load_type)) { |
1635 load_type == WebCore::FrameLoadTypeReloadAllowingStaleData)) { | |
1636 HistoryItem* child_item = parent_item->childItemWithName(request.frameName()
); | 1634 HistoryItem* child_item = parent_item->childItemWithName(request.frameName()
); |
1637 if (child_item) { | 1635 if (child_item) { |
1638 // Use the original URL to ensure we get all the side-effects, such as | 1636 // Use the original URL to ensure we get all the side-effects, such as |
1639 // onLoad handlers, of any redirects that happened. An example of where | 1637 // onLoad handlers, of any redirects that happened. An example of where |
1640 // this is needed is Radar 3213556. | 1638 // this is needed is Radar 3213556. |
1641 new_url = child_item->originalURL(); | 1639 new_url = child_item->originalURL(); |
1642 | |
1643 // These behaviors implied by these loadTypes should apply to the child | |
1644 // frames | |
1645 child_load_type = load_type; | 1640 child_load_type = load_type; |
1646 | 1641 child_frame->loader()->setProvisionalHistoryItem(child_item); |
1647 if (isBackForwardLoadType(load_type)) { | |
1648 // For back/forward, remember this item so we can traverse any child | |
1649 // items as child frames load. | |
1650 child_frame->loader()->setProvisionalHistoryItem(child_item); | |
1651 } else { | |
1652 // For reload, just reinstall the current item, since a new child frame | |
1653 // was created but we won't be creating a new BF item | |
1654 child_frame->loader()->setCurrentHistoryItem(child_item); | |
1655 } | |
1656 } | 1642 } |
1657 } | 1643 } |
1658 | 1644 |
1659 child_frame->loader()->loadURL(new_url, | 1645 child_frame->loader()->loadURL(new_url, |
1660 request.resourceRequest().httpReferrer(), | 1646 request.resourceRequest().httpReferrer(), |
1661 child_frame->tree()->name(), | 1647 child_frame->tree()->name(), |
1662 child_load_type, 0, 0); | 1648 child_load_type, 0, 0); |
1663 | 1649 |
1664 // A synchronous navigation (about:blank) would have already processed | 1650 // A synchronous navigation (about:blank) would have already processed |
1665 // onload, so it is possible for the frame to have already been destroyed by | 1651 // onload, so it is possible for the frame to have already been destroyed by |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1838 return password_listeners_.get(input_element); | 1824 return password_listeners_.get(input_element); |
1839 } | 1825 } |
1840 | 1826 |
1841 void WebFrameImpl::ClearPasswordListeners() { | 1827 void WebFrameImpl::ClearPasswordListeners() { |
1842 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); | 1828 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); |
1843 iter != password_listeners_.end(); ++iter) { | 1829 iter != password_listeners_.end(); ++iter) { |
1844 delete iter->second; | 1830 delete iter->second; |
1845 } | 1831 } |
1846 password_listeners_.clear(); | 1832 password_listeners_.clear(); |
1847 } | 1833 } |
OLD | NEW |