[webkit-changes] [20456] trunk

David Harrison harrison at apple.com
Fri Mar 23 18:04:28 PDT 2007


r=me

On Mar 23, 2007, at 5:58 PM, justing at webkit.org wrote:

> Revision
> 20456
> Author
> justing
> Date
> 2007-03-23 17:58:09 -0700 (Fri, 23 Mar 2007)
> Log Message
>
> LayoutTests:
>
>         Reviewed by adele
>
>         <rdar://problem/5078739>
>         Crash in in ReplaceSelectionCommand if the fragment contains  
> only a style span
>
>         * editing/pasteboard/5078739-expected.txt: Added.
>         * editing/pasteboard/5078739.html: Added.
>
> WebCore:
>
>         Reviewed by adele
>
>         <rdar://problem/5078739>
>         Crash in in ReplaceSelectionCommand if the fragment contains  
> only a style span
>
>         * editing/ReplaceSelectionCommand.cpp:
>         (WebCore::ReplaceSelectionCommand::doApply): Check
>         for an empty fragment after removing a redundant
>         style span instead of before.
> Modified Paths
>
> trunk/LayoutTests/ChangeLog
> trunk/WebCore/ChangeLog
> trunk/WebCore/editing/ReplaceSelectionCommand.cpp
> Added Paths
>
> trunk/LayoutTests/editing/pasteboard/5078739-expected.txt
> trunk/LayoutTests/editing/pasteboard/5078739.html
> Diff
>
> Modified: trunk/LayoutTests/ChangeLog (20455 => 20456)
> --- trunk/LayoutTests/ChangeLog	2007-03-23 22:26:42 UTC (rev 20455)
> +++ trunk/LayoutTests/ChangeLog	2007-03-24 00:58:09 UTC (rev 20456)
> @@ -1,5 +1,15 @@
>  2007-03-23  Justin Garcia  <justin.garcia at apple.com>
>
> +        Reviewed by adele
> +
> +        <rdar://problem/5078739>
> +        Crash in in ReplaceSelectionCommand if the fragment  
> contains only a style span
> +
> +        * editing/pasteboard/5078739-expected.txt: Added.
> +        * editing/pasteboard/5078739.html: Added.
> +
> +2007-03-23  Justin Garcia  <justin.garcia at apple.com>
> +
>          Reviewed by darin
>
>          Fixed (was missing a newline):
> Added: trunk/LayoutTests/editing/pasteboard/5078739-expected.txt (0  
> => 20456)
> --- trunk/LayoutTests/editing/pasteboard/5078739- 
> expected.txt	                        (rev 0)
> +++ trunk/LayoutTests/editing/pasteboard/5078739-expected.txt	 
> 2007-03-24 00:58:09 UTC (rev 20456)
> @@ -0,0 +1,4 @@
> +This tests for a crash when the fragment contains only an  
> interchange newline.
> +
> +
> +
> Added: trunk/LayoutTests/editing/pasteboard/5078739.html (0 => 20456)
> --- trunk/LayoutTests/editing/pasteboard/ 
> 5078739.html	                        (rev 0)
> +++ trunk/LayoutTests/editing/pasteboard/5078739.html	2007-03-24  
> 00:58:09 UTC (rev 20456)
> @@ -0,0 +1,11 @@
> +<p>This tests for a crash when the fragment contains only an  
> interchange newline.</p>
> +<div id="div" contenteditable="true"><br></div>
> +
> +<script>
> +if (window.layoutTestController)
> +    window.layoutTestController.dumpAsText();
> +
> +var div = document.getElementById("div");
> +div.focus();
> +document.execCommand("InsertHTML", false, "<span class='Apple-style- 
> span' style='border-collapse: separate; color: rgb(0, 0, 0); font- 
> family: Times; font-size: 16px; font-style: normal; font-variant:  
> normal; font-weight: normal; letter-spacing: normal; line-height:  
> normal; orphans: 2; text-align: auto; text-indent: 0px; text- 
> transform: none; white-space: normal; widows: 2; word-spacing: 0px; - 
> webkit-border-horizontal-spacing: 0px; -webkit-border-vertical- 
> spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text- 
> fill-color: rgb(0, 0, 0); -webkit-text-size-adjust: auto; -webkit- 
> text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: 0; '></ 
> span>");
> +</script>
> Modified: trunk/WebCore/ChangeLog (20455 => 20456)
> --- trunk/WebCore/ChangeLog	2007-03-23 22:26:42 UTC (rev 20455)
> +++ trunk/WebCore/ChangeLog	2007-03-24 00:58:09 UTC (rev 20456)
> @@ -1,3 +1,15 @@
> +2007-03-23  Justin Garcia  <justin.garcia at apple.com>
> +
> +        Reviewed by adele
> +
> +        <rdar://problem/5078739>
> +        Crash in in ReplaceSelectionCommand if the fragment  
> contains only a style span
> +
> +        * editing/ReplaceSelectionCommand.cpp:
> +        (WebCore::ReplaceSelectionCommand::doApply): Check
> +        for an empty fragment after removing a redundant
> +        style span instead of before.
> +
>  2007-03-23  David Hyatt  <hyatt at apple.com>
>
>          <rdar://problem/5085063>
> Modified: trunk/WebCore/editing/ReplaceSelectionCommand.cpp (20455  
> => 20456)
> --- trunk/WebCore/editing/ReplaceSelectionCommand.cpp	2007-03-23  
> 22:26:42 UTC (rev 20455)
> +++ trunk/WebCore/editing/ReplaceSelectionCommand.cpp	2007-03-24  
> 00:58:09 UTC (rev 20456)
> @@ -544,10 +544,6 @@
>      frame->clearTypingStyle();
>      setTypingStyle(0);
>
> -    // We're finished if there is nothing to add.
> -    if (fragment.isEmpty() || !fragment.firstChild())
> -        return;
> -
>      // Remove the top level style span if its unnecessary before  
> inserting it into the document, its faster.
>      RefPtr<CSSMutableStyleDeclaration> styleAtInsertionPos =  
> insertionPos.computedStyle()->copyInheritableProperties();
>      if (isStyleSpan(fragment.firstChild())) {
> @@ -557,6 +553,10 @@
>              fragment.removeNodePreservingChildren(styleSpan);
>      }
>
> +    // We're finished if there is nothing to add.
> +    if (fragment.isEmpty() || !fragment.firstChild())
> +        return;
> +
>      // 1) Insert the content.
>      // 2) Remove redundant styles and style tags, this inner <b>  
> for example: <b>foo <b>bar</b> baz</b>.
>      // 3) Merge the start of the added content with the content  
> before the position being pasted into.
> _______________________________________________
> webkit-changes mailing list
> webkit-changes at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-changes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/webkit-changes/attachments/20070323/7edfee33/attachment.html


More information about the webkit-changes mailing list