[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
darin at apple.com
darin at apple.com
Wed Dec 22 18:46:22 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7d47c0ec033a82bab52393cfa712fd4a3eb6c268
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 17 17:57:44 2010 +0000
2010-12-16 Darin Adler <darin at apple.com>
Reviewed by Maciej Stachowiak.
Add text encoding menu API for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=51226
* UIProcess/API/C/WKPage.cpp:
(WKPageSupportsTextEncoding): Added.
(WKPageCopyCustomTextEncodingName): Added.
(WKPageSetCustomTextEncodingName): Added.
* UIProcess/API/C/WKPage.h: Added the functions above.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Initialize
m_mainFrameHasCustomRepresentation to false.
(WebKit::WebPageProxy::supportsTextEncoding): Added.
(WebKit::WebPageProxy::setCustomTextEncodingName): Added.
(WebKit::WebPageProxy::didCommitLoadForFrame): Set
m_mainFrameHasCustomRepresentation.
* UIProcess/WebPageProxy.h: Added supportsTextEncoding,
setCustomTextEncodingName, customTextEncodingName, and
m_mainFrameHasCustomRepresentation.
* UIProcess/WebPageProxy.messages.in: Tweaked formatting
(added a blank line).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setCustomTextEncodingName): Added.
* WebProcess/WebPage/WebPage.h: Added setCustomTextEncodingName.
* WebProcess/WebPage/WebPage.messages.in: Added the
SetCustomTextEncodingName message. Tweaked formatting of the
dummy message.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 5693a6f..69ae661 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,39 @@
+2010-12-16 Darin Adler <darin at apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Add text encoding menu API for WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=51226
+
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageSupportsTextEncoding): Added.
+ (WKPageCopyCustomTextEncodingName): Added.
+ (WKPageSetCustomTextEncodingName): Added.
+ * UIProcess/API/C/WKPage.h: Added the functions above.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy): Initialize
+ m_mainFrameHasCustomRepresentation to false.
+ (WebKit::WebPageProxy::supportsTextEncoding): Added.
+ (WebKit::WebPageProxy::setCustomTextEncodingName): Added.
+ (WebKit::WebPageProxy::didCommitLoadForFrame): Set
+ m_mainFrameHasCustomRepresentation.
+
+ * UIProcess/WebPageProxy.h: Added supportsTextEncoding,
+ setCustomTextEncodingName, customTextEncodingName, and
+ m_mainFrameHasCustomRepresentation.
+
+ * UIProcess/WebPageProxy.messages.in: Tweaked formatting
+ (added a blank line).
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::setCustomTextEncodingName): Added.
+ * WebProcess/WebPage/WebPage.h: Added setCustomTextEncodingName.
+
+ * WebProcess/WebPage/WebPage.messages.in: Added the
+ SetCustomTextEncodingName message. Tweaked formatting of the
+ dummy message.
+
2010-12-17 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r74201.
diff --git a/WebKit2/UIProcess/API/C/WKPage.cpp b/WebKit2/UIProcess/API/C/WKPage.cpp
index 844065c..4dd88be 100644
--- a/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -189,6 +189,21 @@ void WKPageSetCustomUserAgent(WKPageRef pageRef, WKStringRef userAgentRef)
toImpl(pageRef)->setCustomUserAgent(toWTFString(userAgentRef));
}
+bool WKPageSupportsTextEncoding(WKPageRef pageRef)
+{
+ return toImpl(pageRef)->supportsTextEncoding();
+}
+
+WKStringRef WKPageCopyCustomTextEncodingName(WKPageRef pageRef)
+{
+ return toCopiedAPI(toImpl(pageRef)->customTextEncodingName());
+}
+
+void WKPageSetCustomTextEncodingName(WKPageRef pageRef, WKStringRef encodingNameRef)
+{
+ toImpl(pageRef)->setCustomTextEncodingName(toWTFString(encodingNameRef));
+}
+
void WKPageTerminate(WKPageRef pageRef)
{
toImpl(pageRef)->terminateProcess();
diff --git a/WebKit2/UIProcess/API/C/WKPage.h b/WebKit2/UIProcess/API/C/WKPage.h
index 7b2919a..cd6bdd0 100644
--- a/WebKit2/UIProcess/API/C/WKPage.h
+++ b/WebKit2/UIProcess/API/C/WKPage.h
@@ -260,6 +260,10 @@ WK_EXPORT void WKPageSetApplicationNameForUserAgent(WKPageRef page, WKStringRef
WK_EXPORT WKStringRef WKPageCopyCustomUserAgent(WKPageRef page);
WK_EXPORT void WKPageSetCustomUserAgent(WKPageRef page, WKStringRef userAgent);
+WK_EXPORT bool WKPageSupportsTextEncoding(WKPageRef page);
+WK_EXPORT WKStringRef WKPageCopyCustomTextEncodingName(WKPageRef page);
+WK_EXPORT void WKPageSetCustomTextEncodingName(WKPageRef page, WKStringRef encodingName);
+
WK_EXPORT void WKPageTerminate(WKPageRef page);
WK_EXPORT WKStringRef WKPageGetSessionHistoryURLValueType(void);
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 2f868f3..58391e3 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -108,6 +108,7 @@ WebPageProxy::WebPageProxy(WebContext* context, WebPageGroup* pageGroup, uint64_
, m_syncMimeTypePolicyDownloadID(0)
, m_processingWheelEvent(false)
, m_pageID(pageID)
+ , m_mainFrameHasCustomRepresentation(false)
{
#ifndef NDEBUG
webPageProxyCounter.increment();
@@ -660,6 +661,22 @@ void WebPageProxy::setCustomUserAgent(const String& customUserAgent)
setUserAgent(m_customUserAgent);
}
+bool WebPageProxy::supportsTextEncoding() const
+{
+ return !m_mainFrameHasCustomRepresentation && m_mainFrame && !m_mainFrame->isDisplayingStandaloneImageDocument();
+}
+
+void WebPageProxy::setCustomTextEncodingName(const String& encodingName)
+{
+ if (m_customTextEncodingName == encodingName)
+ return;
+ m_customTextEncodingName = encodingName;
+
+ if (!isValid())
+ return;
+ process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
+}
+
void WebPageProxy::terminateProcess()
{
if (!isValid())
@@ -930,8 +947,10 @@ void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeTyp
frame->setCertificateInfo(WebCertificateInfo::create(certificateInfo));
frame->didCommitLoad();
- if (frame->isMainFrame())
+ if (frame->isMainFrame()) {
+ m_mainFrameHasCustomRepresentation = frameHasCustomRepresentation;
m_pageClient->didCommitLoadForMainFrame(frameHasCustomRepresentation);
+ }
m_loaderClient.didCommitLoadForFrame(this, frame, userData.get());
}
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 73c15a8..bd5f42f 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -179,9 +179,7 @@ public:
uint64_t characterIndexForPoint(const WebCore::IntPoint);
WebCore::IntRect firstRectForCharacterRange(uint64_t, uint64_t);
void didSelectionChange(bool, bool, bool, bool, uint64_t, uint64_t);
-
void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
-
#else
void didChangeSelection(bool, bool, bool, bool);
#endif
@@ -213,6 +211,10 @@ public:
void setCustomUserAgent(const String&);
const String& customUserAgent() const { return m_customUserAgent; }
+ bool supportsTextEncoding() const;
+ void setCustomTextEncodingName(const String&);
+ String customTextEncodingName() const { return m_customTextEncodingName; }
+
double estimatedProgress() const { return m_estimatedProgress; }
void terminateProcess();
@@ -438,6 +440,7 @@ private:
String m_userAgent;
String m_applicationNameForUserAgent;
String m_customUserAgent;
+ String m_customTextEncodingName;
#if ENABLE(INSPECTOR)
RefPtr<WebInspectorProxy> m_inspector;
@@ -491,6 +494,8 @@ private:
OwnPtr<WebWheelEvent> m_nextWheelEvent;
uint64_t m_pageID;
+
+ bool m_mainFrameHasCustomRepresentation;
};
} // namespace WebKit
diff --git a/WebKit2/UIProcess/WebPageProxy.messages.in b/WebKit2/UIProcess/WebPageProxy.messages.in
index a3e2b64..c9fbba4 100644
--- a/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -131,6 +131,7 @@ messages -> WebPageProxy {
#if PLATFORM(WIN)
DidChangeCompositionSelection(bool hasChanged)
#endif
+
# Find.
DidCountStringMatches(WTF::String string, uint32_t matchCount)
SetFindIndicator(WebCore::FloatRect selectionRect, Vector<WebCore::FloatRect> textRects, WebKit::SharedMemory::Handle contentImageHandle, bool fadeOut)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index b93d79b..097dfde 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -1301,4 +1301,9 @@ bool WebPage::hasLocalDataForURL(const KURL& url)
return platformHasLocalDataForURL(url);
}
+void WebPage::setCustomTextEncodingName(const String& encoding)
+{
+ m_page->mainFrame()->loader()->reloadWithOverrideEncoding(encoding);
+}
+
} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index b6c7b75..a369c97 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -317,6 +317,7 @@ private:
void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
void setUserAgent(const String&);
+ void setCustomTextEncodingName(const String&);
#if PLATFORM(MAC)
void setWindowIsVisible(bool windowIsVisible);
diff --git a/WebKit2/WebProcess/WebPage/WebPage.messages.in b/WebKit2/WebProcess/WebPage/WebPage.messages.in
index e2239b0..9f47a99 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -57,6 +57,7 @@ messages -> WebPage {
PreferencesDidChange(WebKit::WebPreferencesStore store)
SetUserAgent(WTF::String userAgent)
+ SetCustomTextEncodingName(WTF::String encodingName)
#if ENABLE(TILED_BACKING_STORE)
SetActualVisibleContentRect(WebCore::IntRect rect)
@@ -96,11 +97,10 @@ messages -> WebPage {
SetWindowResizerSize(WebCore::IntSize intersectsView)
- // This is a dummy message to avoid breaking the build for platforms that don't require
- // synchronous messages.
- // FIXME: should be removed when <rdar://problem/8775115> is fixed.
- Dummy() -> (bool dummyReturn)
-
+ // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
+ // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
+ Dummy() -> (bool dummyReturn)
+
#if PLATFORM(MAC)
# Complex text input support for plug-ins.
SendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, String textInput)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list