Commit c94d9b36 authored by tony@chromium.org's avatar tony@chromium.org

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

        Reviewed by Ryosuke Niwa.

        [gtk] strip NUL characters when copying text/html on GTK+
        https://bugs.webkit.org/show_bug.cgi?id=52508

        * editing/pasteboard/copy-null-characters.html: Make sure we didn't
            change innerHTML (it should still contain the null)
        * platform/gtk/Skipped: Re-enable the test
2011-01-26  Tony Chang  <tony@chromium.org>

        Reviewed by Ryosuke Niwa.

        [gtk] strip NUL characters when copying text/html on GTK+
        https://bugs.webkit.org/show_bug.cgi?id=52508

        Putting NUL characters in the text/html clipboard doesn't work in
        WebKit GTK+ (the pasted value is truncated at the NUL).  Since we're
        already stripping this character for plain text (for Windows), strip
        it in text/html too.

        * editing/MarkupAccumulator.h: mark function as virtual
        * editing/markup.cpp:
        (WebCore::StyledMarkupAccumulator::appendString):
        (WebCore::StyledMarkupAccumulator::takeResults): strip nulls

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9543fe8a
2011-01-26 Tony Chang <tony@chromium.org>
Reviewed by Ryosuke Niwa.
[gtk] strip NUL characters when copying text/html on GTK+
https://bugs.webkit.org/show_bug.cgi?id=52508
* editing/pasteboard/copy-null-characters.html: Make sure we didn't
change innerHTML (it should still contain the null)
* platform/gtk/Skipped: Re-enable the test
2011-01-26 Martin Robinson <mrobinson@igalia.com>
Add the next set of CSS 2.1 baselines for GTK+.
......@@ -11,6 +11,18 @@ function runTest()
var source = document.getElementById("source");
var textWithNull = "Copy\0 paste me";
source.textContent = textWithNull;
var results = document.getElementById("results");
// Make sure innerHTML still has the NULL.
if (source.innerHTML != textWithNull) {
results.innerText = "source.innerHTML has the wrong value (expected " +
JSON.stringify(textWithNull) + " but found " +
JSON.stringify(source.innerHTML) + ").";
Markup.dump(document.body);
Markup.notifyDone();
return;
}
sel.setPosition(source, 0);
document.execCommand("SelectAll");
document.execCommand("Copy");
......@@ -23,7 +35,6 @@ function runTest()
destinationPlainText.focus();
document.execCommand("Paste");
var results = document.getElementById("results");
var expectedPlainTextValue = "Copy paste me";
if (expectedPlainTextValue != destinationPlainText.value) {
results.innerText = "Plain text field has the wrong value (expected " +
......
......@@ -5272,9 +5272,6 @@ editing/input/page-up-down-scrolls.html
# DRT does not obey layoutTestController.addURLToRedirect()
http/tests/loading/cross-origin-XHR-willLoadRequest.html
# https://bugs.webkit.org/show_bug.cgi?id=52508
editing/pasteboard/copy-null-characters.html
# https://bugs.webkit.org/show_bug.cgi?id=52798
http/tests/security/local-CSS-from-remote.html
http/tests/security/local-JavaScript-from-remote.html
......
2011-01-26 Tony Chang <tony@chromium.org>
Reviewed by Ryosuke Niwa.
[gtk] strip NUL characters when copying text/html on GTK+
https://bugs.webkit.org/show_bug.cgi?id=52508
Putting NUL characters in the text/html clipboard doesn't work in
WebKit GTK+ (the pasted value is truncated at the NUL). Since we're
already stripping this character for plain text (for Windows), strip
it in text/html too.
* editing/MarkupAccumulator.h: mark function as virtual
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendString):
(WebCore::StyledMarkupAccumulator::takeResults): strip nulls
2011-01-26 Mario Sanchez Prada <msanchez@igalia.com>
Reviewed by Martin Robinson.
......@@ -72,7 +72,7 @@ public:
String serializeNodes(Node* node, Node* nodeToSkip, EChildrenOnly childrenOnly);
protected:
void appendString(const String&);
virtual void appendString(const String&);
void appendStartTag(Node*, Namespaces* = 0);
void appendEndTag(Node*);
static size_t totalLength(const Vector<String>&);
......
......@@ -124,7 +124,7 @@ public:
}
Node* serializeNodes(Node* startNode, Node* pastEnd);
void appendString(const String& s) { return MarkupAccumulator::appendString(s); }
virtual void appendString(const String& s) { return MarkupAccumulator::appendString(s); }
void wrapWithNode(Node*, bool convertBlocksToInlines = false, RangeFullySelectsNode = DoesFullySelectNode);
void wrapWithStyleNode(CSSStyleDeclaration*, Document*, bool isBlock = false);
String takeResults();
......@@ -184,7 +184,8 @@ String StyledMarkupAccumulator::takeResults()
concatenateMarkup(result);
return String::adopt(result);
// We remove '\0' characters because they are not visibly rendered to the user.
return String::adopt(result).replace(0, "");
}
void StyledMarkupAccumulator::appendText(Vector<UChar>& out, Text* text)
......
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