[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
beidson at apple.com
beidson at apple.com
Thu Oct 29 20:42:17 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 0cf8396455f866015e4a803aa101a62c43f4e59c
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 9 03:39:18 2009 +0000
Ask the History Delegate to populate the visited links hash.
<rdar://problem/7285293> and https://webkit.org/b/29904
Reviewed by Dan Bernstein.
WebKit/mac:
* History/WebHistory.mm:
(+[WebHistory _removeAllVisitedLinks]):
* History/WebHistoryPrivate.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::populateVisitedLinks):
* WebView/WebDelegateImplementationCaching.h:
* WebView/WebDelegateImplementationCaching.mm:
(CallHistoryDelegate):
* WebView/WebHistoryDelegate.h:
* WebView/WebView.mm:
(-[WebView _cacheHistoryDelegateImplementations]):
(-[WebView addVisitedLinks:]):
* WebView/WebViewPrivate.h:
WebKitTools:
Add the ability for LayoutTestController to clear all visited links.
Also lets the History Delegate dump visited links, but only if this test specifically cleared them.
* DumpRenderTree/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(removeAllVisitedLinksCallback):
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::removeAllVisitedLinks):
* DumpRenderTree/mac/HistoryDelegate.mm:
(-[HistoryDelegate populateVisitedLinksForWebView:]):
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::removeAllVisitedLinks):
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::removeAllVisitedLinks):
* DumpRenderTree/wx/LayoutTestControllerWx.cpp:
(LayoutTestController::removeAllVisitedLinks):
LayoutTests:
* http/tests/globalhistory/history-delegate-basic-visited-links-expected.txt: Added.
* http/tests/globalhistory/history-delegate-basic-visited-links.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index eb67389..d7d6c76 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-08 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Ask the History Delegate to populate the visited links hash.
+ <rdar://problem/7285293> and https://webkit.org/b/29904
+
+ * http/tests/globalhistory/history-delegate-basic-visited-links-expected.txt: Added.
+ * http/tests/globalhistory/history-delegate-basic-visited-links.html: Added.
+
2009-10-08 Aaron Boodman <aa at chromium.org>
Reviewed by Eric Seidel.
diff --git a/LayoutTests/http/tests/globalhistory/history-delegate-basic-visited-links-expected.txt b/LayoutTests/http/tests/globalhistory/history-delegate-basic-visited-links-expected.txt
new file mode 100644
index 0000000..1dd7142
--- /dev/null
+++ b/LayoutTests/http/tests/globalhistory/history-delegate-basic-visited-links-expected.txt
@@ -0,0 +1,4 @@
+WebView navigated to url "http://127.0.0.1:8000/globalhistory/history-delegate-basic-visited-links.html" with title "" with HTTP equivalent method "GET". The navigation was successful and was not a client redirect.
+Asked to populate visited links for WebView "http://127.0.0.1:8000/globalhistory/history-delegate-basic-visited-links.html"
+This tests to see if the history delegate is notified to populate the visited links hash.
+Am I a visited link?
diff --git a/LayoutTests/http/tests/globalhistory/history-delegate-basic-visited-links.html b/LayoutTests/http/tests/globalhistory/history-delegate-basic-visited-links.html
new file mode 100644
index 0000000..8338e0d
--- /dev/null
+++ b/LayoutTests/http/tests/globalhistory/history-delegate-basic-visited-links.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.removeAllVisitedLinks();
+}
+</script>
+</head>
+<body>
+This tests to see if the history delegate is notified to populate the visited links hash.<br>
+<a href="http://www.example.com/">Am I a visited link?</a>
+</body>
+</html>
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 874f5c1..a3652e1 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,24 @@
+2009-10-08 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Ask the History Delegate to populate the visited links hash.
+ <rdar://problem/7285293> and https://webkit.org/b/29904
+
+ * History/WebHistory.mm:
+ (+[WebHistory _removeAllVisitedLinks]):
+ * History/WebHistoryPrivate.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::populateVisitedLinks):
+ * WebView/WebDelegateImplementationCaching.h:
+ * WebView/WebDelegateImplementationCaching.mm:
+ (CallHistoryDelegate):
+ * WebView/WebHistoryDelegate.h:
+ * WebView/WebView.mm:
+ (-[WebView _cacheHistoryDelegateImplementations]):
+ (-[WebView addVisitedLinks:]):
+ * WebView/WebViewPrivate.h:
+
2009-10-08 Anders Carlsson <andersca at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit/mac/History/WebHistory.mm b/WebKit/mac/History/WebHistory.mm
index 6304fd2..f5b4476 100644
--- a/WebKit/mac/History/WebHistory.mm
+++ b/WebKit/mac/History/WebHistory.mm
@@ -801,6 +801,11 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
return [_historyPrivate data];
}
++ (void)_removeAllVisitedLinks
+{
+ PageGroup::removeAllVisitedLinks();
+}
+
@end
@implementation WebHistory (WebInternal)
diff --git a/WebKit/mac/History/WebHistoryPrivate.h b/WebKit/mac/History/WebHistoryPrivate.h
index 4ab0924..8bb6ab9 100644
--- a/WebKit/mac/History/WebHistoryPrivate.h
+++ b/WebKit/mac/History/WebHistoryPrivate.h
@@ -53,5 +53,5 @@ extern NSString *WebHistoryItemsDiscardedWhileLoadingNotification;
*/
- (NSData *)_data;
-
++ (void)_removeAllVisitedLinks;
@end
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index a3f004e..c107299 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -548,6 +548,15 @@ void WebChromeClient::reachedMaxAppCacheSize(int64_t spaceNeeded)
void WebChromeClient::populateVisitedLinks()
{
+ if ([m_webView historyDelegate]) {
+ WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(m_webView);
+
+ if (implementations->populateVisitedLinksFunc)
+ CallHistoryDelegate(implementations->populateVisitedLinksFunc, m_webView, @selector(populateVisitedLinksForWebView:));
+
+ return;
+ }
+
BEGIN_BLOCK_OBJC_EXCEPTIONS;
[[WebHistory optionalSharedHistory] _addVisitedLinksToPageGroup:[m_webView page]->group()];
END_BLOCK_OBJC_EXCEPTIONS;
diff --git a/WebKit/mac/WebView/WebDelegateImplementationCaching.h b/WebKit/mac/WebView/WebDelegateImplementationCaching.h
index 907ba42..edf3cad 100644
--- a/WebKit/mac/WebView/WebDelegateImplementationCaching.h
+++ b/WebKit/mac/WebView/WebDelegateImplementationCaching.h
@@ -86,6 +86,7 @@ struct WebHistoryDelegateImplementationCache {
IMP clientRedirectFunc;
IMP serverRedirectFunc;
IMP setTitleFunc;
+ IMP populateVisitedLinksFunc;
};
WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *);
@@ -130,5 +131,6 @@ id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, NSInteger, id
id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, id, id);
id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, NSInteger, id);
+id CallHistoryDelegate(IMP, WebView *, SEL);
id CallHistoryDelegate(IMP, WebView *, SEL, id, id);
id CallHistoryDelegate(IMP, WebView *, SEL, id, id, id);
diff --git a/WebKit/mac/WebView/WebDelegateImplementationCaching.mm b/WebKit/mac/WebView/WebDelegateImplementationCaching.mm
index 7757fc7..486d094 100644
--- a/WebKit/mac/WebView/WebDelegateImplementationCaching.mm
+++ b/WebKit/mac/WebView/WebDelegateImplementationCaching.mm
@@ -548,6 +548,11 @@ id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id o
return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, integer1, integer2, object2);
}
+id CallHistoryDelegate(IMP implementation, WebView *self, SEL selector)
+{
+ return CallDelegate(implementation, self, self->_private->historyDelegate, selector);
+}
+
id CallHistoryDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2)
{
return CallDelegate(implementation, self, self->_private->historyDelegate, selector, object1, object2);
diff --git a/WebKit/mac/WebView/WebHistoryDelegate.h b/WebKit/mac/WebView/WebHistoryDelegate.h
index 4029eb0..4415365 100644
--- a/WebKit/mac/WebView/WebHistoryDelegate.h
+++ b/WebKit/mac/WebView/WebHistoryDelegate.h
@@ -39,4 +39,6 @@
- (void)webView:(WebView *)webView updateHistoryTitle:(NSString *)title forURL:(NSString *)url;
+- (void)populateVisitedLinksForWebView:(WebView *)webView;
+
@end
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 83c7e20..ca53b3a 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -1421,6 +1421,7 @@ static inline IMP getMethod(id o, SEL s)
cache->clientRedirectFunc = getMethod(delegate, @selector(webView:didPerformClientRedirectFromURL:toURL:inFrame:));
cache->serverRedirectFunc = getMethod(delegate, @selector(webView:didPerformServerRedirectFromURL:toURL:inFrame:));
cache->setTitleFunc = getMethod(delegate, @selector(webView:updateHistoryTitle:forURL:));
+ cache->populateVisitedLinksFunc = getMethod(delegate, @selector(populateVisitedLinksForWebView:));
}
- (id)_policyDelegateForwarder
@@ -4257,6 +4258,24 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu
return _private->page->mediaVolume();
}
+- (void)addVisitedLinks:(NSArray *)visitedLinks
+{
+ PageGroup& group = core(self)->group();
+
+ NSEnumerator *enumerator = [visitedLinks objectEnumerator];
+ while (NSString *url = [enumerator nextObject]) {
+ size_t length = [url length];
+ const UChar* characters = CFStringGetCharactersPtr(reinterpret_cast<CFStringRef>(url));
+ if (characters)
+ group.addVisitedLink(characters, length);
+ else {
+ Vector<UChar, 512> buffer(length);
+ [url getCharacters:buffer.data()];
+ group.addVisitedLink(buffer.data(), length);
+ }
+ }
+}
+
@end
@implementation WebView (WebViewPrintingPrivate)
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index fa5d28c..b4cafc2 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -200,6 +200,9 @@ typedef enum {
- (void)setMediaVolume:(float)volume;
- (float)mediaVolume;
+// Add visited links
+- (void)addVisitedLinks:(NSArray *)visitedLinks;
+
@end
@interface WebView (WebPrivate)
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index a96d087..c1018d5 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,32 @@
+2009-10-08 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Ask the History Delegate to populate the visited links hash.
+ <rdar://problem/7285293> and https://webkit.org/b/29904
+
+ Add the ability for LayoutTestController to clear all visited links.
+ Also lets the History Delegate dump visited links, but only if this test specifically cleared them.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (removeAllVisitedLinksCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::removeAllVisitedLinks):
+
+ * DumpRenderTree/mac/HistoryDelegate.mm:
+ (-[HistoryDelegate populateVisitedLinksForWebView:]):
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::removeAllVisitedLinks):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::removeAllVisitedLinks):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::removeAllVisitedLinks):
+
+
2009-10-08 Daniel Bates <dbates at webkit.org>
Reviewed by Adam Roben.
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 1f34325..c2e4e64 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -54,6 +54,7 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
, m_dumpSourceAsWebArchive(false)
, m_dumpStatusCallbacks(false)
, m_dumpTitleChanges(false)
+ , m_dumpVisitedLinksCallback(false)
, m_dumpWillCacheResponse(false)
, m_callCloseOnWebViews(true)
, m_canOpenWindows(false)
@@ -204,6 +205,14 @@ static JSValueRef pathToLocalResourceCallback(JSContextRef context, JSObjectRef
return JSValueMakeString(context, convertedPath.get());
}
+static JSValueRef removeAllVisitedLinksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setDumpVisitedLinksCallback(true);
+ controller->removeAllVisitedLinks();
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef repaintSweepHorizontallyCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -1193,6 +1202,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "queueLoadingScript", queueLoadingScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "queueNonLoadingScript", queueNonLoadingScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "queueReload", queueReloadCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "removeAllVisitedLinks", removeAllVisitedLinksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "repaintSweepHorizontally", repaintSweepHorizontallyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAcceptsEditing", setAcceptsEditingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAlwaysAcceptCookies", setAlwaysAcceptCookiesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 7c829ef..f5f340f 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -62,6 +62,7 @@ public:
void queueLoadingScript(JSStringRef script);
void queueNonLoadingScript(JSStringRef script);
void queueReload();
+ void removeAllVisitedLinks();
void setAcceptsEditing(bool acceptsEditing);
void setAppCacheMaximumSize(unsigned long long quota);
void setAuthorAndUserStylesEnabled(bool);
@@ -137,6 +138,9 @@ public:
bool dumpTitleChanges() const { return m_dumpTitleChanges; }
void setDumpTitleChanges(bool dumpTitleChanges) { m_dumpTitleChanges = dumpTitleChanges; }
+
+ bool dumpVisitedLinksCallback() const { return m_dumpVisitedLinksCallback; }
+ void setDumpVisitedLinksCallback(bool dumpVisitedLinksCallback) { m_dumpVisitedLinksCallback = dumpVisitedLinksCallback; }
bool dumpWillCacheResponse() const { return m_dumpWillCacheResponse; }
void setDumpWillCacheResponse(bool dumpWillCacheResponse) { m_dumpWillCacheResponse = dumpWillCacheResponse; }
@@ -225,6 +229,7 @@ private:
bool m_dumpSourceAsWebArchive;
bool m_dumpStatusCallbacks;
bool m_dumpTitleChanges;
+ bool m_dumpVisitedLinksCallback;
bool m_dumpWillCacheResponse;
bool m_callCloseOnWebViews;
bool m_canOpenWindows;
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 0b4a38f..1df92c4 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -486,3 +486,8 @@ void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef scrip
{
// FIXME: Implement this.
}
+
+void LayoutTestController::removeAllVisitedLinks()
+{
+ // FIXME: Implement this.
+}
diff --git a/WebKitTools/DumpRenderTree/mac/HistoryDelegate.mm b/WebKitTools/DumpRenderTree/mac/HistoryDelegate.mm
index 9e2b836..cbc4093 100644
--- a/WebKitTools/DumpRenderTree/mac/HistoryDelegate.mm
+++ b/WebKitTools/DumpRenderTree/mac/HistoryDelegate.mm
@@ -29,6 +29,7 @@
#import "LayoutTestController.h"
#import <WebKit/WebNavigationData.h>
+#import <WebKit/WebView.h>
@interface NSURL (DRTExtras)
- (NSString *)_drt_descriptionSuitableForTestResult;
@@ -71,4 +72,10 @@
printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", [[[NSURL URLWithString:url]_drt_descriptionSuitableForTestResult] UTF8String], [title UTF8String]);
}
+- (void)populateVisitedLinksForWebView:(WebView *)webView
+{
+ if (gLayoutTestController->dumpVisitedLinksCallback())
+ printf("Asked to populate visited links for WebView \"%s\"\n", [[[NSURL URLWithString:[webView mainFrameURL]] _drt_descriptionSuitableForTestResult] UTF8String]);
+}
+
@end
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 233c5fd..620647f 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -333,6 +333,11 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
[[WebPreferences standardPreferences] _setPreferenceForTestWithValue:valueNS forKey:keyNS];
}
+void LayoutTestController::removeAllVisitedLinks()
+{
+ [WebHistory _removeAllVisitedLinks];
+}
+
void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
{
RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL));
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index cf3ac85..e9338ce 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -912,3 +912,8 @@ void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef scrip
inspectorPrivate->evaluateInFrontend(callId, bstrT(script).GetBSTR());
}
+
+void LayoutTestController::removeAllVisitedLinks()
+{
+ // FIXME: Implement this.
+}
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index bfe1d99..72f85ae 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -313,3 +313,8 @@ void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef scrip
{
// FIXME: Implement this.
}
+
+void LayoutTestController::removeAllVisitedLinks()
+{
+ // FIXME: Implement this.
+}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list