Title: [92968] branches/chromium/782
- Revision
- 92968
- Author
- [email protected]
- Date
- 2011-08-12 10:17:46 -0700 (Fri, 12 Aug 2011)
Log Message
Merge 92966
BUG=92621
Review URL: http://codereview.chromium.org/7640019
Modified Paths
Added Paths
Diff
Copied: branches/chromium/782/LayoutTests/editing/selection/select-start-remove-root-crash-expected.txt (from rev 92966, trunk/LayoutTests/editing/selection/select-start-remove-root-crash-expected.txt) (0 => 92968)
--- branches/chromium/782/LayoutTests/editing/selection/select-start-remove-root-crash-expected.txt (rev 0)
+++ branches/chromium/782/LayoutTests/editing/selection/select-start-remove-root-crash-expected.txt 2011-08-12 17:17:46 UTC (rev 92968)
@@ -0,0 +1 @@
+PASS
Copied: branches/chromium/782/LayoutTests/editing/selection/select-start-remove-root-crash.html (from rev 92966, trunk/LayoutTests/editing/selection/select-start-remove-root-crash.html) (0 => 92968)
--- branches/chromium/782/LayoutTests/editing/selection/select-start-remove-root-crash.html (rev 0)
+++ branches/chromium/782/LayoutTests/editing/selection/select-start-remove-root-crash.html 2011-08-12 17:17:46 UTC (rev 92968)
@@ -0,0 +1,24 @@
+<html>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function runTest()
+{
+ document.write("PASS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function select()
+{
+ document.execCommand("SelectAll");
+}
+
+window.addEventListener("selectstart", runTest, true);
+window.setInterval(select, 0);
+</script>
+</html>
\ No newline at end of file
Modified: branches/chromium/782/Source/WebCore/editing/FrameSelection.cpp (92967 => 92968)
--- branches/chromium/782/Source/WebCore/editing/FrameSelection.cpp 2011-08-12 17:15:39 UTC (rev 92967)
+++ branches/chromium/782/Source/WebCore/editing/FrameSelection.cpp 2011-08-12 17:17:46 UTC (rev 92968)
@@ -1455,14 +1455,14 @@
}
}
- Node* root = 0;
+ RefPtr<Node> root = 0;
Node* selectStartTarget = 0;
if (isContentEditable()) {
root = highestEditableRoot(m_selection.start());
if (Node* shadowRoot = m_selection.nonBoundaryShadowTreeRootNode())
selectStartTarget = shadowRoot->shadowAncestorNode();
else
- selectStartTarget = root;
+ selectStartTarget = root.get();
} else {
root = m_selection.nonBoundaryShadowTreeRootNode();
if (root)
@@ -1478,7 +1478,7 @@
if (selectStartTarget && !selectStartTarget->dispatchEvent(Event::create(eventNames().selectstartEvent, true, true)))
return;
- VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(root));
+ VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(root.get()));
if (shouldChangeSelection(newSelection))
setSelection(newSelection);
Modified: branches/chromium/782/Source/WebCore/editing/ReplaceSelectionCommand.cpp (92967 => 92968)
--- branches/chromium/782/Source/WebCore/editing/ReplaceSelectionCommand.cpp 2011-08-12 17:15:39 UTC (rev 92967)
+++ branches/chromium/782/Source/WebCore/editing/ReplaceSelectionCommand.cpp 2011-08-12 17:17:46 UTC (rev 92968)
@@ -139,7 +139,7 @@
if (!m_fragment->firstChild())
return;
- Element* editableRoot = selection.rootEditableElement();
+ RefPtr<Element> editableRoot = selection.rootEditableElement();
ASSERT(editableRoot);
if (!editableRoot)
return;
@@ -154,8 +154,8 @@
return;
}
- Node* styleNode = selection.base().deprecatedNode();
- RefPtr<StyledElement> holder = insertFragmentForTestRendering(styleNode);
+ RefPtr<Node> styleNode = selection.base().deprecatedNode();
+ RefPtr<StyledElement> holder = insertFragmentForTestRendering(styleNode.get());
if (!holder) {
removeInterchangeNodes(m_fragment.get());
return;
@@ -175,7 +175,7 @@
m_fragment = createFragmentFromText(selection.toNormalizedRange().get(), evt->text());
if (!m_fragment->firstChild())
return;
- holder = insertFragmentForTestRendering(styleNode);
+ holder = insertFragmentForTestRendering(styleNode.get());
}
removeInterchangeNodes(holder.get());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes