Title: [107100] trunk
Revision
107100
Author
an...@apple.com
Date
2012-02-08 09:35:44 -0800 (Wed, 08 Feb 2012)

Log Message

REGRESSION (r106681): Null check missing in [WebFrame(WebInternal) _typingStyle]
https://bugs.webkit.org/show_bug.cgi?id=78080

Source/WebKit/mac: 

Reviewed by Reviewed by Andreas Kling, Darin Adler and Dan Bernstein.

* WebView/WebFrame.mm:
(-[WebFrame _typingStyle]):

Tools: 

Reviewed by Andreas Kling, Darin Adler and Dan Bernstein.
        
Add API test.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/TypingStyleCrash.mm: Added.
(TestWebKitAPI):
(TestWebKitAPI::TEST):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (107099 => 107100)


--- trunk/Source/WebKit/mac/ChangeLog	2012-02-08 17:34:22 UTC (rev 107099)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-02-08 17:35:44 UTC (rev 107100)
@@ -1,3 +1,13 @@
+2012-02-07  Antti Koivisto  <an...@apple.com>
+
+        REGRESSION (r106681): Null check missing in [WebFrame(WebInternal) _typingStyle]
+        https://bugs.webkit.org/show_bug.cgi?id=78080
+
+        Reviewed by Reviewed by Andreas Kling, Darin Adler and Dan Bernstein.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _typingStyle]):
+
 2012-02-07  Tony Chang  <t...@chromium.org>
 
         merge DashboardSupportCSSPropertyNames.in into CSSPropertyNames.in

Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (107099 => 107100)


--- trunk/Source/WebKit/mac/WebView/WebFrame.mm	2012-02-08 17:34:22 UTC (rev 107099)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm	2012-02-08 17:35:44 UTC (rev 107100)
@@ -791,10 +791,10 @@
 {
     if (!_private->coreFrame)
         return nil;
-    RefPtr<CSSStyleDeclaration> typingStyle = _private->coreFrame->selection()->copyTypingStyle()->ensureCSSStyleDeclaration();
+    RefPtr<StylePropertySet> typingStyle = _private->coreFrame->selection()->copyTypingStyle();
     if (!typingStyle)
         return nil;
-    return kit(typingStyle.get());
+    return kit(typingStyle->ensureCSSStyleDeclaration());
 }
 
 - (void)_setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction

Modified: trunk/Tools/ChangeLog (107099 => 107100)


--- trunk/Tools/ChangeLog	2012-02-08 17:34:22 UTC (rev 107099)
+++ trunk/Tools/ChangeLog	2012-02-08 17:35:44 UTC (rev 107100)
@@ -1,3 +1,17 @@
+2012-02-08  Antti Koivisto  <an...@apple.com>
+
+        REGRESSION (r106681): Null check missing in [WebFrame(WebInternal) _typingStyle]
+        https://bugs.webkit.org/show_bug.cgi?id=78080
+
+        Reviewed by Andreas Kling, Darin Adler and Dan Bernstein.
+        
+        Add API test.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/mac/TypingStyleCrash.mm: Added.
+        (TestWebKitAPI):
+        (TestWebKitAPI::TEST):
+
 2012-02-08  Gustavo Noronha Silva  <g...@gnome.org>
 
         [GTK] Fails to build docs with non-standard build directories

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (107099 => 107100)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2012-02-08 17:34:22 UTC (rev 107099)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2012-02-08 17:35:44 UTC (rev 107100)
@@ -117,6 +117,7 @@
 		C0C5D3BE14598B6F00A802A6 /* GetBackingScaleFactor.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5D3BC14598B6F00A802A6 /* GetBackingScaleFactor.mm */; };
 		C0C5D3C61459912900A802A6 /* GetBackingScaleFactor_Bundle.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */; };
 		C507E8A714C6545B005D6B3B /* InspectorBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = C507E8A614C6545B005D6B3B /* InspectorBar.mm */; };
+		E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */; };
 		F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3FC3EE213678B7300126A65 /* libgtest.a */; };
 		F6F3F29113342FEB00A6BF19 /* CookieManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */; };
 		F6FDDDD314241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6FDDDD214241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp */; };
@@ -296,6 +297,7 @@
 		C0C5D3BC14598B6F00A802A6 /* GetBackingScaleFactor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor.mm; sourceTree = "<group>"; };
 		C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor_Bundle.mm; sourceTree = "<group>"; };
 		C507E8A614C6545B005D6B3B /* InspectorBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InspectorBar.mm; sourceTree = "<group>"; };
+		E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TypingStyleCrash.mm; sourceTree = "<group>"; };
 		F3FC3EE213678B7300126A65 /* libgtest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CookieManager.cpp; sourceTree = "<group>"; };
 		F6FDDDD214241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrivateBrowsingPushStateNoHistoryCallback.cpp; sourceTree = "<group>"; };
@@ -569,6 +571,7 @@
 				3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */,
 				3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */,
 				37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */,
+				E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */,
 			);
 			path = mac;
 			sourceTree = "<group>";
@@ -768,6 +771,7 @@
 				93F1DB5514DB1B730024C362 /* NewFirstVisuallyNonEmptyLayoutFails.cpp in Sources */,
 				93F7E86C14DC8E4D00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames.cpp in Sources */,
 				BC22D31514DC689800FFB1DD /* UserMessage.cpp in Sources */,
+				E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Added: trunk/Tools/TestWebKitAPI/Tests/mac/TypingStyleCrash.mm (0 => 107100)


--- trunk/Tools/TestWebKitAPI/Tests/mac/TypingStyleCrash.mm	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/TypingStyleCrash.mm	2012-02-08 17:35:44 UTC (rev 107100)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, TypingStyleCrash)
+{
+    WebView *webView = [[WebView alloc] init];
+    [webView typingStyle];
+    [webView release];
+}
+
+} // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to