summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 22:16:05 +0000
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 22:16:05 +0000
commit65a6150d49263ff6e3135c5631f9ba5eb12823df (patch)
tree36f5b8624ae02cc69ae29ade9923404f6fec80b3 /webkit
parent9f53c7d5f1ce83bb2025b1797300c6d60dd7d8ff (diff)
downloadchromium_src-65a6150d49263ff6e3135c5631f9ba5eb12823df.zip
chromium_src-65a6150d49263ff6e3135c5631f9ba5eb12823df.tar.gz
chromium_src-65a6150d49263ff6e3135c5631f9ba5eb12823df.tar.bz2
Roll webkit deps 48155:48185 and remove a couple of passing tests from test_expectations.txt.
Also, merge in http://codereview.chromium.org/174367 (original author: vandebo@chromium.org), which is the downstream half of r48168. BUG=4360 BUG=21228 BUG=18792 TEST=none TBR=eroman git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/api/public/WebClipboard.h13
-rw-r--r--webkit/api/public/WebViewClient.h12
-rw-r--r--webkit/api/src/AssertMatchingEnums.cpp3
-rw-r--r--webkit/api/src/ChromiumBridge.cpp19
-rw-r--r--webkit/glue/webclipboard_impl.cc50
-rw-r--r--webkit/glue/webclipboard_impl.h10
-rw-r--r--webkit/glue/webkit_glue.h9
-rw-r--r--webkit/glue/webview_delegate.h8
-rw-r--r--webkit/glue/webview_impl.cc8
-rw-r--r--webkit/tools/layout_tests/test_expectations.txt11
-rw-r--r--webkit/tools/test_shell/mock_webclipboard_impl.cc21
-rw-r--r--webkit/tools/test_shell/mock_webclipboard_impl.h8
-rw-r--r--webkit/tools/test_shell/simple_clipboard_impl.cc17
13 files changed, 122 insertions, 67 deletions
diff --git a/webkit/api/public/WebClipboard.h b/webkit/api/public/WebClipboard.h
index 311800b..d995680 100644
--- a/webkit/api/public/WebClipboard.h
+++ b/webkit/api/public/WebClipboard.h
@@ -46,10 +46,17 @@ namespace WebKit {
FormatSmartPaste
};
- virtual bool isFormatAvailable(Format) = 0;
+ enum Buffer {
+ BufferStandard,
+ // Used on platforms like the X Window System that treat selection
+ // as a type of clipboard.
+ BufferSelection
+ };
+
+ virtual bool isFormatAvailable(Format, Buffer) = 0;
- virtual WebString readPlainText() = 0;
- virtual WebString readHTML(WebURL*) = 0;
+ virtual WebString readPlainText(Buffer) = 0;
+ virtual WebString readHTML(Buffer, WebURL*) = 0;
virtual void writeHTML(
const WebString& htmlText, const WebURL&,
diff --git a/webkit/api/public/WebViewClient.h b/webkit/api/public/WebViewClient.h
index fbb56d0..54dae44 100644
--- a/webkit/api/public/WebViewClient.h
+++ b/webkit/api/public/WebViewClient.h
@@ -1,10 +1,10 @@
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -97,12 +97,6 @@ namespace WebKit {
virtual void spellCheck(
const WebString& word, int& misspelledOffset, int& misspelledLength) = 0;
- // Request the text on the selection clipboard be sent back to the
- // WebView so it can be inserted into the current focus area. This is
- // only meaningful on platforms that have a selection clipboard (e.g.,
- // X-Windows).
- virtual void pasteFromSelectionClipboard() = 0;
-
// Dialogs -------------------------------------------------------------
diff --git a/webkit/api/src/AssertMatchingEnums.cpp b/webkit/api/src/AssertMatchingEnums.cpp
index c40d708..32a79c0 100644
--- a/webkit/api/src/AssertMatchingEnums.cpp
+++ b/webkit/api/src/AssertMatchingEnums.cpp
@@ -73,6 +73,9 @@ COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatHTML, PasteboardPrivate::HTMLFo
COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatBookmark, PasteboardPrivate::BookmarkFormat);
COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatSmartPaste, PasteboardPrivate::WebSmartPasteFormat);
+COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::BufferStandard, PasteboardPrivate::StandardBuffer);
+COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::BufferSelection, PasteboardPrivate::SelectionBuffer);
+
COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypePointer, PlatformCursor::TypePointer);
COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCross, PlatformCursor::TypeCross);
COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeHand, PlatformCursor::TypeHand);
diff --git a/webkit/api/src/ChromiumBridge.cpp b/webkit/api/src/ChromiumBridge.cpp
index 8d6dc25..9b07db3 100644
--- a/webkit/api/src/ChromiumBridge.cpp
+++ b/webkit/api/src/ChromiumBridge.cpp
@@ -72,21 +72,28 @@ namespace WebCore {
// Clipboard ------------------------------------------------------------------
bool ChromiumBridge::clipboardIsFormatAvailable(
- PasteboardPrivate::ClipboardFormat format)
+ PasteboardPrivate::ClipboardFormat format,
+ PasteboardPrivate::ClipboardBuffer buffer)
{
return webKitClient()->clipboard()->isFormatAvailable(
- static_cast<WebClipboard::Format>(format));
+ static_cast<WebClipboard::Format>(format),
+ static_cast<WebClipboard::Buffer>(buffer));
}
-String ChromiumBridge::clipboardReadPlainText()
+String ChromiumBridge::clipboardReadPlainText(
+ PasteboardPrivate::ClipboardBuffer buffer)
{
- return webKitClient()->clipboard()->readPlainText();
+ return webKitClient()->clipboard()->readPlainText(
+ static_cast<WebClipboard::Buffer>(buffer));
}
-void ChromiumBridge::clipboardReadHTML(String* htmlText, KURL* sourceURL)
+void ChromiumBridge::clipboardReadHTML(
+ PasteboardPrivate::ClipboardBuffer buffer,
+ String* htmlText, KURL* sourceURL)
{
WebURL url;
- *htmlText = webKitClient()->clipboard()->readHTML(&url);
+ *htmlText = webKitClient()->clipboard()->readHTML(
+ static_cast<WebClipboard::Buffer>(buffer), &url);
*sourceURL = url;
}
diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc
index e2be557..4798eff 100644
--- a/webkit/glue/webclipboard_impl.cc
+++ b/webkit/glue/webclipboard_impl.cc
@@ -55,8 +55,9 @@ std::string WebClipboardImpl::URLToImageMarkup(const WebURL& url,
return markup;
}
-bool WebClipboardImpl::isFormatAvailable(Format format) {
+bool WebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) {
Clipboard::FormatType format_type;
+ Clipboard::Buffer buffer_type;
switch (format) {
case FormatHTML:
@@ -75,20 +76,29 @@ bool WebClipboardImpl::isFormatAvailable(Format format) {
return false;
}
- return ClipboardIsFormatAvailable(format_type);
+ if (!ConvertBufferType(buffer, &buffer_type))
+ return false;
+
+ return ClipboardIsFormatAvailable(format_type, buffer_type);
}
-WebString WebClipboardImpl::readPlainText() {
- if (ClipboardIsFormatAvailable(Clipboard::GetPlainTextWFormatType())) {
+WebString WebClipboardImpl::readPlainText(Buffer buffer) {
+ Clipboard::Buffer buffer_type;
+ if (!ConvertBufferType(buffer, &buffer_type))
+ return WebString();
+
+ if (ClipboardIsFormatAvailable(Clipboard::GetPlainTextWFormatType(),
+ buffer_type)) {
string16 text;
- ClipboardReadText(&text);
+ ClipboardReadText(buffer_type, &text);
if (!text.empty())
return text;
}
- if (ClipboardIsFormatAvailable(Clipboard::GetPlainTextFormatType())) {
+ if (ClipboardIsFormatAvailable(Clipboard::GetPlainTextFormatType(),
+ buffer_type)) {
std::string text;
- ClipboardReadAsciiText(&text);
+ ClipboardReadAsciiText(buffer_type, &text);
if (!text.empty())
return ASCIIToUTF16(text);
}
@@ -96,10 +106,14 @@ WebString WebClipboardImpl::readPlainText() {
return WebString();
}
-WebString WebClipboardImpl::readHTML(WebURL* source_url) {
+WebString WebClipboardImpl::readHTML(Buffer buffer, WebURL* source_url) {
+ Clipboard::Buffer buffer_type;
+ if (!ConvertBufferType(buffer, &buffer_type))
+ return WebString();
+
string16 html_stdstr;
GURL gurl;
- ClipboardReadHTML(&html_stdstr, &gurl);
+ ClipboardReadHTML(buffer_type, &html_stdstr, &gurl);
*source_url = gurl;
return html_stdstr;
}
@@ -144,4 +158,22 @@ void WebClipboardImpl::writeImage(
}
}
+bool WebClipboardImpl::ConvertBufferType(Buffer buffer,
+ Clipboard::Buffer* result) {
+ switch (buffer) {
+ case BufferStandard:
+ *result = Clipboard::BUFFER_STANDARD;
+ break;
+ case BufferSelection:
+#if defined(OS_LINUX)
+ *result = Clipboard::BUFFER_SELECTION;
+ break;
+#endif
+ default:
+ NOTREACHED();
+ return false;
+ }
+ return true;
+}
+
} // namespace webkit_glue
diff --git a/webkit/glue/webclipboard_impl.h b/webkit/glue/webclipboard_impl.h
index 52762da..cc86505 100644
--- a/webkit/glue/webclipboard_impl.h
+++ b/webkit/glue/webclipboard_impl.h
@@ -5,6 +5,7 @@
#ifndef WEBCLIPBOARD_IMPL_H_
#define WEBCLIPBOARD_IMPL_H_
+#include "base/clipboard.h"
#include "webkit/api/public/WebClipboard.h"
#include <string>
@@ -21,9 +22,9 @@ class WebClipboardImpl : public WebKit::WebClipboard {
virtual ~WebClipboardImpl() {}
// WebClipboard methods:
- virtual bool isFormatAvailable(WebKit::WebClipboard::Format);
- virtual WebKit::WebString readPlainText();
- virtual WebKit::WebString readHTML(WebKit::WebURL* source_url);
+ virtual bool isFormatAvailable(Format, Buffer);
+ virtual WebKit::WebString readPlainText(Buffer);
+ virtual WebKit::WebString readHTML(Buffer, WebKit::WebURL* source_url);
virtual void writeHTML(
const WebKit::WebString& html_text,
const WebKit::WebURL& source_url,
@@ -36,6 +37,9 @@ class WebClipboardImpl : public WebKit::WebClipboard {
const WebKit::WebImage&,
const WebKit::WebURL& source_url,
const WebKit::WebString& title);
+
+ private:
+ bool ConvertBufferType(Buffer, Clipboard::Buffer*);
};
} // namespace webkit_glue
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index 24e3f46..302f047 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -152,16 +152,17 @@ HCURSOR LoadCursor(int cursor_id);
Clipboard* ClipboardGetClipboard();
// Tests whether the clipboard contains a certain format
-bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format);
+bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format,
+ Clipboard::Buffer buffer);
// Reads UNICODE text from the clipboard, if available.
-void ClipboardReadText(string16* result);
+void ClipboardReadText(Clipboard::Buffer buffer, string16* result);
// Reads ASCII text from the clipboard, if available.
-void ClipboardReadAsciiText(std::string* result);
+void ClipboardReadAsciiText(Clipboard::Buffer buffer, std::string* result);
// Reads HTML from the clipboard, if available.
-void ClipboardReadHTML(string16* markup, GURL* url);
+void ClipboardReadHTML(Clipboard::Buffer buffer, string16* markup, GURL* url);
// Gets the directory where the application data and libraries exist. This
// may be a versioned subdirectory, or it may be the same directory as the
diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h
index 7a8e313..99d9be36 100644
--- a/webkit/glue/webview_delegate.h
+++ b/webkit/glue/webview_delegate.h
@@ -719,14 +719,6 @@ class WebViewDelegate : virtual public WebKit::WebWidgetClient {
return NULL;
}
- // Selection clipboard -----------------------------------------------------
-
- // Request the text on the selection clipboard be sent back to the webview
- // so it can be inserted into the current focus area. In response to this call
- // the delegate should get the text and send it to the WebView via
- // InsertText().
- virtual void PasteFromSelectionClipboard() { }
-
// Editor Client -----------------------------------------------------------
// Returns true if the word is spelled correctly. The word may begin or end
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index cc9ebbd..f3cf268 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -35,6 +35,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "NodeRenderStyle.h"
#include "Page.h"
#include "PageGroup.h"
+#include "Pasteboard.h"
#include "PlatformContextSkia.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformMouseEvent.h"
@@ -564,8 +565,11 @@ void WebViewImpl::MouseUp(const WebMouseEvent& event) {
ShouldHitTestScrollbars);
if (!hit_test_result.scrollbar() && focused) {
Editor* editor = focused->editor();
- if (editor && editor->canEdit())
- delegate_->PasteFromSelectionClipboard();
+ Pasteboard* pasteboard = Pasteboard::generalPasteboard();
+ bool oldSelectionMode = pasteboard->isSelectionMode();
+ pasteboard->setSelectionMode(true);
+ editor->command(AtomicString("Paste")).execute();
+ pasteboard->setSelectionMode(oldSelectionMode);
}
}
#endif
diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt
index 6aa8922..54aeab7 100644
--- a/webkit/tools/layout_tests/test_expectations.txt
+++ b/webkit/tools/layout_tests/test_expectations.txt
@@ -586,9 +586,6 @@ WONTFIX : LayoutTests/storage/domstorage/sessionstorage/private-browsing-affects
// Depends on SessionStorage. I'm not sure if this is working yet, but I don't think we need to SKIP it.
BUG4360 : LayoutTests/http/tests/loading/deleted-host-in-resource-load-delegate-callback.html = TIMEOUT
-// WebKit and us disagree how this is best done. Disable for now.
-BUG4360 : LayoutTests/storage/domstorage/localstorage/complex-keys.html = FAIL
-
// Database
BUG4359 SKIP : LayoutTests/storage/close-during-stress-test.html = PASS
BUG4359 SKIP : LayoutTests/storage/database-lock-after-reload.html = PASS
@@ -1993,9 +1990,6 @@ BUG11123 LINUX : LayoutTests/fast/css/nested-layers-with-hover.html = FAIL
BUG11123 LINUX : LayoutTests/fast/forms/textarea-scrollbar.html = FAIL
BUG11123 LINUX : LayoutTests/fast/forms/textarea-scrolled-type.html = FAIL
-// New tests from WebKit Merge 42932:42994
-BUG21128 : LayoutTests/http/tests/xmlhttprequest/detaching-frame-2.html = FAIL
-
// Chrome does not support WebArchives (just like Safari for Windows),
// although we might eventually want to on Mac.
WONTFIX SKIP : LayoutTests/webarchive/adopt-attribute-styled-body-webarchive.html = FAIL
@@ -2433,9 +2427,8 @@ BUG_VICTORW : LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-jav
// Webkit 48061:48071
BUG_VICTORW WIN DEBUG : LayoutTests/fast/regex/cross-frame-callable.html = TIMEOUT
-// Webkit 48071:48078
-BUG_VICTORW MAC : LayoutTests/fast/forms/enter-clicks-buttons.html = CRASH
-
// WebKit 48098:48155
BUG21267 : LayoutTests/fast/events/click-focus-anchor.html = FAIL
BUG21267 : LayoutTests/fast/events/tab-focus-anchor.html = FAIL
+
+BUG_JAPHET MAC : LayoutTests/animations/change-keyframes-name.html = FAIL PASS
diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.cc b/webkit/tools/test_shell/mock_webclipboard_impl.cc
index 32f3f01..7a428be 100644
--- a/webkit/tools/test_shell/mock_webclipboard_impl.cc
+++ b/webkit/tools/test_shell/mock_webclipboard_impl.cc
@@ -16,7 +16,7 @@
using WebKit::WebString;
using WebKit::WebURL;
-bool MockWebClipboardImpl::isFormatAvailable(Format format) {
+bool MockWebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) {
switch (format) {
case FormatHTML:
return !m_htmlText.isEmpty();
@@ -28,15 +28,30 @@ bool MockWebClipboardImpl::isFormatAvailable(Format format) {
NOTREACHED();
return false;
}
+
+ switch (buffer) {
+ case BufferStandard:
+ break;
+ case BufferSelection:
+#if defined(OS_LINUX)
+ break;
+#endif
+ default:
+ NOTREACHED();
+ return false;
+ }
+
return true;
}
-WebKit::WebString MockWebClipboardImpl::readPlainText() {
+WebKit::WebString MockWebClipboardImpl::readPlainText(
+ WebKit::WebClipboard::Buffer buffer) {
return m_plainText;
}
// TODO(wtc): set output argument *url.
-WebKit::WebString MockWebClipboardImpl::readHTML(WebKit::WebURL* url) {
+WebKit::WebString MockWebClipboardImpl::readHTML(
+ WebKit::WebClipboard::Buffer buffer, WebKit::WebURL* url) {
return m_htmlText;
}
diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.h b/webkit/tools/test_shell/mock_webclipboard_impl.h
index dd47835..4aa616f 100644
--- a/webkit/tools/test_shell/mock_webclipboard_impl.h
+++ b/webkit/tools/test_shell/mock_webclipboard_impl.h
@@ -15,10 +15,12 @@
class MockWebClipboardImpl : public WebKit::WebClipboard {
public:
- virtual bool isFormatAvailable(WebKit::WebClipboard::Format);
+ virtual bool isFormatAvailable(WebKit::WebClipboard::Format,
+ WebKit::WebClipboard::Buffer);
- virtual WebKit::WebString readPlainText();
- virtual WebKit::WebString readHTML(WebKit::WebURL*);
+ virtual WebKit::WebString readPlainText(WebKit::WebClipboard::Buffer);
+ virtual WebKit::WebString readHTML(WebKit::WebClipboard::Buffer,
+ WebKit::WebURL*);
virtual void writeHTML(
const WebKit::WebString& htmlText, const WebKit::WebURL&,
diff --git a/webkit/tools/test_shell/simple_clipboard_impl.cc b/webkit/tools/test_shell/simple_clipboard_impl.cc
index 323c04c..fc67ece 100644
--- a/webkit/tools/test_shell/simple_clipboard_impl.cc
+++ b/webkit/tools/test_shell/simple_clipboard_impl.cc
@@ -33,21 +33,22 @@ Clipboard* ClipboardGetClipboard() {
return clipboard.Pointer();
}
-bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format) {
- return ClipboardGetClipboard()->IsFormatAvailable(format);
+bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format,
+ Clipboard::Buffer buffer) {
+ return ClipboardGetClipboard()->IsFormatAvailable(format, buffer);
}
-void ClipboardReadText(string16* result) {
- ClipboardGetClipboard()->ReadText(result);
+void ClipboardReadText(Clipboard::Buffer buffer, string16* result) {
+ ClipboardGetClipboard()->ReadText(buffer, result);
}
-void ClipboardReadAsciiText(std::string* result) {
- ClipboardGetClipboard()->ReadAsciiText(result);
+void ClipboardReadAsciiText(Clipboard::Buffer buffer, std::string* result) {
+ ClipboardGetClipboard()->ReadAsciiText(buffer, result);
}
-void ClipboardReadHTML(string16* markup, GURL* url) {
+void ClipboardReadHTML(Clipboard::Buffer buffer, string16* markup, GURL* url) {
std::string url_str;
- ClipboardGetClipboard()->ReadHTML(markup, url ? &url_str : NULL);
+ ClipboardGetClipboard()->ReadHTML(buffer, markup, url ? &url_str : NULL);
if (url)
*url = GURL(url_str);
}