Changeset 75861 in webkit


Ignore:
Timestamp:
Jan 14, 2011 6:06:08 PM (13 years ago)
Author:
tony@chromium.org
Message:

2011-01-14 Tony Chang <tony@chromium.org>

Reviewed by Alexey Proskuryakov.

Strip NUL character when copying text on Windows
https://bugs.webkit.org/show_bug.cgi?id=52236

  • editing/pasteboard/copy-null-characters-expected.txt: Added.
  • editing/pasteboard/copy-null-characters.html: Added.

2011-01-14 Tony Chang <tony@chromium.org>

Reviewed by Alexey Proskuryakov.

Strip NUL character when copying text on Windows
https://bugs.webkit.org/show_bug.cgi?id=52236

Test: editing/pasteboard/copy-null-characters.html

  • editing/Editor.cpp: (WebCore::Editor::selectedText):
  • platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::writeSelection): Use editor()->selectedText() which matches the other platforms.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r75854 r75861  
     12011-01-14  Tony Chang  <tony@chromium.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Strip NUL character when copying text on Windows
     6        https://bugs.webkit.org/show_bug.cgi?id=52236
     7
     8        * editing/pasteboard/copy-null-characters-expected.txt: Added.
     9        * editing/pasteboard/copy-null-characters.html: Added.
     10
    1112011-01-14  Nico Weber  <thakis@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r75857 r75861  
     12011-01-14  Tony Chang  <tony@chromium.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Strip NUL character when copying text on Windows
     6        https://bugs.webkit.org/show_bug.cgi?id=52236
     7
     8        Test: editing/pasteboard/copy-null-characters.html
     9
     10        * editing/Editor.cpp:
     11        (WebCore::Editor::selectedText):
     12        * platform/mac/PasteboardMac.mm:
     13        (WebCore::Pasteboard::writeSelection): Use editor()->selectedText() which matches the other platforms.
     14
    1152011-01-14  Yuzo Fujishima  <yuzo@google.com>
    216
  • trunk/Source/WebCore/editing/Editor.cpp

    r75837 r75861  
    30333033String Editor::selectedText() const
    30343034{
    3035     return plainText(m_frame->selection()->toNormalizedRange().get());
     3035    // We remove '\0' characters because they are not visibly rendered to the user.
     3036    return plainText(m_frame->selection()->toNormalizedRange().get()).replace(0, "");
    30363037}
    30373038
  • trunk/Source/WebCore/platform/mac/PasteboardMac.mm

    r75523 r75861  
    192192        // Map &nbsp; to a plain old space because this is better for source code, other browsers do it,
    193193        // and because HTML forces you to do this any time you want two spaces in a row.
    194         String text = selectedRange->text();
     194        String text = frame->editor()->selectedText();
    195195        NSMutableString *s = [[[(NSString*)text copy] autorelease] mutableCopy];
    196196       
Note: See TracChangeset for help on using the changeset viewer.