[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

beidson at apple.com beidson at apple.com
Fri Feb 26 22:24:44 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 1a144770bca65f4df391bf39c2e61b3e02b372dd
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 18 17:13:22 2010 +0000

    Particularly constructed WebFrames can try to access a null HistoryItem
    <rdar://problem/7638892> and https://bugs.webkit.org/show_bug.cgi?id=35063
    
    Reviewed by Sam Weinig.
    
    WebCore:
    
    Test: fast/loader/api-test-new-window-data-load-base-url.html
    
    * loader/HistoryController.cpp:
    (WebCore::HistoryController::updateBackForwardListForFragmentScroll): We have a known case where a fragment scroll
      might take place with a null m_currentItem. updateBackForwardListClippedAtTarget() will either move m_currentItem
      to m_previousItem then create a new m_currentItem...  or it will do nothing. So we either have both an m_currentItem
      and m_previousItem, or we have neither.  In the case where we have no m_previousItem, return early.
    
    WebKitTools:
    
    Add the specific ability to test this API pattern.
    
    For now only on Mac, perhaps on the main Windows port later, probably not relevant for other ports.
    
    * DumpRenderTree/LayoutTestController.cpp:
    (apiTestNewWindowDataLoadBaseURLCallback):
    (LayoutTestController::staticFunctions):
    * DumpRenderTree/LayoutTestController.h:
    
    * DumpRenderTree/mac/LayoutTestControllerMac.mm:
    (-[APITestDelegate initWithCompletionCondition:]):
    (-[APITestDelegate webView:didFailLoadWithError:forFrame:]):
    (-[APITestDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
    (-[APITestDelegate webView:didFinishLoadForFrame:]):
    (LayoutTestController::apiTestNewWindowDataLoadBaseURL): Create a WebView, do a loadData: in its
      mainFrame, and synchronously wait for main load completion.
    
    * DumpRenderTree/win/LayoutTestControllerWin.cpp:
    (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
    * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
    (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
    * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
    (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
    
    LayoutTests:
    
    * fast/loader/api-test-new-window-data-load-base-url-expected.txt: Added.
    * fast/loader/api-test-new-window-data-load-base-url.html: Added.
    * platform/gtk/Skipped:
    * platform/qt/Skipped:
    * platform/win/Skipped:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54966 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f3f454c..9037eb9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-18  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Particularly constructed WebFrames can try to access a null HistoryItem
+        <rdar://problem/7638892> and https://bugs.webkit.org/show_bug.cgi?id=35063
+
+        * fast/loader/api-test-new-window-data-load-base-url-expected.txt: Added.
+        * fast/loader/api-test-new-window-data-load-base-url.html: Added.
+        * platform/gtk/Skipped:
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2010-02-18  Nate Chapin  <japhet at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/loader/api-test-new-window-data-load-base-url-expected.txt b/LayoutTests/fast/loader/api-test-new-window-data-load-base-url-expected.txt
new file mode 100644
index 0000000..18dbde8
--- /dev/null
+++ b/LayoutTests/fast/loader/api-test-new-window-data-load-base-url-expected.txt
@@ -0,0 +1,4 @@
+API Test load succeeded
+This test only runs in DRT.
+It creates a new WebView using WebKit API, populates it using "loadData" and gives it a base URL, then clicks on a fragment anchor within it.
+If it doesn't crash, it passed.
diff --git a/LayoutTests/fast/loader/api-test-new-window-data-load-base-url.html b/LayoutTests/fast/loader/api-test-new-window-data-load-base-url.html
new file mode 100644
index 0000000..e34c341
--- /dev/null
+++ b/LayoutTests/fast/loader/api-test-new-window-data-load-base-url.html
@@ -0,0 +1,23 @@
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+
+    var dataURL = "<a id='anchor' href='#foo'>Hello</a><br><div id='foo'></div><s" + "cript>" +
+                  "var evt = document.createEvent('MouseEvent');" +
+                  "evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);" + 
+                  "document.getElementById('anchor').dispatchEvent(evt);" +
+                  "</s" + "cript>";
+    
+    layoutTestController.apiTestNewWindowDataLoadBaseURL(dataURL, "http://example.com/example.html");
+}
+</script>
+<body>
+<pre>This test only runs in DRT.
+It creates a new WebView using WebKit API, populates it using "loadData" and gives it a base URL, then clicks on a fragment anchor within it.
+If it doesn't crash, it passed.</pre>
+</body>
+
+
+
+
+
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 6954b78..9993c2a 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5864,3 +5864,6 @@ fast/css/font-face-opentype.html
 # Crashes on debug bots, see https://bugs.webkit.org/show_bug.cgi?id=35085
 plugins/iframe-shims.html
 fast/loader/loadInProgress.html
+
+# Needs platform specific API implemented in DRT, probably not relevant for non-Mac and non-Windows ports
+fast/loader/api-test-new-window-data-load-base-url.html
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 0c981b0..dbc70ae 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5087,3 +5087,6 @@ http/tests/misc/image-checks-for-accept.html
 # [Qt] fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html fails (DRT sideeffect)
 # https://bugs.webkit.org/show_bug.cgi?id=35086
 fast/xmlhttprequest/xmlhttprequest-no-file-access.html
+
+# Needs platform specific API implemented in DRT, probably not relevant for non-Mac and non-Windows ports
+fast/loader/api-test-new-window-data-load-base-url.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 2e784f8..18ebb68 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -761,3 +761,6 @@ http/tests/misc/image-checks-for-accept.html
 # Tests timeout: https://bugs.webkit.org/show_bug.cgi?id=35041
 websocket/tests/frame-lengths.html
 websocket/tests/simple-stress.html
+
+# Needs platform specific API implemented in DRT, probably not relevant for non-Mac and non-Windows ports
+fast/loader/api-test-new-window-data-load-base-url.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b28a255..9f74785 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-18  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Particularly constructed WebFrames can try to access a null HistoryItem
+        <rdar://problem/7638892> and https://bugs.webkit.org/show_bug.cgi?id=35063
+
+        Test: fast/loader/api-test-new-window-data-load-base-url.html
+
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::updateBackForwardListForFragmentScroll): We have a known case where a fragment scroll
+          might take place with a null m_currentItem. updateBackForwardListClippedAtTarget() will either move m_currentItem 
+          to m_previousItem then create a new m_currentItem...  or it will do nothing. So we either have both an m_currentItem 
+          and m_previousItem, or we have neither.  In the case where we have no m_previousItem, return early.
+
 2010-02-18  Nate Chapin  <japhet at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/loader/HistoryController.cpp b/WebCore/loader/HistoryController.cpp
index 43c9979..55b68dc 100644
--- a/WebCore/loader/HistoryController.cpp
+++ b/WebCore/loader/HistoryController.cpp
@@ -109,6 +109,10 @@ void HistoryController::updateBackForwardListForFragmentScroll()
     
     // Since the document isn't changed as a result of a fragment scroll, we should
     // preserve the DocumentSequenceNumber of the previous item.
+    if (!m_previousItem)
+        return;
+
+    ASSERT(m_currentItem);
     m_currentItem->setDocumentSequenceNumber(m_previousItem->documentSequenceNumber());
 }
 
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 6771bc1..c036968 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,34 @@
+2010-02-18  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Particularly constructed WebFrames can try to access a null HistoryItem
+        <rdar://problem/7638892> and https://bugs.webkit.org/show_bug.cgi?id=35063
+
+        Add the specific ability to test this API pattern. 
+
+        For now only on Mac, perhaps on the main Windows port later, probably not relevant for other ports.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (apiTestNewWindowDataLoadBaseURLCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (-[APITestDelegate initWithCompletionCondition:]):
+        (-[APITestDelegate webView:didFailLoadWithError:forFrame:]):
+        (-[APITestDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
+        (-[APITestDelegate webView:didFinishLoadForFrame:]):
+        (LayoutTestController::apiTestNewWindowDataLoadBaseURL): Create a WebView, do a loadData: in its
+          mainFrame, and synchronously wait for main load completion.
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
+
 2010-02-18  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index b76a92c..f528b31 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -1262,6 +1262,22 @@ static JSValueRef addUserStyleSheetCallback(JSContextRef context, JSObjectRef, J
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef apiTestNewWindowDataLoadBaseURLCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount != 2)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr<JSStringRef> utf8Data(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    ASSERT(!*exception);
+
+    JSRetainPtr<JSStringRef> baseURL(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+    ASSERT(!*exception);
+        
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->apiTestNewWindowDataLoadBaseURL(utf8Data.get(), baseURL.get());
+    return JSValueMakeUndefined(context);
+}
+
 // Static Values
 
 static JSValueRef getGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
@@ -1338,6 +1354,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
         { "addDisallowedURL", addDisallowedURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "addUserScript", addUserScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "addUserStyleSheet", addUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "apiTestNewWindowDataLoadBaseURL", apiTestNewWindowDataLoadBaseURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "clearAllDatabases", clearAllDatabasesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "clearBackForwardList", clearBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "clearPersistentUserStyleSheet", clearPersistentUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index da41173..3add32a 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -233,6 +233,10 @@ public:
     void evaluateScriptInIsolatedWorld(unsigned worldId, JSObjectRef globalObject, JSStringRef script);
 
     void setPOSIXLocale(JSStringRef locale);
+    
+    // The following API test functions should probably be moved to platform-specific 
+    // unit tests outside of DRT once they exist.
+    void apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL);
 
     static const unsigned maxViewWidth;
     static const unsigned maxViewHeight;
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index f97c60a..668b852 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -595,3 +595,8 @@ void LayoutTestController::removeAllVisitedLinks()
 {
     // FIXME: Implement this.
 }
+
+void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+
+}
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 5fbd3cc..66ba5f0 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -622,3 +622,67 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj
 
     [mainFrame _stringByEvaluatingJavaScriptFromString:scriptNS withGlobalObject:globalObject inScriptWorld:world];
 }
+
+ at interface APITestDelegate : NSObject
+{
+    bool* m_condition;
+}
+ at end
+
+ at implementation APITestDelegate
+
+- (id)initWithCompletionCondition:(bool*)condition
+{
+    [super init];
+    ASSERT(condition);
+    m_condition = condition;
+    *m_condition = false;
+    return self;
+}
+
+- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
+{
+    printf("API Test load failed\n");
+    *m_condition = true;
+}
+
+- (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
+{
+    printf("API Test load failed provisional\n");
+    *m_condition = true;
+}
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+    printf("API Test load succeeded\n");
+    *m_condition = true;
+}
+
+ at end
+
+void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+    RetainPtr<CFStringRef> utf8DataCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, utf8Data));
+    RetainPtr<CFStringRef> baseURLCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, baseURL));
+    
+    WebView *webView = [[WebView alloc] initWithFrame:NSZeroRect frameName:@"" groupName:@""];
+
+    bool done = false;
+    APITestDelegate *delegate = [[APITestDelegate alloc] initWithCompletionCondition:&done];
+    [webView setFrameLoadDelegate:delegate];
+
+    [[webView mainFrame] loadData:[(NSString *)utf8DataCF.get() dataUsingEncoding:NSUTF8StringEncoding] MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:[NSURL URLWithString:(NSString *)baseURLCF.get()]];
+    
+    while (!done) {
+        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+        [pool release];
+    }
+        
+    [webView close];
+    [webView release];
+    [delegate release];
+    [pool release];
+}
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index f717623..9f84488 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1164,3 +1164,8 @@ int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeigh
         pageNumber = -1;
     return pageNumber;
 }
+
+void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+
+}
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index 469e3f2..ce1bda5 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -380,4 +380,9 @@ int LayoutTestController::numberOfPages(float, float)
 {
     // FIXME: implement
     return -1;
-}
\ No newline at end of file
+}
+
+void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list