Commit 5c095ffd authored by justing's avatar justing

LayoutTests:

        Reviewed by oliver
        
        <rdar://problem/5120591> Crash when creating a link in Leopard wiki server

        * editing/execCommand/5120591-expected.checksum: Added.
        * editing/execCommand/5120591-expected.png: Added.
        * editing/execCommand/5120591-expected.txt: Added.
        * editing/execCommand/5120591.html: Added.

WebCore:

        Reviewed by oliver

        <rdar://problem/5120591> 
        Crash when creating a link in Leopard wiki server

        * editing/CreateLinkCommand.cpp:
        (WebCore::CreateLinkCommand::doApply): Use a RefPtr,
        setting the anchor's href can destroy it if there is
        an ancestor with a subtree modified event listener.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b152343d
2007-04-26 Justin Garcia <justin.garcia@apple.com>
Reviewed by oliver
<rdar://problem/5120591> Crash when creating a link in Leopard wiki server
* editing/execCommand/5120591-expected.checksum: Added.
* editing/execCommand/5120591-expected.png: Added.
* editing/execCommand/5120591-expected.txt: Added.
* editing/execCommand/5120591.html: Added.
2007-04-26 Matt Perry <mpComplete@gmail.com>
Reviewed, tweaked and landed by Alexey.
6a3283980391f6371da9cd66cc2223b3
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 574x18
text run at (0,0) width 574: "Tests for a crash when creating a link inside a region with a subtree modified event listener."
RenderBlock {DIV} at (0,34) size 784x18
RenderInline {A} at (0,0) size 136x18 [color=#0000EE]
RenderText {#text} at (0,0) size 136x18
text run at (0,0) width 136: "This should be a link."
selection start: position 0 of child 0 {#text} of child 0 {A} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
selection end: position 22 of child 0 {#text} of child 0 {A} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>Tests for a crash when creating a link inside a region with a subtree modified event listener.</p>
<div contenteditable="true" id="div">This should be a link.</div>
<script>
var div = document.getElementById("div");
div.addEventListener('DOMSubtreeModified', function () {;});
div.focus();
document.execCommand("SelectAll");
document.execCommand("CreateLink", false, "#");
</script>
2007-04-26 Justin Garcia <justin.garcia@apple.com>
Reviewed by oliver
<rdar://problem/5120591>
Crash when creating a link in Leopard wiki server
* editing/CreateLinkCommand.cpp:
(WebCore::CreateLinkCommand::doApply): Use a RefPtr,
setting the anchor's href can destroy it if there is
an ancestor with a subtree modified event listener.
2007-04-26 Mitz Pettel <mitz@webkit.org>
Reviewed by hyatt
......@@ -43,9 +43,9 @@ void CreateLinkCommand::doApply()
pushPartiallySelectedAnchorElementsDown();
HTMLAnchorElement* anchorElement = new HTMLAnchorElement(document());
RefPtr<HTMLAnchorElement> anchorElement = new HTMLAnchorElement(document());
anchorElement->setHref(m_url);
applyStyledElement(anchorElement);
applyStyledElement(anchorElement.get());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment