Title: [92967] branches/chromium/835
- Revision
- 92967
- Author
- cev...@google.com
- Date
- 2011-08-12 10:15:39 -0700 (Fri, 12 Aug 2011)
Log Message
Merge 92966
BUG=92621
Review URL: http://codereview.chromium.org/7635022
Modified Paths
Added Paths
Diff
Copied: branches/chromium/835/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 => 92967)
--- branches/chromium/835/LayoutTests/editing/selection/select-start-remove-root-crash-expected.txt (rev 0)
+++ branches/chromium/835/LayoutTests/editing/selection/select-start-remove-root-crash-expected.txt 2011-08-12 17:15:39 UTC (rev 92967)
@@ -0,0 +1 @@
+PASS
Copied: branches/chromium/835/LayoutTests/editing/selection/select-start-remove-root-crash.html (from rev 92966, trunk/LayoutTests/editing/selection/select-start-remove-root-crash.html) (0 => 92967)
--- branches/chromium/835/LayoutTests/editing/selection/select-start-remove-root-crash.html (rev 0)
+++ branches/chromium/835/LayoutTests/editing/selection/select-start-remove-root-crash.html 2011-08-12 17:15:39 UTC (rev 92967)
@@ -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/835/Source/WebCore/editing/FrameSelection.cpp (92966 => 92967)
--- branches/chromium/835/Source/WebCore/editing/FrameSelection.cpp 2011-08-12 16:27:57 UTC (rev 92966)
+++ branches/chromium/835/Source/WebCore/editing/FrameSelection.cpp 2011-08-12 17:15:39 UTC (rev 92967)
@@ -1431,14 +1431,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)
@@ -1454,7 +1454,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/835/Source/WebCore/editing/ReplaceSelectionCommand.cpp (92966 => 92967)
--- branches/chromium/835/Source/WebCore/editing/ReplaceSelectionCommand.cpp 2011-08-12 16:27:57 UTC (rev 92966)
+++ branches/chromium/835/Source/WebCore/editing/ReplaceSelectionCommand.cpp 2011-08-12 17:15:39 UTC (rev 92967)
@@ -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
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes