Changeset 30549 in webkit
- Timestamp:
- Feb 24, 2008, 12:30:32 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r30530 r30549 1 2008-02-24 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - test for http://bugs.webkit.org/show_bug.cgi?id=16770 6 Acid3 expects :visited styled links to restyle on iframe load 7 8 * fast/history/resources/subframe.html: Added. 9 * fast/history/subframe-is-visited-expected.txt: Added. 10 * fast/history/subframe-is-visited.html: Added. 11 1 12 2008-02-23 Dan Bernstein <mitz@apple.com> 2 13 -
trunk/WebCore/ChangeLog
r30547 r30549 1 2008-02-24 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=16770 6 Acid3 expects :visited styled links to restyle on iframe load 7 8 Disentangle global history updating from the back/forward history. 9 There are many cases where we don't want to create a new back/forward 10 item, but we do still want to add to the global history (used for visited 11 link coloring) in those cases. 12 13 Test: fast/history/subframe-is-visited.html 14 15 * loader/FrameLoader.cpp: 16 (WebCore::FrameLoader::updateGlobalHistory): Renamed from 17 addHistoryForCurrentLocation and removed the back/forward handling. 18 (WebCore::FrameLoader::updateHistoryForStandardLoad): Streamlined logic a 19 bit. Replaced call to addHistoryForCurrentLocation with a call to 20 addBackForwardItemClippedAtTarget. Added an unconditional call to 21 updateGlobalHistory. 22 (WebCore::FrameLoader::updateHistoryForClientRedirect): Added a FIXME; 23 why doesn't this function update global history? 24 (WebCore::FrameLoader::updateHistoryForBackForwardNavigation): Ditto. 25 (WebCore::FrameLoader::updateHistoryForReload): Replaced the direct call 26 the client with a call to the new updateGlobalHistory function. 27 (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory): Did 28 the same changes as for updateHistoryForStandardLoad. 29 * loader/FrameLoader.h: More of the same. 30 31 * loader/FrameLoaderClient.h: Removed updateGlobalHistoryForReload and 32 renamed updateGlobalHistoryForStandardLoad to updateGlobalHistory. 33 34 * svg/graphics/SVGImageEmptyClients.h: 35 (WebCore::SVGEmptyFrameLoaderClient::updateGlobalHistory): Updated to 36 match the above. 37 1 38 2008-02-23 Darin Adler <darin@apple.com> 2 39 -
trunk/WebCore/loader/FrameLoader.cpp
r30443 r30549 2352 2352 } 2353 2353 2354 if (!targetFrame->settings()->privateBrowsingEnabled()) { 2354 Settings* settings = targetFrame->settings(); 2355 if (settings && !settings->privateBrowsingEnabled()) { 2355 2356 Document* targetDocument = targetFrame->document(); 2356 2357 // FIXME: this error message should contain more specifics of why the navigation change is not allowed. … … 4224 4225 } 4225 4226 4226 void FrameLoader::addHistoryForCurrentLocation() 4227 { 4228 if (!m_frame->settings()->privateBrowsingEnabled()) { 4229 // FIXME: <rdar://problem/4880065> - This will be a hook into the WebCore global history, and this loader/client call will be removed 4230 m_client->updateGlobalHistoryForStandardLoad(documentLoader()->urlForHistory()); 4231 } 4232 addBackForwardItemClippedAtTarget(true); 4227 void FrameLoader::updateGlobalHistory() 4228 { 4229 Settings* settings = m_frame->settings(); 4230 if (!settings) 4231 return; 4232 if (settings->privateBrowsingEnabled()) 4233 return; 4234 const KURL& url = documentLoader()->urlForHistory(); 4235 if (url.isEmpty()) 4236 return; 4237 m_client->updateGlobalHistory(url); 4233 4238 } 4234 4239 … … 4237 4242 LOG(History, "WebCoreHistory: Updating History for Standard Load in frame %s", documentLoader()->url().string().ascii().data()); 4238 4243 4239 bool frameNavigationOnLoad = false; 4240 4241 // if the navigation occured during on load and this is a subframe 4242 // update the current history item rather than adding a new one 4243 // <rdar://problem/5333496> 4244 // If the navigation occured during load and this is a subframe, update the current 4245 // history item rather than adding a new one. <rdar://problem/5333496> 4246 bool frameNavigationDuringLoad = false; 4244 4247 if (m_navigationDuringLoad) { 4245 4248 HTMLFrameOwnerElement* owner = m_frame->ownerElement(); 4246 frameNavigationOnLoad = owner && !owner->createdByParser(); 4247 } 4248 4249 if (!frameNavigationOnLoad && !documentLoader()->isClientRedirect()) { 4249 frameNavigationDuringLoad = owner && !owner->createdByParser(); 4250 m_navigationDuringLoad = false; 4251 } 4252 4253 if (!frameNavigationDuringLoad && !documentLoader()->isClientRedirect()) { 4250 4254 if (!documentLoader()->urlForHistory().isEmpty()) 4251 add HistoryForCurrentLocation();4255 addBackForwardItemClippedAtTarget(true); 4252 4256 } else if (documentLoader()->unreachableURL().isEmpty() && m_currentHistoryItem) { 4253 4257 m_currentHistoryItem->setURL(documentLoader()->url()); 4254 4258 m_currentHistoryItem->setFormInfoFromRequest(documentLoader()->request()); 4255 4259 } 4256 4257 // reset navigation during on load since we no longer 4258 // need it past thsi point 4259 m_navigationDuringLoad = false; 4260 4261 updateGlobalHistory(); 4260 4262 } 4261 4263 … … 4273 4275 m_currentHistoryItem->clearScrollPoint(); 4274 4276 } 4277 4278 // FIXME: Should we call updateGlobalHistory here? 4275 4279 } 4276 4280 … … 4284 4288 // Must grab the current scroll position before disturbing it 4285 4289 saveScrollPositionAndViewStateToItem(m_previousHistoryItem.get()); 4290 4291 // FIXME: Should we call updateGlobalHistory here? 4286 4292 } 4287 4293 … … 4304 4310 } 4305 4311 4306 // FIXME: <rdar://problem/4880065> - This will be a hook into the WebCore global history, and this loader/client call will be removed 4307 // Update the last visited time. Mostly interesting for URL autocompletion statistics. 4308 m_client->updateGlobalHistoryForReload(documentLoader()->originalURL()); 4312 updateGlobalHistory(); 4309 4313 } 4310 4314 … … 4318 4322 if (documentLoader()->isClientRedirect()) { 4319 4323 if (!m_currentHistoryItem && !m_frame->tree()->parent()) 4320 add HistoryForCurrentLocation();4324 addBackForwardItemClippedAtTarget(true); 4321 4325 if (m_currentHistoryItem) { 4322 4326 m_currentHistoryItem->setURL(documentLoader()->url()); … … 4328 4332 parentFrame->loader()->m_currentHistoryItem->addChildItem(createHistoryItem(true)); 4329 4333 } 4334 4335 updateGlobalHistory(); 4330 4336 } 4331 4337 -
trunk/WebCore/loader/FrameLoader.h
r30243 r30549 450 450 bool childFramesMatchItem(HistoryItem*) const; 451 451 452 void addHistoryForCurrentLocation();453 452 void updateHistoryForBackForwardNavigation(); 454 453 void updateHistoryForReload(); … … 458 457 void updateHistoryForCommit(); 459 458 459 void updateGlobalHistory(); 460 460 461 void redirectionTimerFired(Timer<FrameLoader>*); 461 462 void checkCompletedTimerFired(Timer<FrameLoader>*); -
trunk/WebCore/loader/FrameLoaderClient.h
r29837 r30549 151 151 virtual void finalSetupForReplace(DocumentLoader*) = 0; 152 152 153 virtual void updateGlobalHistoryForStandardLoad(const KURL&) = 0; 154 virtual void updateGlobalHistoryForReload(const KURL&) = 0; 153 virtual void updateGlobalHistory(const KURL&) = 0; 155 154 virtual bool shouldGoToHistoryItem(HistoryItem*) const = 0; 156 155 -
trunk/WebCore/svg/graphics/SVGImageEmptyClients.h
r29698 r30549 248 248 virtual void transitionToCommittedForNewPage() { } 249 249 250 virtual void updateGlobalHistoryForStandardLoad(const KURL&) { } 251 virtual void updateGlobalHistoryForReload(const KURL&) { } 250 virtual void updateGlobalHistory(const KURL&) { } 252 251 virtual bool shouldGoToHistoryItem(HistoryItem*) const { return false; } 253 252 virtual void saveViewStateToItem(HistoryItem*) { } -
trunk/WebKit/gtk/ChangeLog
r30526 r30549 1 2008-02-24 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - remove separate client calls for "standard" and "reload' history 6 7 * WebCoreSupport/FrameLoaderClientGtk.cpp: 8 (WebKit::FrameLoaderClient::updateGlobalHistory): 9 * WebCoreSupport/FrameLoaderClientGtk.h: 10 1 11 2008-02-23 Alexey Proskuryakov <ap@webkit.org> 2 12 -
trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r30267 r30549 767 767 } 768 768 769 void FrameLoaderClient::updateGlobalHistoryForStandardLoad(const KURL&) 770 { 771 notImplemented(); 772 } 773 774 void FrameLoaderClient::updateGlobalHistoryForReload(const KURL&) 769 void FrameLoaderClient::updateGlobalHistory(const KURL&) 775 770 { 776 771 notImplemented(); -
trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
r29961 r30549 133 133 virtual void finalSetupForReplace(WebCore::DocumentLoader*); 134 134 135 virtual void updateGlobalHistoryForStandardLoad(const WebCore::KURL&); 136 virtual void updateGlobalHistoryForReload(const WebCore::KURL&); 135 virtual void updateGlobalHistory(const WebCore::KURL&); 137 136 virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const; 138 137 -
trunk/WebKit/mac/ChangeLog
r30522 r30549 1 2008-02-24 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - remove separate client calls for "standard" and "reload' history 6 7 * WebCoreSupport/WebFrameLoaderClient.h: 8 * WebCoreSupport/WebFrameLoaderClient.mm: 9 (WebFrameLoaderClient::updateGlobalHistory): 10 1 11 2008-02-23 Alexey Proskuryakov <ap@webkit.org> 2 12 -
trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
r28672 r30549 141 141 virtual void finishedLoading(WebCore::DocumentLoader*); 142 142 virtual void finalSetupForReplace(WebCore::DocumentLoader*); 143 virtual void updateGlobalHistoryForStandardLoad(const WebCore::KURL&); 144 virtual void updateGlobalHistoryForReload(const WebCore::KURL&); 143 virtual void updateGlobalHistory(const WebCore::KURL&); 145 144 virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const; 146 145 -
trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r30410 r30549 714 714 } 715 715 716 // FIXME: <rdar://problem/4880065> - Push Global History into WebCore 717 // Once that task is complete, this will go away 718 void WebFrameLoaderClient::updateGlobalHistoryForStandardLoad(const KURL& url) 716 void WebFrameLoaderClient::updateGlobalHistory(const KURL& url) 719 717 { 720 718 NSURL *cocoaURL = url; 721 719 WebHistoryItem *entry = [[WebHistory optionalSharedHistory] addItemForURL:cocoaURL]; 722 StringpageTitle = core(m_webFrame.get())->loader()->documentLoader()->title();723 if ( pageTitle.length())720 const String& pageTitle = core(m_webFrame.get())->loader()->documentLoader()->title(); 721 if (!pageTitle.isEmpty()) 724 722 [entry setTitle:pageTitle]; 725 723 } 726 724 727 // FIXME: <rdar://problem/4880065> - Push Global History into WebCore728 // Once that task is complete, this will go away729 void WebFrameLoaderClient::updateGlobalHistoryForReload(const KURL& url)730 {731 WebHistory *sharedHistory = [WebHistory optionalSharedHistory];732 WebHistoryItem *item = [sharedHistory itemForURL:url];733 if (item)734 [sharedHistory setLastVisitedTimeInterval:[NSDate timeIntervalSinceReferenceDate] forItem:item];735 }736 737 725 bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const 738 726 { -
trunk/WebKit/qt/ChangeLog
r30548 r30549 1 2008-02-24 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - remove separate client calls for "standard" and "reload' history 6 7 * WebCoreSupport/FrameLoaderClientQt.cpp: 8 (WebCore::FrameLoaderClientQt::updateGlobalHistory): 9 * WebCoreSupport/FrameLoaderClientQt.h: 10 1 11 2008-02-24 Darin Adler <darin@apple.com> 2 12 -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r29765 r30549 600 600 } 601 601 602 void FrameLoaderClientQt::updateGlobalHistory ForStandardLoad(const WebCore::KURL& url)602 void FrameLoaderClientQt::updateGlobalHistory(const WebCore::KURL& url) 603 603 { 604 604 QWebHistoryInterface *history = QWebHistoryInterface::defaultInterface(); 605 605 if (history) 606 606 history->addHistoryEntry(url.prettyURL()); 607 }608 609 void FrameLoaderClientQt::updateGlobalHistoryForReload(const WebCore::KURL&)610 {611 notImplemented();612 607 } 613 608 -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
r29663 r30549 157 157 virtual void transitionToCommittedForNewPage(); 158 158 159 virtual void updateGlobalHistoryForStandardLoad(const WebCore::KURL&); 160 virtual void updateGlobalHistoryForReload(const WebCore::KURL&); 159 virtual void updateGlobalHistory(const WebCore::KURL&); 161 160 virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const; 162 161 virtual void saveViewStateToItem(WebCore::HistoryItem*); -
trunk/WebKit/win/ChangeLog
r30532 r30549 1 2008-02-24 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - remove separate client calls for "standard" and "reload' history 6 7 * WebFrame.cpp: 8 (WebFrame::updateGlobalHistory): 9 * WebFrame.h: 10 1 11 2008-02-23 Brent Fulgham <bfulgham@gmail.com> 2 12 -
trunk/WebKit/win/WebFrame.cpp
r30485 r30549 1595 1595 } 1596 1596 1597 void WebFrame::updateGlobalHistory ForStandardLoad(const KURL& url)1597 void WebFrame::updateGlobalHistory(const KURL& url) 1598 1598 { 1599 1599 COMPtr<WebHistory> history; 1600 1600 history.adoptRef(webHistory()); 1601 1602 1601 if (!history) 1603 1602 return; 1604 1605 1603 history->addItemForURL(BString(url.string()), 0); 1606 }1607 1608 void WebFrame::updateGlobalHistoryForReload(const KURL& url)1609 {1610 BString urlBStr(url.string());1611 1612 COMPtr<WebHistory> history;1613 history.adoptRef(webHistory());1614 1615 if (!history)1616 return;1617 1618 COMPtr<IWebHistoryItem> item;1619 if (SUCCEEDED(history->itemForURL(urlBStr, &item))) {1620 COMPtr<IWebHistoryItemPrivate> itemPrivate;1621 if (SUCCEEDED(item->QueryInterface(IID_IWebHistoryItemPrivate, (void**)&itemPrivate))) {1622 SYSTEMTIME currentTime;1623 GetSystemTime(¤tTime);1624 DATE visitedTime = 0;1625 SystemTimeToVariantTime(¤tTime, &visitedTime);1626 1627 // FIXME - bumping the last visited time doesn't mark the history as changed1628 itemPrivate->setLastVisitedTimeInterval(visitedTime);1629 }1630 }1631 1604 } 1632 1605 -
trunk/WebKit/win/WebFrame.h
r30485 r30549 271 271 virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*); 272 272 virtual void transitionToCommittedForNewPage(); 273 virtual void updateGlobalHistoryForStandardLoad(const WebCore::KURL &); 274 virtual void updateGlobalHistoryForReload(const WebCore::KURL &); 273 virtual void updateGlobalHistory(const WebCore::KURL &); 275 274 virtual bool shouldGoToHistoryItem(WebCore::HistoryItem *) const; 276 275 virtual void saveViewStateToItem(WebCore::HistoryItem *); -
trunk/WebKit/wx/ChangeLog
r30539 r30549 1 2008-02-24 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - remove separate client calls for "standard" and "reload' history 6 7 * WebKitSupport/FrameLoaderClientWx.cpp: 8 (WebCore::FrameLoaderClientWx::updateGlobalHistory): 9 * WebKitSupport/FrameLoaderClientWx.h: 10 1 11 2008-02-23 Kevin Ollivier <kevino@theolliviers.com> 2 12 -
trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
r30133 r30549 582 582 } 583 583 584 void FrameLoaderClientWx::updateGlobalHistoryForStandardLoad(const WebCore::KURL&) 585 { 586 notImplemented(); 587 } 588 589 void FrameLoaderClientWx::updateGlobalHistoryForReload(const WebCore::KURL&) 584 void FrameLoaderClientWx::updateGlobalHistory(const WebCore::KURL&) 590 585 { 591 586 notImplemented(); -
trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
r29663 r30549 157 157 virtual void transitionToCommittedForNewPage(); 158 158 159 virtual void updateGlobalHistoryForStandardLoad(const KURL&); 160 virtual void updateGlobalHistoryForReload(const KURL&); 159 virtual void updateGlobalHistory(const KURL&); 161 160 virtual bool shouldGoToHistoryItem(HistoryItem*) const; 162 161 virtual void saveScrollPositionAndViewStateToItem(HistoryItem*);
Note:
See TracChangeset
for help on using the changeset viewer.