Title: [192191] trunk
- Revision
- 192191
- Author
- jiewen_...@apple.com
- Date
- 2015-11-09 16:44:17 -0800 (Mon, 09 Nov 2015)
Log Message
Crash when right clicking in input box with -webkit-user-select: none
https://bugs.webkit.org/show_bug.cgi?id=145981
<rdar://problem/22441925>
Reviewed by Enrica Casucci.
Source/WebCore:
Test: editing/selection/minimal-user-select-crash.html
* editing/Editor.cpp:
(WebCore::Editor::hasBidiSelection):
Visible position cannot be created because of the style that doesn't allow the selection.
LayoutTests:
* editing/selection/minimal-user-select-crash-expected.txt: Added.
* editing/selection/minimal-user-select-crash.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (192190 => 192191)
--- trunk/LayoutTests/ChangeLog 2015-11-10 00:39:13 UTC (rev 192190)
+++ trunk/LayoutTests/ChangeLog 2015-11-10 00:44:17 UTC (rev 192191)
@@ -1,3 +1,14 @@
+2015-11-09 Jiewen Tan <jiewen_...@apple.com>
+
+ Crash when right clicking in input box with -webkit-user-select: none
+ https://bugs.webkit.org/show_bug.cgi?id=145981
+ <rdar://problem/22441925>
+
+ Reviewed by Enrica Casucci.
+
+ * editing/selection/minimal-user-select-crash-expected.txt: Added.
+ * editing/selection/minimal-user-select-crash.html: Added.
+
2015-11-09 Joseph Pecoraro <pecor...@apple.com>
Web Inspector: $0 stops working after navigating to a different domain
Added: trunk/LayoutTests/editing/selection/minimal-user-select-crash-expected.txt (0 => 192191)
--- trunk/LayoutTests/editing/selection/minimal-user-select-crash-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/selection/minimal-user-select-crash-expected.txt 2015-11-10 00:44:17 UTC (rev 192191)
@@ -0,0 +1 @@
+PASS. WebKit didn't crash.
Added: trunk/LayoutTests/editing/selection/minimal-user-select-crash.html (0 => 192191)
--- trunk/LayoutTests/editing/selection/minimal-user-select-crash.html (rev 0)
+++ trunk/LayoutTests/editing/selection/minimal-user-select-crash.html 2015-11-10 00:44:17 UTC (rev 192191)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ #search-text {
+ -webkit-user-select: none;
+ }
+</style>
+
+<script src=""
+
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function editingTest() {
+ var element = document.getElementById('search-text');
+ element.focus();
+
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop);
+ eventSender.contextClick();
+
+ document.write("PASS. WebKit didn't crash.")
+ }
+ }
+</script>
+</head>
+<body _onload_=editingTest()>
+ <input id="search-text">
+</body>
+</html>
Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (192190 => 192191)
--- trunk/LayoutTests/platform/ios-simulator/TestExpectations 2015-11-10 00:39:13 UTC (rev 192190)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations 2015-11-10 00:44:17 UTC (rev 192191)
@@ -2466,6 +2466,7 @@
editing/selection/extend-selection-home-end.html
editing/spelling/spellcheck-async.html
editing/style/style-text-node-without-editable-parent.html
+editing/selection/minimal-user-select-crash.html
# Editing tests that fail:
editing/deleting/delete-emoji.html [ Failure ]
Modified: trunk/Source/WebCore/ChangeLog (192190 => 192191)
--- trunk/Source/WebCore/ChangeLog 2015-11-10 00:39:13 UTC (rev 192190)
+++ trunk/Source/WebCore/ChangeLog 2015-11-10 00:44:17 UTC (rev 192191)
@@ -1,3 +1,17 @@
+2015-11-09 Jiewen Tan <jiewen_...@apple.com>
+
+ Crash when right clicking in input box with -webkit-user-select: none
+ https://bugs.webkit.org/show_bug.cgi?id=145981
+ <rdar://problem/22441925>
+
+ Reviewed by Enrica Casucci.
+
+ Test: editing/selection/minimal-user-select-crash.html
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::hasBidiSelection):
+ Visible position cannot be created because of the style that doesn't allow the selection.
+
2015-11-09 Joseph Pecoraro <pecor...@apple.com>
Web Inspector: $0 stops working after navigating to a different domain
Modified: trunk/Source/WebCore/editing/Editor.cpp (192190 => 192191)
--- trunk/Source/WebCore/editing/Editor.cpp 2015-11-10 00:39:13 UTC (rev 192190)
+++ trunk/Source/WebCore/editing/Editor.cpp 2015-11-10 00:44:17 UTC (rev 192191)
@@ -708,6 +708,9 @@
} else
startNode = m_frame.selection().selection().visibleStart().deepEquivalent().deprecatedNode();
+ if (!startNode)
+ return false;
+
auto renderer = startNode->renderer();
while (renderer && !is<RenderBlockFlow>(*renderer))
renderer = renderer->parent();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes