summaryrefslogtreecommitdiff
path: root/Source/WebKit
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-07-24 17:03:20 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-07-24 17:03:20 +0200
commit08d4a74d56ca431877819fc4566e27eafe150342 (patch)
treeebd8530838ab390c015c6b7e659a22852c1663ae /Source/WebKit
parent1de6cd4794bbd5a52189384189a2b8df1848b39b (diff)
downloadqtwebkit-08d4a74d56ca431877819fc4566e27eafe150342.tar.gz
Imported WebKit commit 0fbd41c4e13f5a190faf160bf993eee614e6e18e (http://svn.webkit.org/repository/webkit/trunk@123477)
New snapshot that adapts to latest Qt API changes
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.cpp84
-rw-r--r--Source/WebKit/blackberry/Api/WebPage_p.h1
-rw-r--r--Source/WebKit/blackberry/ChangeLog42
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h1
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp17
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/AboutData.cpp121
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/AboutData.h3
-rw-r--r--Source/WebKit/chromium/ChangeLog230
-rw-r--r--Source/WebKit/chromium/DEPS4
-rw-r--r--Source/WebKit/chromium/features.gypi1
-rw-r--r--Source/WebKit/chromium/public/WebTextInputType.h4
-rw-r--r--Source/WebKit/chromium/public/WebViewClient.h2
-rw-r--r--Source/WebKit/chromium/src/ChromeClientImpl.cpp6
-rw-r--r--Source/WebKit/chromium/src/ChromeClientImpl.h4
-rw-r--r--Source/WebKit/chromium/src/PlatformSupport.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebKit.cpp6
-rw-r--r--Source/WebKit/chromium/src/WebLayerTreeView.cpp1
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp8
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h2
-rw-r--r--Source/WebKit/chromium/src/js/DevTools.js1
-rw-r--r--Source/WebKit/chromium/tests/CCLayerImplTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp5
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp577
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp16
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp10
-rw-r--r--Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp6
-rw-r--r--Source/WebKit/chromium/tests/CCResourceProviderTest.cpp3
-rw-r--r--Source/WebKit/chromium/tests/CCTextureUpdaterTest.cpp20
-rw-r--r--Source/WebKit/chromium/tests/LayerChromiumTest.cpp2
-rw-r--r--Source/WebKit/efl/ChangeLog11
-rw-r--r--Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h1
-rw-r--r--Source/WebKit/gtk/ChangeLog11
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h1
-rw-r--r--Source/WebKit/mac/ChangeLog36
-rw-r--r--Source/WebKit/mac/Configurations/FeatureDefines.xcconfig7
-rw-r--r--Source/WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebChromeClient.h1
-rw-r--r--Source/WebKit/qt/Api/qwebpage.cpp14
-rw-r--r--Source/WebKit/qt/Api/qwebpage_p.h2
-rw-r--r--Source/WebKit/qt/ChangeLog54
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp7
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h1
-rw-r--r--Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp20
-rw-r--r--Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h4
-rw-r--r--Source/WebKit/qt/examples/platformplugin/WebPlugin.h2
-rw-r--r--Source/WebKit/win/COMEnumVariant.h2
-rw-r--r--Source/WebKit/win/COMPropertyBag.h2
-rw-r--r--Source/WebKit/win/ChangeLog18
-rw-r--r--Source/WebKit/win/WebCoreSupport/WebChromeClient.h1
-rw-r--r--Source/WebKit/wince/ChangeLog11
-rw-r--r--Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h1
-rw-r--r--Source/WebKit/wx/ChangeLog11
-rw-r--r--Source/WebKit/wx/WebKitSupport/ChromeClientWx.h1
54 files changed, 905 insertions, 504 deletions
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index b5686707f..487a17d72 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -19,8 +19,6 @@
#include "config.h"
#include "WebPage.h"
-#include "AboutData.h"
-#include "AboutTemplate.html.cpp"
#include "ApplicationCacheStorage.h"
#include "AutofillManager.h"
#include "BackForwardController.h"
@@ -157,8 +155,6 @@
#include <BlackBerryPlatformMouseEvent.h>
#include <BlackBerryPlatformScreen.h>
#include <BlackBerryPlatformSettings.h>
-#include <BlackBerryPlatformWebKitCredits.h>
-#include <BuildInformation.h>
#include <JavaScriptCore/APICast.h>
#include <JavaScriptCore/JSContextRef.h>
#include <JavaScriptCore/JSStringRef.h>
@@ -619,84 +615,6 @@ private:
}
};
-bool WebPagePrivate::loadAbout(const char* aboutURL)
-{
- if (strncasecmp(aboutURL, "about:", 6))
- return false;
-
- // First 6 chars are "about:".
- String aboutWhat(aboutURL + 6);
-
- String result;
-
- if (equalIgnoringCase(aboutWhat, "credits")) {
- result.append(writeHeader("Credits"));
- result.append(String("<style> .about {padding:14px;} </style>"));
- result.append(String(BlackBerry::Platform::WEBKITCREDITS));
- result.append(String("</body></html>"));
- } else if (aboutWhat.startsWith("cache?query=", false)) {
- BlackBerry::Platform::Client* client = BlackBerry::Platform::Client::get();
- ASSERT(client);
- std::string key(aboutWhat.substring(12, aboutWhat.length() - 12).utf8().data()); // 12 is length of "cache?query=".
- result.append(String("<html><head><title>BlackBerry Browser Disk Cache</title></head><body>"));
- result.append(String(key.data()));
- result.append(String("<hr>"));
- result.append(String(client->generateHtmlFragmentForCacheHeaders(key).data()));
- result.append(String("</body></html>"));
- } else if (equalIgnoringCase(aboutWhat, "cache")) {
- BlackBerry::Platform::Client* client = BlackBerry::Platform::Client::get();
- ASSERT(client);
- result.append(String("<html><head><title>BlackBerry Browser Disk Cache</title></head><body>"));
- result.append(String(client->generateHtmlFragmentForCacheKeys().data()));
- result.append(String("</body></html>"));
-#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
- } else if (equalIgnoringCase(aboutWhat, "cache/disable")) {
- BlackBerry::Platform::Client* client = BlackBerry::Platform::Client::get();
- ASSERT(client);
- client->setDiskCacheEnabled(false);
- result.append(String("<html><head><title>BlackBerry Browser Disk Cache</title></head><body>Http disk cache is disabled.</body></html>"));
- } else if (equalIgnoringCase(aboutWhat, "cache/enable")) {
- BlackBerry::Platform::Client* client = BlackBerry::Platform::Client::get();
- ASSERT(client);
- client->setDiskCacheEnabled(true);
- result.append(String("<html><head><title>BlackBerry Browser Disk Cache</title></head><body>Http disk cache is enabled.</body></html>"));
- } else if (equalIgnoringCase(aboutWhat, "cookie")) {
- result.append(String("<html><head><title>BlackBerry Browser cookie information</title></head><body>"));
- result.append(cookieManager().generateHtmlFragmentForCookies());
- result.append(String("</body></html>"));
- } else if (equalIgnoringCase(aboutWhat, "version")) {
- result.append(writeHeader("Version"));
- result.append(String("<div class='box'><div class='box-title'>Build Time</div><br>"));
- result.append(String(BlackBerry::Platform::BUILDTIME));
- result.append(String("</div><br><div style='font-size:10px;text-align:center;'>Also see the <A href='about:build'>build information</A>.</body></html>"));
- } else if (BlackBerry::Platform::debugSetting() > 0 && equalIgnoringCase(aboutWhat, "config")) {
- result = configPage();
- } else if (BlackBerry::Platform::debugSetting() > 0 && equalIgnoringCase(aboutWhat, "build")) {
- result.append(writeHeader("Build"));
- result.append(String("<div class='box'><div class='box-title'>Basic</div><table>"));
- result.append(String("<tr><td>Built On: </td><td>"));
- result.append(String(BlackBerry::Platform::BUILDCOMPUTER));
- result.append(String("</td></tr>"));
- result.append(String("<tr><td>Build User: </td><td>"));
- result.append(String(BlackBerry::Platform::BUILDUSER));
- result.append(String("</td></tr>"));
- result.append(String("<tr><td>Build Time: </td><td>"));
- result.append(String(BlackBerry::Platform::BUILDTIME));
- result.append(String("</table></div><br>"));
- result.append(String(BlackBerry::Platform::BUILDINFO_WEBKIT));
- result.append(String(BlackBerry::Platform::BUILDINFO_PLATFORM));
- result.append(String(BlackBerry::Platform::BUILDINFO_LIBWEBVIEW));
- result.append(String("</body></html>"));
- } else if (equalIgnoringCase(aboutWhat, "memory")) {
- result = memoryPage();
-#endif
- } else
- return false;
-
- loadString(result.latin1().data(), aboutURL, "text/html");
- return true;
-}
-
void WebPagePrivate::load(const char* url, const char* networkToken, const char* method, Platform::NetworkRequest::CachePolicy cachePolicy, const char* data, size_t dataLength, const char* const* headers, size_t headersLength, bool isInitial, bool mustHandleInternally, bool forceDownload, const char* overrideContentType, const char* suggestedSaveName)
{
stopCurrentLoad();
@@ -747,8 +665,6 @@ void WebPagePrivate::load(const char* url, const char* networkToken, const char*
void WebPage::load(const char* url, const char* networkToken, bool isInitial)
{
- if (d->loadAbout(url))
- return;
d->load(url, networkToken, "GET", Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, isInitial, false);
}
diff --git a/Source/WebKit/blackberry/Api/WebPage_p.h b/Source/WebKit/blackberry/Api/WebPage_p.h
index b4ca9175b..4ca76d39c 100644
--- a/Source/WebKit/blackberry/Api/WebPage_p.h
+++ b/Source/WebKit/blackberry/Api/WebPage_p.h
@@ -97,7 +97,6 @@ public:
bool handleMouseEvent(WebCore::PlatformMouseEvent&);
bool handleWheelEvent(WebCore::PlatformWheelEvent&);
- bool loadAbout(const char* aboutURL);
void load(const char* url, const char* networkToken, const char* method, Platform::NetworkRequest::CachePolicy, const char* data, size_t dataLength, const char* const* headers, size_t headersLength, bool isInitial, bool mustHandleInternally = false, bool forceDownload = false, const char* overrideContentType = "", const char* suggestedSaveName = "");
void loadString(const char* string, const char* baseURL, const char* mimeType, const char* failingURL = 0);
bool executeJavaScript(const char* script, JavaScriptDataType& returnType, WebString& returnValue);
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index 6d340d8e2..c3ec07f2f 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,45 @@
+2012-07-23 Yong Li <yoli@rim.com>
+
+ [BlackBerry] Move about: URL handling out of WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=91541
+
+ Reviewed by Rob Buis.
+
+ PR# 181304.
+ Move about: URL handling to the right place (FrameLoaderClientBlackBerry::createDocumentLoader), so
+ reload and history navigation can work.
+ Other changes: Remove about:version which makes little sense. Make about:memory partially visible.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::load): Remove the call to loadAbout()
+ * Api/WebPage_p.h: Remove loadAbout()
+ (WebPagePrivate):
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::createDocumentLoader): Construct about: data here.
+ * WebKitSupport/AboutData.cpp:
+ (BlackBerry::WebKit::numberToHTMLTr): Make it static
+ (BlackBerry::WebKit::configPage): Make it static
+ (BlackBerry::WebKit::memoryPage): Make it static
+ (BlackBerry::WebKit::cachePage):
+ (BlackBerry::WebKit::buildPage):
+ (BlackBerry::WebKit::creditsPage):
+ (BlackBerry::WebKit::cookiePage):
+ (BlackBerry::WebKit::aboutData): The only export function that returns HTML source for a given about: URL.
+ (WebKit):
+ * WebKitSupport/AboutData.h:
+ (WebKit):
+
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Removed numTouchEventHandlersChanged stub.
+
+ * WebCoreSupport/ChromeClientBlackBerry.h:
+
2012-07-22 Kent Tamura <tkent@chromium.org>
Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively
diff --git a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h
index 692d08052..d4d02f8bd 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h
+++ b/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h
@@ -90,7 +90,6 @@ public:
virtual void dispatchViewportPropertiesDidChange(const ViewportArguments&) const;
virtual bool shouldRubberBandInDirection(ScrollDirection) const { return true; }
virtual void numWheelEventHandlersChanged(unsigned) { }
- virtual void numTouchEventHandlersChanged(unsigned) { }
virtual void print(Frame*);
virtual void exceededDatabaseQuota(Frame*, const String&);
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
index 982b13c3e..4902f60f7 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
@@ -19,6 +19,7 @@
#include "config.h"
#include "FrameLoaderClientBlackBerry.h"
+#include "AboutData.h"
#include "AutofillManager.h"
#include "BackForwardController.h"
#include "BackForwardListImpl.h"
@@ -386,9 +387,21 @@ PassRefPtr<DocumentLoader> FrameLoaderClientBlackBerry::createDocumentLoader(con
newRequest.setToken(originalRequest.token());
}
+ SubstituteData substituteDataLocal = substituteData;
+ if (isMainFrame() && request.url().protocolIs("about")) {
+ // The first 6 letters is "about:"
+ String aboutWhat = request.url().string().substring(6);
+ String source = aboutData(aboutWhat);
+ if (!source.isEmpty()) {
+ // Always ignore existing substitute data if any.
+ WTF::RefPtr<SharedBuffer> buffer = SharedBuffer::create(source.is8Bit() ? reinterpret_cast<const char*>(source.characters8()) : source.latin1().data(), source.length());
+ substituteDataLocal = SubstituteData(buffer, "text/html", "latin1", KURL());
+ }
+ }
+
// FIXME: This should probably be shared.
- RefPtr<DocumentLoader> loader = DocumentLoader::create(newRequest, substituteData);
- if (substituteData.isValid())
+ RefPtr<DocumentLoader> loader = DocumentLoader::create(newRequest, substituteDataLocal);
+ if (substituteDataLocal.isValid())
loader->setDeferMainResourceDataLoad(false);
return loader.release();
}
diff --git a/Source/WebKit/blackberry/WebKitSupport/AboutData.cpp b/Source/WebKit/blackberry/WebKitSupport/AboutData.cpp
index 745157513..5f565c94b 100644
--- a/Source/WebKit/blackberry/WebKitSupport/AboutData.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/AboutData.cpp
@@ -21,13 +21,19 @@
#include "AboutTemplate.html.cpp"
#include "CString.h"
+#include "CookieManager.h"
#include "JSDOMWindow.h"
#include "MemoryCache.h"
#include "MemoryStatistics.h"
#include "SurfacePool.h"
#include "WebKitVersion.h"
+#include <BlackBerryPlatformClient.h>
+#include <BlackBerryPlatformLog.h>
+#include <BlackBerryPlatformMemory.h>
#include <BlackBerryPlatformSettings.h>
+#include <BlackBerryPlatformWebKitCredits.h>
+#include <BuildInformation.h>
#include <heap/Heap.h>
#include <process.h>
#include <runtime/JSGlobalData.h>
@@ -50,7 +56,7 @@ static String writeFeatures(const Vector<String>& trueList, const Vector<String>
return ret;
}
-template<class T> String numberToHTMLTr(const String& description, T number)
+template<class T> static String numberToHTMLTr(const String& description, T number)
{
return String("<tr><td>") + description + "</td><td>" + String::number(number) + "</td></tr>";
}
@@ -60,7 +66,7 @@ template<> String numberToHTMLTr<bool>(const String& description, bool truth)
return String("<tr><td>") + description + "</td><td>" + (truth?"true":"false") + "</td></tr>";
}
-String configPage()
+static String configPage()
{
String page;
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
@@ -202,7 +208,7 @@ static void dumpJSCTypeCountSetToTableHTML(String& tableHTML, JSC::TypeCountSet*
tableHTML += numberToHTMLTr(iter->first, iter->second);
}
-String memoryPage()
+static String memoryPage()
{
String page;
@@ -255,6 +261,8 @@ String memoryPage()
if (!stat(String::format("/proc/%u/as", getpid()).latin1().data(), &processInfo))
page += numberToHTMLTr("Total mapped memory", processInfo.st_size);
+ page += numberToHTMLTr("System free memory", BlackBerry::Platform::systemFreeMemory());
+
page += "</table></div><br>";
page += "<div class='box'><div class='box-title'>JS engine memory usage</div><table class='fixed-table'><col width=75%><col width=25%>";
@@ -299,5 +307,112 @@ String memoryPage()
return page;
}
+static String cachePage(String cacheCommand)
+{
+ String result;
+
+ result.append(String("<html><head><title>BlackBerry Browser Disk Cache</title></head><body>"));
+
+ BlackBerry::Platform::Client* client = BlackBerry::Platform::Client::get();
+ ASSERT(client);
+
+ if (cacheCommand.isEmpty())
+ result.append(String(client->generateHtmlFragmentForCacheKeys().data()));
+ else if (cacheCommand.startsWith("?query=", false)) {
+ std::string key(cacheCommand.substring(7).utf8().data()); // 7 is length of "query=".
+ result.append(String(key.data()));
+ result.append(String("<hr>"));
+ result.append(String(client->generateHtmlFragmentForCacheHeaders(key).data()));
+ }
+#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
+ else if (equalIgnoringCase(cacheCommand, "/disable")) {
+ client->setDiskCacheEnabled(false);
+ result.append("Http disk cache is disabled.");
+ } else if (equalIgnoringCase(cacheCommand, "/enable")) {
+ client->setDiskCacheEnabled(true);
+ result.append("Http disk cache is enabled.");
+ }
+#endif
+ else {
+ // Unknown cache command.
+ return String();
+ }
+
+ result.append(String("</body></html>"));
+
+ return result;
+}
+
+static String buildPage()
+{
+ String result;
+
+ result.append(writeHeader("Build"));
+ result.append(String("<div class='box'><div class='box-title'>Basic</div><table>"));
+ result.append(String("<tr><td>Built On: </td><td>"));
+ result.append(String(BlackBerry::Platform::BUILDCOMPUTER));
+ result.append(String("</td></tr>"));
+ result.append(String("<tr><td>Build User: </td><td>"));
+ result.append(String(BlackBerry::Platform::BUILDUSER));
+ result.append(String("</td></tr>"));
+ result.append(String("<tr><td>Build Time: </td><td>"));
+ result.append(String(BlackBerry::Platform::BUILDTIME));
+ result.append(String("</table></div><br>"));
+ result.append(String(BlackBerry::Platform::BUILDINFO_WEBKIT));
+ result.append(String(BlackBerry::Platform::BUILDINFO_PLATFORM));
+ result.append(String(BlackBerry::Platform::BUILDINFO_LIBWEBVIEW));
+ result.append(String("</body></html>"));
+
+ return result;
+}
+
+static String creditsPage()
+{
+ String result;
+
+ result.append(writeHeader("Credits"));
+ result.append(String("<style> .about {padding:14px;} </style>"));
+ result.append(String(BlackBerry::Platform::WEBKITCREDITS));
+ result.append(String("</body></html>"));
+
+ return result;
+}
+
+static String cookiePage()
+{
+ String result;
+
+ result.append(String("<html><head><title>BlackBerry Browser cookie information</title></head><body>"));
+ result.append(cookieManager().generateHtmlFragmentForCookies());
+ result.append(String("</body></html>"));
+
+ return result;
+}
+
+String aboutData(String aboutWhat)
+{
+ if (equalIgnoringCase(aboutWhat, "credits"))
+ return creditsPage();
+
+ if (aboutWhat.startsWith("cache"))
+ return cachePage(aboutWhat.substring(5));
+
+ if (equalIgnoringCase(aboutWhat, "memory"))
+ return memoryPage();
+
+#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
+ if (equalIgnoringCase(aboutWhat, "cookie"))
+ return cookiePage();
+
+ if (BlackBerry::Platform::debugSetting() > 0 && equalIgnoringCase(aboutWhat, "build"))
+ return buildPage();
+
+ if (BlackBerry::Platform::debugSetting() > 0 && equalIgnoringCase(aboutWhat, "config"))
+ return configPage();
+#endif
+
+ return String();
+}
+
} // namespace WebKit
} // namespace BlackBerry
diff --git a/Source/WebKit/blackberry/WebKitSupport/AboutData.h b/Source/WebKit/blackberry/WebKitSupport/AboutData.h
index 805054fd5..0e11a60c8 100644
--- a/Source/WebKit/blackberry/WebKitSupport/AboutData.h
+++ b/Source/WebKit/blackberry/WebKitSupport/AboutData.h
@@ -24,8 +24,7 @@
namespace BlackBerry {
namespace WebKit {
-String configPage();
-String memoryPage();
+String aboutData(String aboutWhat);
} // namespace WebKit
} // namespace BlackBerry
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index a94bbd7b7..ca446fe90 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,233 @@
+2012-07-24 Jochen Eisinger <jochen@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-07-24 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r123463.
+ http://trac.webkit.org/changeset/123463
+ https://bugs.webkit.org/show_bug.cgi?id=92110
+
+ Broke Android build (Requested by keishi on #webkit).
+
+ * src/WebPagePopupImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleMouseDown):
+
+2012-07-24 Keishi Hattori <keishi@webkit.org>
+
+ [Chromium] Page popup should close on mouse down
+ https://bugs.webkit.org/show_bug.cgi?id=92092
+
+ Reviewed by Kent Tamura.
+
+ Page popup should close on mouse down because some elements(e.g. <input type=color>) don't have a blur event that
+ we can hook to hide the page popup when the user clicks on the page.
+
+ * src/WebPagePopupImpl.h:
+ (WebKit::WebPagePopupImpl::hasSamePopupClient): Returns true if the given WebPagePopupImpl have the same popup client.
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleMouseDown): Close all popups when the page is clicked. Checks if the
+ mouse down event opened the same popup we just closed.
+
+2012-07-24 Anthony Scian <ascian@rim.com>
+
+ Web Inspector [JSC]: Enable initiator column in network panel.
+ https://bugs.webkit.org/show_bug.cgi?id=65533
+
+ Reviewed by Vsevolod Vlasov.
+
+ With 40118 fixed for webkit, Preferences.displayInitiator should be set to true.
+ Removed references to it since the optionality is no longer required.
+
+ Test: http/tests/inspector/network/network-initiator.html
+
+ * src/js/DevTools.js:
+
+2012-07-24 Peter Beverloo <peter@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-07-23 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move layoutTestMode to WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=92010
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * src/PlatformSupport.cpp:
+ (WebCore):
+ * src/WebKit.cpp:
+ (WebKit::setLayoutTestMode):
+ (WebKit::layoutTestMode):
+
+2012-07-23 Dave Tu <dtu@chromium.org>
+
+ [chromium] Add droppedFrameCount to renderingStats.
+ https://bugs.webkit.org/show_bug.cgi?id=91694
+
+ Reviewed by Adrienne Walker.
+
+ * src/WebLayerTreeView.cpp:
+ (WebKit::WebLayerTreeView::renderingStats):
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::CCLayerTreeHostTestScrollMultipleRedraw::drawLayersOnCCThread):
+
+2012-07-23 Brian Anderson <brianderson@chromium.org>
+
+ [chromium] Use shallow flushes that don't glFlush
+ https://bugs.webkit.org/show_bug.cgi?id=90325
+
+ Reviewed by Kenneth Russell.
+
+ Changed CCTextureUpdaterTest to recognize shallowFlushCHROMIUM().
+
+ * tests/CCTextureUpdaterTest.cpp:
+
+2012-07-23 Adrienne Walker <enne@google.com>
+
+ [chromium] Add more compositor unit tests for high DPI transforms
+ https://bugs.webkit.org/show_bug.cgi?id=91917
+
+ Reviewed by Kenneth Russell.
+
+ The current set of high DPI tests only deal with layers in a render
+ surface. Add some extra tests for non-surface layers. Also add a test
+ to make sure that an owning layer in a surface doesn't differ from a
+ non-owning layer in high DPI circumstances.
+
+ * tests/CCLayerTreeHostCommonTest.cpp:
+
+2012-07-23 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] Fix unit tests in debug mode after r123375
+ https://bugs.webkit.org/show_bug.cgi?id=92030
+
+ Reviewed by Adrienne Walker.
+
+ Fixed two unit tests that were causing debug assertions because
+ they gave calcDrawTransforms an empty sized root layer.
+
+ * tests/CCLayerTreeHostCommonTest.cpp:
+
+2012-07-23 Simon Fraser <simon.fraser@apple.com>
+
+ Part 2 of: Implement sticky positioning
+ https://bugs.webkit.org/show_bug.cgi?id=90046
+
+ Reviewed by Ojan Vafai.
+
+ Turn on ENABLE_CSS_STICKY_POSITION.
+
+ * features.gypi:
+
+2012-07-23 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] Refactor CCLayerTreeHostCommon: clean up clipRect and drawableContentRect design
+ https://bugs.webkit.org/show_bug.cgi?id=80622
+
+ Reviewed by Adrienne Walker.
+
+ Many tests needed to be updated because the semantics of the layer tree have changed:
+ - a few tests that were no longer applicable were removed.
+ - many tests needed to have fixed initialization, properly
+ setting surface contentRect and rootLayer bounds.
+ - because clipRect and usesLayerClipping no longer exists, those places in code had to be removed/changed
+ - the scissorRect tests needed to have updated expectations
+ because after this patch, the rootLayer Surface now clips
+ to its contentBounds.
+ - the clipRect tests were changed to test the layer's new semantics for the drawableContentRect instead.
+
+ * tests/CCLayerImplTest.cpp:
+ (WebCore::TEST):
+ * tests/CCLayerIteratorTest.cpp:
+ * tests/CCLayerTreeHostCommonTest.cpp:
+ * tests/CCLayerTreeHostImplTest.cpp:
+ * tests/CCLayerTreeHostTest.cpp:
+ * tests/CCOcclusionTrackerTest.cpp:
+ (WebKitTests::CCOcclusionTrackerTest::calcDrawEtc):
+ (WebKitTests::CCOcclusionTrackerTestAnimationOpacity1OnMainThread::runMyTest):
+ (WebKitTests::CCOcclusionTrackerTestAnimationOpacity0OnMainThread::runMyTest):
+ * tests/LayerChromiumTest.cpp:
+
+2012-07-23 Daniel Cheng <dcheng@chromium.org>
+
+ [chromium] Fix build on Ubuntu Precise.
+ https://bugs.webkit.org/show_bug.cgi?id=92021
+
+ Reviewed by Adrienne Walker.
+
+ Remove an array that's written but never read.
+
+ * tests/CCResourceProviderTest.cpp:
+ (WebKit::TEST_F):
+
+2012-07-23 Nate Chapin <japhet@chromium.org>
+
+ Add WebTextInputType enum values for text areas and
+ content-editable.
+ https://bugs.webkit.org/show_bug.cgi?id=91654
+
+ Reviewed by Adam Barth.
+
+ No new tests, no behavior change without corresponding chromium.org changes.
+
+ * public/WebTextInputType.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::textInputType):
+
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Rename the functions to follow a more boolean logic.
+
+ * public/WebViewClient.h:
+ (WebKit::WebViewClient::hasTouchEventHandlers):
+ * src/ChromeClientImpl.cpp:
+ (WebKit):
+ (WebKit::ChromeClientImpl::needTouchEvents):
+ * src/ChromeClientImpl.h:
+ (ChromeClientImpl):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::hasTouchEventHandlers):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
+2012-07-23 Simon Fraser <simon.fraser@apple.com>
+
+ Implement sticky positioning
+ https://bugs.webkit.org/show_bug.cgi?id=90046
+
+ Reviewed by Ojan Vafai.
+
+ Add ENABLE_CSS_STICKY_POSITION, defaulting to off initially.
+
+ * features.gypi:
+
+2012-07-23 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Buildfix for fixing gclient on the Chromium Windows bot
+ https://bugs.webkit.org/show_bug.cgi?id=91977
+
+ Unreviewed build fix.
+
+ Add the tools/isolate directory to the Windows checkout as these files
+ currently are missing during gyp generation. maruel introduced the need
+ for these in this isolate refactoring, specifically this Chromium CL:
+ http://src.chromium.org/viewvc/chrome?view=rev&revision=147689
+
+ * DEPS:
+
2012-07-22 Kent Tamura <tkent@chromium.org>
[Chromium-Mac] Fix a build error.
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index 90b7caed8..2e48b10e1 100644
--- a/Source/WebKit/chromium/DEPS
+++ b/Source/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '147759'
+ 'chromium_rev': '148093'
}
deps = {
@@ -155,6 +155,8 @@ deps_os = {
From('chromium_deps', 'src/third_party/nss'),
'third_party/perl':
From('chromium_deps', 'src/third_party/perl'),
+ 'tools/isolate':
+ Var('chromium_svn')+'/tools/isolate@'+Var('chromium_rev'),
# Dependencies used by libjpeg-turbo
'third_party/yasm/binaries':
From('chromium_deps', 'src/third_party/yasm/binaries'),
diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi
index 8df09639c..3432342a9 100644
--- a/Source/WebKit/chromium/features.gypi
+++ b/Source/WebKit/chromium/features.gypi
@@ -47,6 +47,7 @@
'ENABLE_CSS_REGIONS=1',
'ENABLE_CSS_SHADERS=1',
'ENABLE_CSS_VARIABLES=1',
+ 'ENABLE_CSS_STICKY_POSITION=1',
'ENABLE_CUSTOM_SCHEME_HANDLER=0',
'ENABLE_DATALIST_ELEMENT=1',
'ENABLE_DASHBOARD_SUPPORT=0',
diff --git a/Source/WebKit/chromium/public/WebTextInputType.h b/Source/WebKit/chromium/public/WebTextInputType.h
index b7212758e..c7df9e55e 100644
--- a/Source/WebKit/chromium/public/WebTextInputType.h
+++ b/Source/WebKit/chromium/public/WebTextInputType.h
@@ -54,6 +54,10 @@ enum WebTextInputType {
WebTextInputTypeMonth,
WebTextInputTypeTime,
WebTextInputTypeWeek,
+ WebTextInputTypeTextArea,
+
+ // Input caret is in a contenteditable node (not an INPUT field).
+ WebTextInputTypeContentEditable,
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h
index 662409f7a..65964a128 100644
--- a/Source/WebKit/chromium/public/WebViewClient.h
+++ b/Source/WebKit/chromium/public/WebViewClient.h
@@ -273,7 +273,7 @@ public:
virtual void focusedNodeChanged(const WebNode&) { }
virtual void numberOfWheelEventHandlersChanged(unsigned) { }
- virtual void numberOfTouchEventHandlersChanged(unsigned) { }
+ virtual void hasTouchEventHandlers(bool) { }
// Indicates two things:
// 1) This view may have a new layout now.
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
index ed5d73e50..f7cb94bbc 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -1090,10 +1090,12 @@ void ChromeClientImpl::numWheelEventHandlersChanged(unsigned numberOfWheelHandle
m_webView->numberOfWheelEventHandlersChanged(numberOfWheelHandlers);
}
-void ChromeClientImpl::numTouchEventHandlersChanged(unsigned numberOfTouchHandlers)
+#if ENABLE(TOUCH_EVENTS)
+void ChromeClientImpl::needTouchEvents(bool needsTouchEvents)
{
- m_webView->numberOfTouchEventHandlersChanged(numberOfTouchHandlers);
+ m_webView->hasTouchEventHandlers(needsTouchEvents);
}
+#endif // ENABLE(TOUCH_EVENTS)
#if ENABLE(POINTER_LOCK)
bool ChromeClientImpl::requestPointerLock()
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.h b/Source/WebKit/chromium/src/ChromeClientImpl.h
index 9aa8dff32..30315d394 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.h
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.h
@@ -148,8 +148,7 @@ public:
virtual void setCursorHiddenUntilMouseMoves(bool);
virtual void formStateDidChange(const WebCore::Node*);
#if ENABLE(TOUCH_EVENTS)
- // FIXME: All touch events are forwarded regardless of whether or not they are needed.
- virtual void needTouchEvents(bool needTouchEvents) { }
+ virtual void needTouchEvents(bool needTouchEvents) OVERRIDE;
#endif
#if USE(ACCELERATED_COMPOSITING)
@@ -207,7 +206,6 @@ public:
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const;
virtual void numWheelEventHandlersChanged(unsigned);
- virtual void numTouchEventHandlersChanged(unsigned);
#if ENABLE(POINTER_LOCK)
virtual bool requestPointerLock();
diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp
index 0afb807e0..aca97d0a3 100644
--- a/Source/WebKit/chromium/src/PlatformSupport.cpp
+++ b/Source/WebKit/chromium/src/PlatformSupport.cpp
@@ -302,13 +302,6 @@ PassRefPtr<SerializedScriptValue> PlatformSupport::injectIDBKeyIntoSerializedVal
return webKitPlatformSupport()->injectIDBKeyIntoSerializedValue(key, value, keyPath);
}
-// LayoutTestMode -------------------------------------------------------------
-
-bool PlatformSupport::layoutTestMode()
-{
- return WebKit::layoutTestMode();
-}
-
// Plugin ---------------------------------------------------------------------
bool PlatformSupport::plugins(bool refresh, Vector<PluginInfo>* results)
diff --git a/Source/WebKit/chromium/src/WebKit.cpp b/Source/WebKit/chromium/src/WebKit.cpp
index e41ce228d..a3f0f8391 100644
--- a/Source/WebKit/chromium/src/WebKit.cpp
+++ b/Source/WebKit/chromium/src/WebKit.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "WebKit.h"
+#include "LayoutTestSupport.h"
#include "Logging.h"
#include "MutationObserver.h"
#include "Page.h"
@@ -81,7 +82,6 @@ static WebThread::TaskObserver* s_endOfTaskRunner = 0;
static bool s_webKitInitialized = false;
static WebKitPlatformSupport* s_webKitPlatformSupport = 0;
-static bool s_layoutTestMode = false;
static bool generateEntropy(unsigned char* buffer, size_t length)
{
@@ -176,12 +176,12 @@ WebKitPlatformSupport* webKitPlatformSupport()
void setLayoutTestMode(bool value)
{
- s_layoutTestMode = value;
+ WebCore::setIsRunningLayoutTest(value);
}
bool layoutTestMode()
{
- return s_layoutTestMode;
+ return WebCore::isRunningLayoutTest();
}
void enableLogChannel(const char* name)
diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
index 207a8350d..34eb952fd 100644
--- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp
+++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
@@ -182,6 +182,7 @@ void WebLayerTreeView::renderingStats(WebRenderingStats& stats) const
stats.numAnimationFrames = ccStats.numAnimationFrames;
stats.numFramesSentToScreen = ccStats.numFramesSentToScreen;
+ stats.droppedFrameCount = ccStats.droppedFrameCount;
}
void WebLayerTreeView::loseCompositorContext(int numTimes)
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 0d5f25a51..6a253f8e3 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -1108,10 +1108,10 @@ void WebViewImpl::numberOfWheelEventHandlersChanged(unsigned numberOfWheelHandle
m_client->numberOfWheelEventHandlersChanged(numberOfWheelHandlers);
}
-void WebViewImpl::numberOfTouchEventHandlersChanged(unsigned numberOfTouchHandlers)
+void WebViewImpl::hasTouchEventHandlers(bool hasTouchHandlers)
{
if (m_client)
- m_client->numberOfTouchEventHandlersChanged(numberOfTouchHandlers);
+ m_client->hasTouchEventHandlers(hasTouchHandlers);
}
#if !OS(DARWIN)
@@ -2100,11 +2100,11 @@ WebTextInputType WebViewImpl::textInputType()
if (textarea->readOnly() || textarea->disabled())
return WebTextInputTypeNone;
- return WebTextInputTypeText;
+ return WebTextInputTypeTextArea;
}
if (node->shouldUseInputMethod())
- return WebTextInputTypeText;
+ return WebTextInputTypeContentEditable;
return WebTextInputTypeNone;
}
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index c2f36bf45..1155969fd 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -383,7 +383,7 @@ public:
void startPageScaleAnimation(const WebCore::IntPoint& targetPosition, bool useAnchor, float newScale, double durationInSeconds);
void numberOfWheelEventHandlersChanged(unsigned);
- void numberOfTouchEventHandlersChanged(unsigned);
+ void hasTouchEventHandlers(bool);
// PlatformGestureCurveTarget implementation for wheel fling.
virtual void scrollBy(const WebCore::IntPoint&);
diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js
index ffea8af86..12293f5b1 100644
--- a/Source/WebKit/chromium/src/js/DevTools.js
+++ b/Source/WebKit/chromium/src/js/DevTools.js
@@ -42,7 +42,6 @@
Preferences.exposeWorkersInspection = true;
Preferences.showDockToRight = true;
Preferences.exposeFileSystemInspection = true;
- Preferences.displayInitiator = true;
})();}
function buildPlatformExtensionAPI(extensionInfo)
diff --git a/Source/WebKit/chromium/tests/CCLayerImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerImplTest.cpp
index 22cf897cb..47edeec9d 100644
--- a/Source/WebKit/chromium/tests/CCLayerImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerImplTest.cpp
@@ -167,8 +167,6 @@ TEST(CCLayerImplTest, verifyLayerChangesAreTrackedProperly)
// These properties are internal, and should not be considered "change" when they are used.
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setIsNonCompositedContent(true));
- EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setClipRect(arbitraryIntRect));
- EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setUsesLayerClipping(true));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawOpacity(arbitraryNumber));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setRenderTarget(0));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawTransform(arbitraryTransform));
diff --git a/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp b/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
index 86a374325..76dc425aa 100644
--- a/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
@@ -58,7 +58,8 @@ private:
, m_drawsContent(true)
{
setBounds(IntSize(100, 100));
- setDrawableContentRect(IntRect(0, 0, 100, 100));
+ setPosition(IntPoint::zero());
+ setAnchorPoint(IntPoint::zero());
}
bool m_drawsContent;
@@ -239,6 +240,7 @@ TEST(CCLayerIteratorTest, complexTreeMultiSurface)
RefPtr<TestLayerChromium> root231 = TestLayerChromium::create();
rootLayer->createRenderSurface();
+ rootLayer->renderSurface()->setContentRect(IntRect(IntPoint(), rootLayer->bounds()));
rootLayer->addChild(root1);
rootLayer->addChild(root2);
@@ -256,6 +258,7 @@ TEST(CCLayerIteratorTest, complexTreeMultiSurface)
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
Vector<RefPtr<LayerChromium> > layerList;
renderSurfaceLayerList.append(rootLayer.get());
+
CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer.get(),
WebTransformationMatrix(), WebTransformationMatrix(),
renderSurfaceLayerList, layerList,
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
index 26ae6ca47..86af40a02 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
@@ -77,6 +77,11 @@ void executeCalculateDrawTransformsAndVisibility(LayerChromium* rootLayer)
Vector<RefPtr<LayerChromium> > dummyRenderSurfaceLayerList;
Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
+
+ ASSERT(rootLayer->renderSurface());
+ ASSERT(!rootLayer->bounds().isEmpty());
+ rootLayer->renderSurface()->setContentRect(IntRect(IntPoint(), rootLayer->bounds()));
+
CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, rootLayer, identityMatrix, identityMatrix, dummyRenderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(dummyRenderSurfaceLayerList, rootLayer->renderSurface()->contentRect());
}
@@ -125,6 +130,7 @@ PassOwnPtr<CCLayerImpl> createTreeForFixedPositionTests()
child->addChild(grandChild.release());
root->addChild(child.release());
root->createRenderSurface();
+ root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), root->bounds()));
return root.release();
}
@@ -154,14 +160,12 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForNoOpLayer)
child->addChild(grandChild);
WebTransformationMatrix identityMatrix;
- setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(0, 0), false);
+ setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(0, 0), false);
setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(0, 0), false);
executeCalculateDrawTransformsAndVisibility(parent.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, parent->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, parent->screenSpaceTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->screenSpaceTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, grandChild->drawTransform());
@@ -177,9 +181,11 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer)
// Case 1: setting the sublayer transform should not affect this layer's draw transform or screen-space transform.
WebTransformationMatrix arbitraryTranslation;
arbitraryTranslation.translate(10, 20);
- setLayerPropertiesForTesting(layer.get(), identityMatrix, arbitraryTranslation, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(0, 0), false);
+ setLayerPropertiesForTesting(layer.get(), identityMatrix, arbitraryTranslation, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->drawTransform());
+ WebTransformationMatrix expectedDrawTransform = identityMatrix;
+ expectedDrawTransform.translate(50, 50);
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedDrawTransform, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->screenSpaceTransform());
// Case 2: setting the bounds of the layer should result in a draw transform that translates to half the width and height.
@@ -200,7 +206,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer)
// Case 4: A change in actual position affects both the draw transform and screen space transform.
WebTransformationMatrix positionTransform;
positionTransform.translate(0, 1.2);
- setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2f), IntSize(10, 12), false);
+ setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2), IntSize(10, 12), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform * translationToCenter, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform, layer->screenSpaceTransform());
@@ -227,7 +233,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer)
// The current implementation of calculateDrawTransforms does this implicitly, but it is
// still worth testing to detect accidental regressions.
expectedResult = positionTransform * translationToAnchor * layerTransform * translationToAnchor.inverse();
- setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5, 0), FloatPoint(0, 1.2f), IntSize(10, 12), false);
+ setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5, 0), FloatPoint(0, 1.2), IntSize(10, 12), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult * translationToCenter, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->screenSpaceTransform());
@@ -259,7 +265,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
// Case 2: parent's position affects child and grandChild.
WebTransformationMatrix parentPositionTransform;
parentPositionTransform.translate(0, 1.2);
- setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2f), IntSize(10, 12), false);
+ setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2), IntSize(10, 12), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
executeCalculateDrawTransformsAndVisibility(parent.get());
@@ -330,24 +336,27 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface)
WebTransformationMatrix identityMatrix;
WebTransformationMatrix parentLayerTransform;
- parentLayerTransform.scale3d(2, 2, 1);
+ parentLayerTransform.scale3d(1, 0.9, 1);
WebTransformationMatrix parentTranslationToAnchor;
- parentTranslationToAnchor.translate(2.5, 3);
+ parentTranslationToAnchor.translate(25, 30);
WebTransformationMatrix parentSublayerMatrix;
- parentSublayerMatrix.scale3d(10, 10, 3.3);
+ parentSublayerMatrix.scale3d(0.9, 1, 3.3);
WebTransformationMatrix parentTranslationToCenter;
- parentTranslationToCenter.translate(5, 6);
+ parentTranslationToCenter.translate(50, 60);
WebTransformationMatrix parentCompositeTransform = parentTranslationToAnchor * parentLayerTransform * parentTranslationToAnchor.inverse()
* parentTranslationToCenter * parentSublayerMatrix * parentTranslationToCenter.inverse();
+
WebTransformationMatrix childTranslationToCenter;
childTranslationToCenter.translate(8, 9);
+ WebTransformationMatrix grandChildTranslationToCenter;
+ grandChildTranslationToCenter.translate(4, 5);
// Child's render surface should not exist yet.
ASSERT_FALSE(child->renderSurface());
- setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
+ setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(100, 120), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
- setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(-0.5, -0.5), IntSize(1, 1), false);
+ setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(8, 10), false);
executeCalculateDrawTransformsAndVisibility(parent.get());
// Render surface should have been created now.
@@ -359,193 +368,16 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface)
EXPECT_TRANSFORMATION_MATRIX_EQ(childTranslationToCenter, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->screenSpaceTransform());
- // Without clipping, the origin transform and draw transform (in this particular case) should be the same.
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->renderTarget()->renderSurface()->originTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->renderTarget()->renderSurface()->drawTransform());
+
+ // Because the grandChild is the only drawable content, the child's renderSurface will tighten its bounds to the grandChild.
+ // Therefore, the draw transform will have a translation of half-width, half-height of the grandChild's bounds.
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform * grandChildTranslationToCenter, child->renderTarget()->renderSurface()->drawTransform());
// The screen space is the same as the target since the child surface draws into the root.
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->renderTarget()->renderSurface()->screenSpaceTransform());
}
-TEST(CCLayerTreeHostCommonTest, scissorRectNoClip)
-{
- DebugScopedSetImplThread thisScopeIsOnImplThread;
-
- /*
- Layers are created as follows:
-
- +--------------------+
- | 1 |
- | +-----------+ |
- | | 2 | |
- | | +-------------------+
- | | | 3 |
- | | +-------------------+
- | | | |
- | +-----------+ |
- | |
- | |
- +--------------------+
-
- Layers 1, 2 have render surfaces
- */
- OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
- OwnPtr<CCLayerImpl> child = CCLayerImpl::create(2);
- OwnPtr<CCLayerImpl> grandChild = CCLayerImpl::create(3);
-
- IntRect rootRect(0, 0, 100, 100);
- IntRect childRect(10, 10, 50, 50);
- IntRect grandChildRect(5, 5, 150, 150);
-
- root->createRenderSurface();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(rootRect.x(), rootRect.y()));
- root->setBounds(IntSize(rootRect.width(), rootRect.height()));
- root->setDrawsContent(true);
- root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(rootRect.width(), rootRect.height())));
-
- child->setAnchorPoint(FloatPoint(0, 0));
- child->setPosition(FloatPoint(childRect.x(), childRect.y()));
- child->setOpacity(0.5);
- child->setBounds(IntSize(childRect.width(), childRect.height()));
- child->setDrawsContent(true);
-
- grandChild->setAnchorPoint(FloatPoint(0, 0));
- grandChild->setPosition(IntPoint(grandChildRect.x(), grandChildRect.y()));
- grandChild->setBounds(IntSize(grandChildRect.width(), grandChildRect.height()));
- grandChild->setDrawsContent(true);
-
- CCLayerImpl* childPtr = child.get();
- CCLayerImpl* grandChildPtr = grandChild.get();
-
- child->addChild(grandChild.release());
- root->addChild(child.release());
-
- Vector<CCLayerImpl*> renderSurfaceLayerList;
- {
- WebTransformationMatrix identityMatrix;
- Vector<CCLayerImpl*> layerList;
- int dummyMaxTextureSize = 512;
- CCLayerSorter layerSorter;
-
- renderSurfaceLayerList.append(root.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, layerList, &layerSorter, dummyMaxTextureSize);
-
- FloatRect dummyDamageRect;
- CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, dummyDamageRect);
- }
-
- ASSERT_TRUE(childPtr->renderSurface());
- ASSERT_TRUE(root->renderSurface());
- ASSERT_FALSE(grandChildPtr->renderSurface());
-
- EXPECT_EQ(renderSurfaceLayerList.size(), 2U);
-
- ASSERT_EQ(root->clipRect(), IntRect(0, 0, 0, 0));
-
- // Layer's clipRect is a union of all its children's bounds
- ASSERT_EQ(childPtr->clipRect(), IntRect(0, 0, grandChildRect.x() + grandChildRect.width(), grandChildRect.y() + grandChildRect.height()));
- ASSERT_EQ(grandChildPtr->clipRect(), IntRect(0, 0, 0, 0));
-
- ASSERT_EQ(root->renderSurface()->clipRect(), IntRect(0, 0, 0, 0));
- ASSERT_EQ(childPtr->renderSurface()->clipRect(), IntRect(0, 0, 0, 0));
-
- ASSERT_FALSE(root->usesLayerClipping());
- ASSERT_FALSE(childPtr->usesLayerClipping());
- ASSERT_FALSE(grandChildPtr->usesLayerClipping());
-
- // Damage the entire screen
- IntRect rootDamage(rootRect);
- CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootDamage);
-
- EXPECT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
-
- // child surface doesn't have a clip rect, therefore it will be computed as intersection
- // between root surface's contentrect and child surface's drawable content rect.
- EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), IntRect(childRect.x(), childRect.y(), rootRect.width() - childRect.x(), rootRect.height() - childRect.y()));
-
- EXPECT_EQ(root->scissorRect(), IntRect(rootRect));
-
- // The damage is the entire rootRect, but child layer starts at an offset.
- // Even though it has bounds, it is not clipping to bounds so its children
- // (which extend beyond the bounds) extend the scissor rect
- EXPECT_EQ(childPtr->scissorRect(), IntRect(0, 0, rootRect.width() - childRect.x(), rootRect.height() - childRect.y()));
-
- // Grand child will have the same scissor rect as it doesn't have a surface
- // of its own
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(0, 0, rootRect.width() - childRect.x(), rootRect.height() - childRect.y()));
-
- // Empty damage
- rootDamage = IntRect(0, 0, 0, 0);
- CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootDamage);
-
- // Empty damage == empty scissor
- EXPECT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
- EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
-
- EXPECT_EQ(root->scissorRect(), IntRect(0, 0, 0, 0));
- EXPECT_EQ(childPtr->scissorRect(), IntRect(0, 0, 0, 0));
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(0, 0, 0, 0));
-
- // Partial damage within child
- rootDamage = IntRect(10, 10, 20, 20);
- CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootDamage);
-
- // Scissors are not computed for root
- EXPECT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
-
- // Entire damage rect is within the root surface
- EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), rootDamage);
-
- // Entire damage rect is within the layer
- EXPECT_EQ(root->scissorRect(), rootDamage);
-
- // Entire damage rect is within the layer, but with different offset
- EXPECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
-
- // Grand child does not have its own surface, so its scissor rect is identical to child's
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
-
- // Partial damage beyond child
- rootDamage = IntRect(10, 10, 80, 80);
- CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootDamage);
-
- // Scissors are not computed for root
- EXPECT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
-
- // Entire damage rect is within the root surface
- EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), rootDamage);
-
- // Entire damage rect is within the layer
- EXPECT_EQ(root->scissorRect(), rootDamage);
-
- // Entire damage rect is within the layer, but with different offset
- EXPECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
-
- // Grand child does not have its own surface, so its scissor rect is identical to child's
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
-
- // Partial damage beyond root
- rootDamage = IntRect(10, 10, 110, 110);
- CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootDamage);
-
- // Scissors are not computed for root
- EXPECT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
-
- // Root surface does not have a clipRect, so its contentRect will be used to intersect with damage.
- // Result is that root damage rect is clipped at root layer boundary
- EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), IntRect(rootDamage.x(), rootDamage.y(), rootRect.width() - rootDamage.x(), rootRect.height() - rootDamage.y()));
-
- // Root does not use layer clipping, so its content rect will be used to intersect with damage
- // Result is that root damage rect is clipped at root layer boundary
- EXPECT_EQ(root->scissorRect(), IntRect(rootDamage.x(), rootDamage.y(), rootRect.width() - rootDamage.x(), rootRect.height() - rootDamage.y()));
-
- // Children's content rects are bigger than the root's so they don't clip the damage rect, but change its offset.
- EXPECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
-}
-
TEST(CCLayerTreeHostCommonTest, scissorRectWithClip)
{
DebugScopedSetImplThread thisScopeIsOnImplThread;
@@ -623,39 +455,27 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClip)
EXPECT_EQ(renderSurfaceLayerList.size(), 2U);
- // Now root is clipping to its bounds
- ASSERT_EQ(root->clipRect(), rootRect);
-
- // Layer's clipRect is a union of all its children's bounds
- ASSERT_EQ(childPtr->clipRect(), IntRect(0, 0, grandChildRect.x() + grandChildRect.width(), grandChildRect.y() + grandChildRect.height()));
- ASSERT_EQ(grandChildPtr->clipRect(), IntRect(0, 0, 0, 0));
-
- ASSERT_EQ(root->renderSurface()->clipRect(), IntRect(0, 0, 0, 0));
-
+ ASSERT_EQ(root->renderSurface()->clipRect(), rootRect);
// Child surface's clipping rect is now set to root's
ASSERT_EQ(childPtr->renderSurface()->clipRect(), rootRect);
- ASSERT_TRUE(root->usesLayerClipping());
- ASSERT_FALSE(childPtr->usesLayerClipping());
- ASSERT_FALSE(grandChildPtr->usesLayerClipping());
-
// Damage the entire screen
IntRect rootDamage(rootRect);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootDamage);
EXPECT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
- EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), IntRect(rootRect));
+ // Child's renderSurface would have expanded to include the 150x150 grandChild located at (5, 5), and then have been clipped by the parent.
+ IntRect expectedChildRenderSurfaceScissor = intersection(rootRect, IntRect(10, 10, 155, 155));
+ EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), expectedChildRenderSurfaceScissor);
EXPECT_EQ(root->scissorRect(), IntRect(rootRect));
- // The damage is the entire rootRect, but child layer starts at an offset.
- // Even though it has bounds, it is not clipping to bounds so its children
- // (which extend beyond the bounds) extend the scissor rect
- EXPECT_EQ(childPtr->scissorRect(), IntRect(0, 0, rootRect.width() - childRect.x(), rootRect.height() - childRect.y()));
+ // The child layer is not clipped by anything (that clip is already represented by the rootSurface clipping the child's surface)
+ // So here, the expected scissor is just the child layer's rect expressed in targetSurface (child surface) space.
+ EXPECT_EQ(childPtr->scissorRect(), IntRect(0, 0, childRect.width(), childRect.height()));
- // Grand child will have the same scissor rect as it doesn't have a surface
- // of its own
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(0, 0, rootRect.width() - childRect.x(), rootRect.height() - childRect.y()));
+ // Grand child is (indirectly) clipped by the root surface. But the scissor is expressed in the targetSurface (child surface) space.
+ EXPECT_INT_RECT_EQ(grandChildPtr->scissorRect(), IntRect(5, 5, 85, 85));
// Empty damage
rootDamage = IntRect(0, 0, 0, 0);
@@ -685,8 +505,8 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClip)
// Entire damage rect is within the layer, but with different offset
EXPECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
- // Grand child does not have its own surface, so its scissor rect is identical to child's
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
+ // Grand child scissor is the damage intersected with the clipped grandChild layer rect (expressed in targetSurface space).
+ EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(5, 5, 15, 15));
// Partial damage beyond child
rootDamage = IntRect(10, 10, 80, 80);
@@ -701,11 +521,12 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClip)
// Entire damage rect is within the layer
EXPECT_EQ(root->scissorRect(), rootDamage);
- // Entire damage rect is within the layer, but with different offset
- EXPECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
+ // Child layer overlaps a portion of the damage rect.
+ EXPECT_INT_RECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), childRect.width(), childRect.height()));
- // Grand child does not have its own surface, so its scissor rect is identical to child's
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
+ // Grand child scissor is the intersection of damage and grandChild rect, expressed in child surface.
+ // The damage fits entirely within the grandChild.
+ EXPECT_INT_RECT_EQ(grandChildPtr->scissorRect(), IntRect(5, 5, 75, 75));
// Partial damage beyond root
rootDamage = IntRect(10, 10, 110, 110);
@@ -714,17 +535,13 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClip)
// Scissors are not computed for root
EXPECT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
- // Root surface does not have a clipRect, so its contentRect will be used to intersect with damage.
- // Result is that root damage rect is clipped at root layer boundary
+ // Root damage rect is clipped at root layer boundary.
EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), IntRect(rootDamage.x(), rootDamage.y(), rootRect.width() - rootDamage.x(), rootRect.height() - rootDamage.y()));
-
- // Root does not use layer clipping, so its content rect will be used to intersect with damage
- // Result is that root damage rect is clipped at root layer boundary
EXPECT_EQ(root->scissorRect(), IntRect(rootDamage.x(), rootDamage.y(), rootRect.width() - rootDamage.x(), rootRect.height() - rootDamage.y()));
// Now the scissor rects are clipped by surfaces contentRect
- EXPECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootRect.width() - rootDamage.x(), rootRect.height() - rootDamage.y()));
- EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootRect.width() - rootDamage.x(), rootRect.height() - rootDamage.y()));
+ EXPECT_INT_RECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), childRect.width(), childRect.height()));
+ EXPECT_INT_RECT_EQ(grandChildPtr->scissorRect(), IntRect(5, 5, 105, 105));
}
TEST(CCLayerTreeHostCommonTest, scissorRectWithClipAndSpaceTransform)
@@ -813,38 +630,26 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClipAndSpaceTransform)
EXPECT_EQ(renderSurfaceLayerList.size(), 3U);
- // Now root is clipping to its bounds
- ASSERT_EQ(root->clipRect(), rootRect);
-
- ASSERT_EQ(childPtr->clipRect(), IntRect(0, 0, childRect.x() + grandChildRect.width() , childRect.y() + grandChildRect.height()));
-
- // Grandchild now clips
- ASSERT_EQ(grandChildPtr->clipRect(), IntRect(0, 0, grandChildRect.x() + grandChildRect.width(), grandChildRect.y() + grandChildRect.height()));
-
- ASSERT_EQ(root->renderSurface()->clipRect(), IntRect(0, 0, 0, 0));
-
+ EXPECT_INT_RECT_EQ(root->renderSurface()->clipRect(), rootRect);
// Child surface's clipping rect is now set to root's
- ASSERT_EQ(childPtr->renderSurface()->clipRect(), rootRect);
-
- ASSERT_TRUE(root->usesLayerClipping());
- ASSERT_FALSE(childPtr->usesLayerClipping());
- ASSERT_FALSE(grandChildPtr->usesLayerClipping());
+ EXPECT_INT_RECT_EQ(childPtr->renderSurface()->clipRect(), rootRect);
// Damage the entire screen
IntRect rootDamage(rootRect);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootDamage);
- EXPECT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
- EXPECT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), IntRect(rootRect));
+ ASSERT_EQ(root->renderTarget()->renderSurface()->scissorRect(), IntRect(0, 0, 0, 0));
+ // Child's renderSurface would have expanded to include the grandChild1 and grandChild2, and then have been clipped by the parent.
+ IntRect expectedChildRenderSurfaceScissor = intersection(rootRect, IntRect(10, 10, 160, 160));
+ ASSERT_EQ(childPtr->renderTarget()->renderSurface()->scissorRect(), expectedChildRenderSurfaceScissor);
EXPECT_EQ(root->scissorRect(), IntRect(rootRect));
- // The damage is the entire rootRect, but child layer starts at an offset.
- // Even though it has bounds, it is not clipping to bounds so its children
- // (which extend beyond the bounds) extend the scissor rect
- EXPECT_EQ(childPtr->scissorRect(), IntRect(0, 0, rootRect.width() - childRect.x(), rootRect.height() - childRect.y()));
+ // The child layer is not clipped by anything (that clip is already represented by the rootSurface clipping the child's surface)
+ // So here, the expected scissor is just the child layer's rect expressed in targetSurface (child surface) space.
+ EXPECT_EQ(childPtr->scissorRect(), IntRect(0, 0, childRect.width(), childRect.height()));
- // Grand child is now scissored by the render surface
+ // Grand child now draws to its own render surface, so the scissorRect is in that surface's space.
EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(0, 0, rootRect.width() - childRect.x() - grandChildRect.x(), rootRect.height() - childRect.y() - grandChildRect.y()));
// Empty damage
@@ -891,8 +696,8 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClipAndSpaceTransform)
// Entire damage rect is within the layer
EXPECT_EQ(root->scissorRect(), rootDamage);
- // Entire damage rect is within the layer, but with different offset
- EXPECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width(), rootDamage.height()));
+ // Entire damage rect is within the layer, but it is still clipped with respect to the root.
+ EXPECT_INT_RECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), childRect.width(), childRect.height()));
// Grand child now gets scissored by its target surface as well as root
EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width() - grandChildRect.x(), rootDamage.height() - grandChildRect.y()));
@@ -912,8 +717,7 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClipAndSpaceTransform)
// Result is that root damage rect is clipped at root layer boundary
EXPECT_EQ(root->scissorRect(), IntRect(rootDamage.x(), rootDamage.y(), rootRect.width() - rootDamage.x(), rootRect.height() - rootDamage.y()));
- // Now the scissor rects are clipped by surfaces contentRect
- EXPECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootRect.width() - rootDamage.x(), rootRect.height() - rootDamage.y()));
+ EXPECT_INT_RECT_EQ(childPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), childRect.width(), childRect.height()));
// Grandchild's scissor rect is clipped by its target surface
EXPECT_EQ(grandChildPtr->scissorRect(), IntRect(rootDamage.x() - childRect.x(), rootDamage.y() - childRect.y(), rootDamage.width() - grandChildRect.x(), rootDamage.height() - grandChildRect.y()));
@@ -1001,7 +805,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
// In combination with descendantDrawsContent, opacity != 1 forces the layer to have a new renderSurface.
renderSurface1->setOpacity(0.5);
- renderSurface2->setOpacity(0.33f);
+ renderSurface2->setOpacity(0.33);
// All layers in the tree are initialized with an anchor at .25 and a size of (10,10).
// matrix "A" is the composite layer transform used in all layers, centered about the anchor point
@@ -1131,14 +935,15 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForClipLayer)
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> renderSurface1 = LayerChromium::create();
RefPtr<LayerChromiumWithForcedDrawsContent> child = adoptRef(new LayerChromiumWithForcedDrawsContent());
- renderSurface1->setOpacity(0.9f);
+ renderSurface1->setOpacity(0.9);
const WebTransformationMatrix identityMatrix;
+ setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint(30, 30), IntSize(10, 10), false);
parent->createRenderSurface();
- parent->setClipRect(IntRect(0, 0, 10, 10));
+ parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
parent->addChild(renderSurface1);
renderSurface1->createRenderSurface();
renderSurface1->addChild(child);
@@ -1196,11 +1001,12 @@ TEST(CCLayerTreeHostCommonTest, verifyForceRenderSurface)
renderSurface1->setForceRenderSurface(true);
const WebTransformationMatrix identityMatrix;
+ setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
parent->createRenderSurface();
- parent->setClipRect(IntRect(0, 0, 10, 10));
+ parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
parent->addChild(renderSurface1);
renderSurface1->addChild(child);
@@ -1589,15 +1395,19 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
child->setIsContainerForFixedPositionLayers(true);
grandChild->setPosition(FloatPoint(8, 6));
grandChild->setForceRenderSurface(true);
- greatGrandChild->setPosition(FloatPoint(140, 120));
+ greatGrandChild->setPosition(FloatPoint(40, 60));
greatGrandChild->setForceRenderSurface(true);
fixedPositionChild->setFixedToContainerLayer(true);
fixedPositionChild->setDrawsContent(true);
// The additional rotations, which are non-commutative with translations, help to
// verify that we have correct order-of-operations in the final scroll compensation.
+ // Note that rotating about the center of the layer ensures we do not accidentally
+ // clip away layers that we want to test.
WebTransformationMatrix rotationAboutZ;
+ rotationAboutZ.translate(50, 50);
rotationAboutZ.rotate3d(0, 0, 90);
+ rotationAboutZ.translate(-50, -50);
grandChild->setTransform(rotationAboutZ);
greatGrandChild->setTransform(rotationAboutZ);
@@ -1616,7 +1426,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
expectedGrandChildTransform.translate(50, 50);
WebTransformationMatrix expectedGreatGrandChildSurfaceOriginTransform;
- expectedGreatGrandChildSurfaceOriginTransform.translate(140, 120);
+ expectedGreatGrandChildSurfaceOriginTransform.translate(40, 60);
expectedGreatGrandChildSurfaceOriginTransform.multiply(rotationAboutZ);
WebTransformationMatrix expectedGreatGrandChildTransform;
@@ -1657,7 +1467,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
WebTransformationMatrix compoundOriginTransform; // transform from greatGrandChildSurface's origin to the root surface.
compoundOriginTransform.translate(8, 6); // origin translation of grandChild
compoundOriginTransform.multiply(rotationAboutZ); // rotation of grandChild
- compoundOriginTransform.translate(140, 120); // origin translation of greatGrandChild
+ compoundOriginTransform.translate(40, 60); // origin translation of greatGrandChild
compoundOriginTransform.multiply(rotationAboutZ); // rotation of greatGrandChild
expectedFixedPositionChildTransform.makeIdentity();
@@ -1854,16 +1664,16 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsRenderSurfaces)
setLayerPropertiesForTesting(leafNode2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
child->setMasksToBounds(true);
- child->setOpacity(0.4f);
+ child->setOpacity(0.4);
grandChild->setOpacity(0.5);
- greatGrandChild->setOpacity(0.4f);
+ greatGrandChild->setOpacity(0.4);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
// FIXME: when we fix this "root-layer special case" behavior in CCLayerTreeHost, we will have to fix it here, too.
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
+ parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -1877,67 +1687,6 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsRenderSurfaces)
EXPECT_EQ(child->id(), renderSurfaceLayerList[1]->id());
}
-TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsRenderSurfacesCrashRepro)
-{
- // This is a similar situation as verifyClipRectCullsRenderSurfaces, except that
- // it reproduces a crash bug http://code.google.com/p/chromium/issues/detail?id=106734.
-
- const WebTransformationMatrix identityMatrix;
- RefPtr<LayerChromium> parent = LayerChromium::create();
- RefPtr<LayerChromium> child = LayerChromium::create();
- RefPtr<LayerChromium> grandChild = LayerChromium::create();
- RefPtr<LayerChromium> greatGrandChild = LayerChromium::create();
- RefPtr<LayerChromiumWithForcedDrawsContent> leafNode1 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- RefPtr<LayerChromiumWithForcedDrawsContent> leafNode2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
- parent->addChild(child);
- child->addChild(grandChild);
- grandChild->addChild(greatGrandChild);
-
- // leafNode1 ensures that parent and child are kept on the renderSurfaceLayerList,
- // even though grandChild and greatGrandChild should be clipped.
- child->addChild(leafNode1);
- greatGrandChild->addChild(leafNode2);
-
- setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), false);
- setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
- setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(45, 45), IntSize(10, 10), false);
- setLayerPropertiesForTesting(greatGrandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
- setLayerPropertiesForTesting(leafNode1.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), false);
- setLayerPropertiesForTesting(leafNode2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
-
- child->setMasksToBounds(true);
- child->setOpacity(0.4f);
- grandChild->setOpacity(0.5);
- greatGrandChild->setOpacity(0.4f);
-
- // Contaminate the grandChild and greatGrandChild's clipRect to reproduce the crash
- // bug found in http://code.google.com/p/chromium/issues/detail?id=106734. In this
- // bug, the clipRect was not re-computed for layers that create RenderSurfaces, and
- // therefore leafNode2 thinks it should draw itself. As a result, an extra
- // renderSurface remains on the renderSurfaceLayerList, which violates the assumption
- // that an empty renderSurface will always be the last item on the list, which
- // ultimately caused the crash.
- child->setClipRect(IntRect(IntPoint::zero(), IntSize(20, 20)));
- greatGrandChild->setClipRect(IntRect(IntPoint::zero(), IntSize(1234, 1234)));
-
- Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
- int dummyMaxTextureSize = 512;
-
- // FIXME: when we fix this "root-layer special case" behavior in CCLayerTreeHost, we will have to fix it here, too.
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
-
- CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, parent->renderSurface()->contentRect());
-
- ASSERT_EQ(2U, renderSurfaceLayerList.size());
- EXPECT_EQ(parent->id(), renderSurfaceLayerList[0]->id());
- EXPECT_EQ(child->id(), renderSurfaceLayerList[1]->id());
-}
-
TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsSurfaceWithoutVisibleContent)
{
// When a renderSurface has a clipRect, it is used to clip the contentRect
@@ -1971,15 +1720,15 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsSurfaceWithoutVisibleContent)
setLayerPropertiesForTesting(leafNode.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
parent->setMasksToBounds(true);
- child->setOpacity(0.4f);
- grandChild->setOpacity(0.4f);
+ child->setOpacity(0.4);
+ grandChild->setOpacity(0.4);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
parent->createRenderSurface();
+ parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -1997,8 +1746,8 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsSurfaceWithoutVisibleContent)
renderSurfaceLayerList.clear();
dummyLayerList.clear();
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
parent->createRenderSurface();
+ parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -2010,14 +1759,14 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsSurfaceWithoutVisibleContent)
EXPECT_EQ(grandChild->id(), renderSurfaceLayerList[2]->id());
}
-TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToLayers)
+TEST(CCLayerTreeHostCommonTest, verifyDrawableContentRectForLayers)
{
- // Verify that layers get the appropriate clipRects when their parent masksToBounds is true.
+ // Verify that layers get the appropriate drawableContentRect when their parent masksToBounds is true.
//
- // grandChild1 - completely inside the region; clipRect should be the mask region (larger than this layer's bounds).
- // grandChild2 - partially clipped but NOT masksToBounds; the clipRect should be the parent's clipRect regardless of the layer's bounds.
- // grandChild3 - partially clipped and masksToBounds; the clipRect will be the intersection of layerBounds and the mask region.
- // grandChild4 - outside parent's clipRect, and masksToBounds; the clipRect should be empty.
+ // grandChild1 - completely inside the region; drawableContentRect should be the layer rect expressed in target space.
+ // grandChild2 - partially clipped but NOT masksToBounds; the clipRect will be the intersection of layerBounds and the mask region.
+ // grandChild3 - partially clipped and masksToBounds; the drawableContentRect will still be the intersection of layerBounds and the mask region.
+ // grandChild4 - outside parent's clipRect; the drawableContentRect should be empty.
//
const WebTransformationMatrix identityMatrix;
@@ -2044,10 +1793,9 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToLayers)
child->setMasksToBounds(true);
grandChild3->setMasksToBounds(true);
- grandChild4->setMasksToBounds(true);
// Force everyone to be a render surface.
- child->setOpacity(0.4f);
+ child->setOpacity(0.4);
grandChild1->setOpacity(0.5);
grandChild2->setOpacity(0.5);
grandChild3->setOpacity(0.5);
@@ -2058,7 +1806,7 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToLayers)
int dummyMaxTextureSize = 512;
// FIXME: when we fix this "root-layer special case" behavior in CCLayerTreeHost, we will have to fix it here, too.
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
+ parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -2066,17 +1814,17 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToLayers)
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, parent->renderSurface()->contentRect());
- EXPECT_INT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(20, 20)), grandChild1->clipRect());
- EXPECT_INT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(20, 20)), grandChild2->clipRect());
- EXPECT_INT_RECT_EQ(IntRect(IntPoint(15, 15), IntSize(5, 5)), grandChild3->clipRect());
- EXPECT_TRUE(grandChild4->clipRect().isEmpty());
+ EXPECT_INT_RECT_EQ(IntRect(IntPoint(5, 5), IntSize(10, 10)), grandChild1->drawableContentRect());
+ EXPECT_INT_RECT_EQ(IntRect(IntPoint(15, 15), IntSize(5, 5)), grandChild3->drawableContentRect());
+ EXPECT_INT_RECT_EQ(IntRect(IntPoint(15, 15), IntSize(5, 5)), grandChild3->drawableContentRect());
+ EXPECT_TRUE(grandChild4->drawableContentRect().isEmpty());
}
TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
{
// Verify that renderSurfaces (and their layers) get the appropriate clipRects when their parent masksToBounds is true.
//
- // Layers that own renderSurfaces (at least for now) do not inherit any clipRect;
+ // Layers that own renderSurfaces (at least for now) do not inherit any clipping;
// instead the surface will enforce the clip for the entire subtree. They may still
// have a clipRect of their own layer bounds, however, if masksToBounds was true.
//
@@ -2122,7 +1870,7 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
grandChild4->setMasksToBounds(true);
// Force everyone to be a render surface.
- child->setOpacity(0.4f);
+ child->setOpacity(0.4);
grandChild1->setOpacity(0.5);
grandChild2->setOpacity(0.5);
grandChild3->setOpacity(0.5);
@@ -2133,7 +1881,7 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
int dummyMaxTextureSize = 512;
// FIXME: when we fix this "root-layer special case" behavior in CCLayerTreeHost, we will have to fix it here, too.
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
+ parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -2149,12 +1897,6 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
EXPECT_INT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild1->renderSurface()->clipRect());
EXPECT_INT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild2->renderSurface()->clipRect());
EXPECT_INT_RECT_EQ(IntRect(IntPoint(0, 0), IntSize(20, 20)), grandChild3->renderSurface()->clipRect());
-
- // Layers do not inherit the clipRect from their owned surfaces, but if masksToBounds is true, they do create their own clipRect.
- EXPECT_FALSE(grandChild1->usesLayerClipping());
- EXPECT_FALSE(grandChild2->usesLayerClipping());
- EXPECT_TRUE(grandChild3->usesLayerClipping());
- EXPECT_TRUE(grandChild4->usesLayerClipping());
}
TEST(CCLayerTreeHostCommonTest, verifyAnimationsForRenderSurfaceHierarchy)
@@ -2619,7 +2361,6 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithoutPreserves3d)
Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -2724,7 +2465,6 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3d)
Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -2811,7 +2551,6 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithAnimatingTransforms)
int dummyMaxTextureSize = 512;
parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -2885,7 +2624,6 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3dForFlattenin
Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -3208,7 +2946,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents
// test makes sure that hit testing works correctly accounts for the contents scale.
// A contentsScale that is not 1 effectively forces a non-identity transform between
// layer's content space and layer's origin space, which is not included in the
- // screenSpaceTransformn. The hit testing code must take this into account.
+ // screenSpaceTransform. The hit testing code must take this into account.
//
// To test this, the layer is positioned at (25, 25), and is size (50, 50). If
// contentsScale is ignored, then hit testing will mis-interpret the visibleContentRect
@@ -3677,7 +3415,97 @@ PassRefPtr<ContentLayerChromium> createDrawableContentLayerChromium(ContentLayer
return toReturn.release();
}
-TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTranformsInHighDPI)
+TEST(CCLayerTreeHostCommonTest, verifyLayerTransformsInHighDPI)
+{
+ // Verify draw and screen space transforms of layers not in a surface.
+ MockContentLayerDelegate delegate;
+ WebTransformationMatrix identityMatrix;
+ WebTransformationMatrix parentMatrix;
+
+ RefPtr<ContentLayerChromium> parent = createDrawableContentLayerChromium(&delegate);
+ setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true);
+
+ RefPtr<ContentLayerChromium> child = createDrawableContentLayerChromium(&delegate);
+ setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
+
+ RefPtr<ContentLayerChromium> childNoScale = createDrawableContentLayerChromium(&delegate);
+ setLayerPropertiesForTesting(childNoScale.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
+
+ parent->addChild(child);
+ parent->addChild(childNoScale);
+
+ Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
+ Vector<RefPtr<LayerChromium> > dummyLayerList;
+ int dummyMaxTextureSize = 512;
+
+ parent->createRenderSurface();
+ parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
+ renderSurfaceLayerList.append(parent.get());
+
+ const double deviceScaleFactor = 2.5;
+ parentMatrix.scale(deviceScaleFactor);
+ parent->setContentsScale(deviceScaleFactor);
+ child->setContentsScale(deviceScaleFactor);
+ EXPECT_EQ(childNoScale->contentsScale(), 1);
+
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), parentMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+
+ EXPECT_EQ(1u, renderSurfaceLayerList.size());
+
+ // Verify parent transforms
+ WebTransformationMatrix expectedParentScreenSpaceTransform;
+ expectedParentScreenSpaceTransform.setM11(deviceScaleFactor);
+ expectedParentScreenSpaceTransform.setM22(deviceScaleFactor);
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentScreenSpaceTransform, parent->screenSpaceTransform());
+
+ WebTransformationMatrix expectedParentDrawTransform = expectedParentScreenSpaceTransform;
+ expectedParentDrawTransform.translate(0.5 * parent->bounds().width(), 0.5 * parent->bounds().height());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentDrawTransform, parent->drawTransform());
+
+ // Verify results of transformed parent rects
+ IntRect parentBounds(IntPoint(), parent->bounds());
+ IntRect centeredParentBounds = parentBounds;
+ centeredParentBounds.move(-parentBounds.width() * 0.5, -parentBounds.height() * 0.5);
+
+ FloatRect parentDrawRect = CCMathUtil::mapClippedRect(parent->drawTransform(), FloatRect(centeredParentBounds));
+ FloatRect parentScreenSpaceRect = CCMathUtil::mapClippedRect(parent->screenSpaceTransform(), FloatRect(parentBounds));
+
+ FloatRect expectedParentDrawRect(FloatPoint(), parent->bounds());
+ expectedParentDrawRect.scale(deviceScaleFactor);
+ EXPECT_FLOAT_RECT_EQ(expectedParentDrawRect, parentDrawRect);
+ EXPECT_FLOAT_RECT_EQ(expectedParentDrawRect, parentScreenSpaceRect);
+
+ // Verify child transforms
+ WebTransformationMatrix expectedChildScreenSpaceTransform;
+ expectedChildScreenSpaceTransform.setM11(deviceScaleFactor);
+ expectedChildScreenSpaceTransform.setM22(deviceScaleFactor);
+ expectedChildScreenSpaceTransform.translate(child->position().x(), child->position().y());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildScreenSpaceTransform, child->screenSpaceTransform());
+
+ WebTransformationMatrix expectedChildDrawTransform = expectedChildScreenSpaceTransform;
+ expectedChildDrawTransform.translate(0.5 * child->bounds().width(), 0.5 * child->bounds().height());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildDrawTransform, child->drawTransform());
+
+ // Verify results of transformed child rects
+ IntRect childBounds(IntPoint(), child->bounds());
+ IntRect centeredChildBounds = childBounds;
+ centeredChildBounds.move(-childBounds.width() * 0.5, -childBounds.height() * 0.5);
+
+ FloatRect childDrawRect = CCMathUtil::mapClippedRect(child->drawTransform(), FloatRect(centeredChildBounds));
+ FloatRect childScreenSpaceRect = CCMathUtil::mapClippedRect(child->screenSpaceTransform(), FloatRect(childBounds));
+
+ FloatRect expectedChildDrawRect(FloatPoint(), child->bounds());
+ expectedChildDrawRect.move(child->position().x(), child->position().y());
+ expectedChildDrawRect.scale(deviceScaleFactor);
+ EXPECT_FLOAT_RECT_EQ(expectedChildDrawRect, childDrawRect);
+ EXPECT_FLOAT_RECT_EQ(expectedChildDrawRect, childScreenSpaceRect);
+
+ // Verify childNoScale transforms
+ EXPECT_TRANSFORMATION_MATRIX_EQ(child->drawTransform(), childNoScale->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(child->screenSpaceTransform(), childNoScale->screenSpaceTransform());
+}
+
+TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTransformsInHighDPI)
{
MockContentLayerDelegate delegate;
WebTransformationMatrix identityMatrix;
@@ -3694,7 +3522,13 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTranformsInHighDPI)
RefPtr<ContentLayerChromium> replica = createDrawableContentLayerChromium(&delegate);
setLayerPropertiesForTesting(replica.get(), replicaTransform, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true);
+ // This layer should end up in the same surface as child, with the same draw
+ // and screen space transforms.
+ RefPtr<ContentLayerChromium> duplicateChildNonOwner = createDrawableContentLayerChromium(&delegate);
+ setLayerPropertiesForTesting(duplicateChildNonOwner.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), true);
+
parent->addChild(child);
+ child->addChild(duplicateChildNonOwner);
child->setReplicaLayer(replica.get());
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
@@ -3703,13 +3537,13 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTranformsInHighDPI)
parent->createRenderSurface();
parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds()));
renderSurfaceLayerList.append(parent.get());
const double deviceScaleFactor = 1.5;
parentMatrix.scale(deviceScaleFactor);
parent->setContentsScale(deviceScaleFactor);
child->setContentsScale(deviceScaleFactor);
+ duplicateChildNonOwner->setContentsScale(deviceScaleFactor);
replica->setContentsScale(deviceScaleFactor);
CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), parentMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
@@ -3718,6 +3552,14 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTranformsInHighDPI)
// render surface (it needs one because it has a replica layer).
EXPECT_EQ(2u, renderSurfaceLayerList.size());
+ WebTransformationMatrix expectedParentScreenSpaceTransform;
+ expectedParentScreenSpaceTransform.setM11(deviceScaleFactor);
+ expectedParentScreenSpaceTransform.setM22(deviceScaleFactor);
+ WebTransformationMatrix expectedParentDrawTransform = expectedParentScreenSpaceTransform;
+ expectedParentDrawTransform.translate(0.5 * parent->bounds().width(), 0.5 * parent->bounds().height());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentDrawTransform, parent->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentScreenSpaceTransform, parent->screenSpaceTransform());
+
WebTransformationMatrix expectedDrawTransform;
expectedDrawTransform.setM11(deviceScaleFactor);
expectedDrawTransform.setM22(deviceScaleFactor);
@@ -3725,6 +3567,17 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTranformsInHighDPI)
expectedDrawTransform.setM42(0.5 * deviceScaleFactor * child->bounds().height());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedDrawTransform, child->drawTransform());
+ WebTransformationMatrix expectedScreenSpaceTransform;
+ expectedScreenSpaceTransform.setM11(deviceScaleFactor);
+ expectedScreenSpaceTransform.setM22(deviceScaleFactor);
+ expectedScreenSpaceTransform.translate(child->position().x(), child->position().y());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedScreenSpaceTransform, child->screenSpaceTransform());
+
+ EXPECT_TRANSFORMATION_MATRIX_EQ(child->drawTransform(), duplicateChildNonOwner->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(child->screenSpaceTransform(), duplicateChildNonOwner->screenSpaceTransform());
+ EXPECT_INT_RECT_EQ(child->drawableContentRect(), duplicateChildNonOwner->drawableContentRect());
+ EXPECT_EQ(child->contentBounds(), duplicateChildNonOwner->contentBounds());
+
WebTransformationMatrix expectedRenderSurfaceDrawTransform;
expectedRenderSurfaceDrawTransform.translate(deviceScaleFactor * (child->position().x() + 0.5 * child->bounds().width()), deviceScaleFactor * (child->position().y() + 0.5 * child->bounds().height()));
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedRenderSurfaceDrawTransform, child->renderSurface()->drawTransform());
@@ -3733,9 +3586,9 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTranformsInHighDPI)
expectedOriginTransform.translate(deviceScaleFactor * 2, deviceScaleFactor * 2);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedOriginTransform, child->renderSurface()->originTransform());
- WebTransformationMatrix expectedScreenSpaceTransform;
- expectedScreenSpaceTransform.translate(deviceScaleFactor * 2, deviceScaleFactor * 2);
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedScreenSpaceTransform, child->renderSurface()->screenSpaceTransform());
+ WebTransformationMatrix expectedSurfaceScreenSpaceTransform;
+ expectedSurfaceScreenSpaceTransform.translate(deviceScaleFactor * 2, deviceScaleFactor * 2);
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceScreenSpaceTransform, child->renderSurface()->screenSpaceTransform());
WebTransformationMatrix expectedReplicaDrawTransform;
expectedReplicaDrawTransform.setM22(-1);
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
index dd525fcbf..1419164b5 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
@@ -137,10 +137,15 @@ public:
root->setMaxScrollPosition(contentSize);
root->setBounds(contentSize);
root->setContentBounds(contentSize);
+ root->setPosition(FloatPoint(0, 0));
+ root->setAnchorPoint(FloatPoint(0, 0));
+
OwnPtr<CCLayerImpl> contents = CCLayerImpl::create(2);
contents->setDrawsContent(true);
contents->setBounds(contentSize);
contents->setContentBounds(contentSize);
+ contents->setPosition(FloatPoint(0, 0));
+ contents->setAnchorPoint(FloatPoint(0, 0));
root->addChild(contents.release());
m_hostImpl->setRootLayer(root.release());
}
@@ -838,13 +843,18 @@ TEST_F(CCLayerTreeHostImplTest, scrollNonCompositedRoot)
OwnPtr<CCLayerImpl> contentLayer = CCLayerImpl::create(1);
contentLayer->setIsNonCompositedContent(true);
contentLayer->setDrawsContent(true);
- contentLayer->setPosition(IntPoint(5, 5));
+ contentLayer->setPosition(FloatPoint(0, 0));
+ contentLayer->setAnchorPoint(FloatPoint(0, 0));
contentLayer->setBounds(surfaceSize);
contentLayer->setContentBounds(IntSize(surfaceSize.width() * 2, surfaceSize.height() * 2));
OwnPtr<CCLayerImpl> scrollLayer = CCLayerImpl::create(2);
scrollLayer->setScrollable(true);
scrollLayer->setMaxScrollPosition(surfaceSize);
+ scrollLayer->setBounds(surfaceSize);
+ scrollLayer->setContentBounds(surfaceSize);
+ scrollLayer->setPosition(FloatPoint(0, 0));
+ scrollLayer->setAnchorPoint(FloatPoint(0, 0));
scrollLayer->addChild(contentLayer.release());
m_hostImpl->setRootLayer(scrollLayer.release());
@@ -862,6 +872,8 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildCallsCommitAndRedraw)
{
IntSize surfaceSize(10, 10);
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
+ root->setBounds(surfaceSize);
+ root->setContentBounds(surfaceSize);
root->addChild(createScrollableLayer(2, FloatPoint(0, 0), surfaceSize));
m_hostImpl->setRootLayer(root.release());
m_hostImpl->setViewportSize(surfaceSize);
@@ -1038,6 +1050,8 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
{
IntSize surfaceSize(10, 10);
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
+ root->setBounds(surfaceSize);
+ root->setContentBounds(surfaceSize);
// Also mark the root scrollable so it becomes the root scroll layer.
root->setScrollable(true);
int scrollLayerId = 2;
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
index b0e9ee8d6..ca3e21c3d 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
@@ -2176,8 +2176,14 @@ public:
virtual void beginTest() OVERRIDE
{
m_layerTreeHost->setViewportSize(IntSize(10, 10));
+ m_layerTreeHost->rootLayer()->setBounds(IntSize(10, 10));
+
m_rootScrollLayer = ContentLayerChromium::create(&m_mockDelegate);
m_rootScrollLayer->setBounds(IntSize(10, 10));
+
+ m_rootScrollLayer->setPosition(FloatPoint(0, 0));
+ m_rootScrollLayer->setAnchorPoint(FloatPoint(0, 0));
+
m_rootScrollLayer->setIsDrawable(true);
m_rootScrollLayer->setScrollable(true);
m_rootScrollLayer->setMaxScrollPosition(IntSize(100, 100));
@@ -2188,6 +2194,10 @@ public:
m_childLayer->setIsDrawable(true);
m_childLayer->setScrollable(true);
m_childLayer->setMaxScrollPosition(IntSize(100, 100));
+
+ m_childLayer->setPosition(FloatPoint(0, 0));
+ m_childLayer->setAnchorPoint(FloatPoint(0, 0));
+
m_rootScrollLayer->addChild(m_childLayer);
postSetNeedsCommitToMainThread();
}
diff --git a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
index 87bde5117..b559db12c 100644
--- a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
@@ -263,7 +263,6 @@ protected:
ASSERT(!root->renderSurface());
root->createRenderSurface();
root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), root->bounds()));
- root->setClipRect(IntRect(IntPoint::zero(), root->bounds()));
m_renderSurfaceLayerListImpl.append(m_root.get());
CCLayerTreeHostCommon::calculateDrawTransforms(root, root, identityMatrix, identityMatrix, m_renderSurfaceLayerListImpl, dummyLayerList, &layerSorter, dummyMaxTextureSize);
@@ -282,7 +281,6 @@ protected:
ASSERT(!root->renderSurface());
root->createRenderSurface();
root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), root->bounds()));
- root->setClipRect(IntRect(IntPoint::zero(), root->bounds()));
m_renderSurfaceLayerListChromium.append(m_root);
CCLayerTreeHostCommon::calculateDrawTransforms(root, root, identityMatrix, identityMatrix, m_renderSurfaceLayerListChromium, dummyLayerList, dummyMaxTextureSize);
@@ -2069,7 +2067,7 @@ protected:
this->visitLayer(surfaceChild2, occlusion);
this->enterLayer(surfaceChild, occlusion);
- EXPECT_INT_RECT_EQ(IntRect(100, 0, 150, 300), occlusion.unoccludedContentRect(surfaceChild, IntRect(0, 0, 300, 300)));
+ EXPECT_INT_RECT_EQ(IntRect(100, 0, 100, 300), occlusion.unoccludedContentRect(surfaceChild, IntRect(0, 0, 300, 300)));
this->leaveLayer(surfaceChild, occlusion);
this->enterLayer(surface, occlusion);
EXPECT_INT_RECT_EQ(IntRect(200, 0, 50, 300), occlusion.unoccludedContentRect(surface, IntRect(0, 0, 300, 300)));
@@ -2121,7 +2119,7 @@ protected:
this->visitLayer(surfaceChild2, occlusion);
this->enterLayer(surfaceChild, occlusion);
- EXPECT_INT_RECT_EQ(IntRect(100, 0, 150, 300), occlusion.unoccludedContentRect(surfaceChild, IntRect(0, 0, 300, 300)));
+ EXPECT_INT_RECT_EQ(IntRect(100, 0, 100, 300), occlusion.unoccludedContentRect(surfaceChild, IntRect(0, 0, 300, 300)));
this->leaveLayer(surfaceChild, occlusion);
this->enterLayer(surface, occlusion);
EXPECT_INT_RECT_EQ(IntRect(200, 0, 50, 300), occlusion.unoccludedContentRect(surface, IntRect(0, 0, 300, 300)));
diff --git a/Source/WebKit/chromium/tests/CCResourceProviderTest.cpp b/Source/WebKit/chromium/tests/CCResourceProviderTest.cpp
index 57165e6ca..b2c41e525 100644
--- a/Source/WebKit/chromium/tests/CCResourceProviderTest.cpp
+++ b/Source/WebKit/chromium/tests/CCResourceProviderTest.cpp
@@ -239,9 +239,8 @@ TEST_F(CCResourceProviderTest, DeleteOwnedResources)
int pool = 1;
const int count = 3;
- CCResourceProvider::ResourceId ids[count] = {0};
for (int i = 0; i < count; ++i)
- ids[i] = m_resourceProvider->createResource(pool, size, format, CCResourceProvider::TextureUsageAny);
+ m_resourceProvider->createResource(pool, size, format, CCResourceProvider::TextureUsageAny);
EXPECT_EQ(3, context()->textureCount());
m_resourceProvider->deleteOwnedResources(pool+1);
diff --git a/Source/WebKit/chromium/tests/CCTextureUpdaterTest.cpp b/Source/WebKit/chromium/tests/CCTextureUpdaterTest.cpp
index b7a26df2f..bfb35c048 100644
--- a/Source/WebKit/chromium/tests/CCTextureUpdaterTest.cpp
+++ b/Source/WebKit/chromium/tests/CCTextureUpdaterTest.cpp
@@ -51,12 +51,25 @@ class CCTextureUpdaterTest;
class WebGraphicsContext3DForUploadTest : public FakeWebGraphicsContext3D {
public:
- WebGraphicsContext3DForUploadTest(CCTextureUpdaterTest *test) : m_test(test) { }
+ WebGraphicsContext3DForUploadTest(CCTextureUpdaterTest *test)
+ : m_test(test)
+ , m_supportShallowFlush(true)
+ { }
+
virtual void flush(void);
+ virtual void shallowFlushCHROMIUM(void);
virtual GrGLInterface* onCreateGrGLInterface() { return 0; }
+ virtual WebString getString(WGC3Denum name)
+ {
+ if (m_supportShallowFlush)
+ return WebString("GL_CHROMIUM_shallow_flush");
+ return WebString("");
+ }
+
private:
CCTextureUpdaterTest* m_test;
+ bool m_supportShallowFlush;
};
@@ -231,6 +244,11 @@ void WebGraphicsContext3DForUploadTest::flush(void)
m_test->onFlush();
}
+void WebGraphicsContext3DForUploadTest::shallowFlushCHROMIUM(void)
+{
+ m_test->onFlush();
+}
+
void TextureUploaderForUploadTest::beginUploads()
{
m_test->onBeginUploads();
diff --git a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
index 004022b66..a932ab61c 100644
--- a/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerChromiumTest.cpp
@@ -495,10 +495,8 @@ TEST_F(LayerChromiumTest, checkPropertyChangeCausesCorrectBehavior)
// Test properties that should not call needsDisplay and needsCommit when changed.
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleContentRect(IntRect(0, 0, 40, 50)));
- EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setUsesLayerClipping(true));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setIsNonCompositedContent(true));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawOpacity(0.5));
- EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setClipRect(IntRect(3, 3, 8, 8)));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setRenderTarget(0));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setDrawTransform(WebTransformationMatrix()));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setScreenSpaceTransform(WebTransformationMatrix()));
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index a6fb4a584..fe2e6c56e 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,14 @@
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Removed numTouchEventHandlersChanged stub.
+
+ * WebCoreSupport/ChromeClientEfl.h:
+
2012-07-22 Kent Tamura <tkent@chromium.org>
Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively
diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
index 81b5dae63..3cfc678ec 100644
--- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
+++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
@@ -179,7 +179,6 @@ public:
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return true; }
virtual void numWheelEventHandlersChanged(unsigned) { }
- virtual void numTouchEventHandlersChanged(unsigned) { }
Evas_Object* m_view;
KURL m_hoveredLinkURL;
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index be5485d56..1501bd2bb 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,14 @@
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove numTouchEventHandlersChanged stub.
+
+ * WebCoreSupport/ChromeClientGtk.h:
+
2012-07-17 Vivek Galatage <vivekgalatage@gmail.com>
Web Inspector: refactor InspectorController::connectFrontend() to accept InspectorFrontendChannel.
diff --git a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
index d58ffc1c4..e5e2fa1eb 100644
--- a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
+++ b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
@@ -152,7 +152,6 @@ namespace WebKit {
virtual bool shouldRubberBandInDirection(ScrollDirection) const { return true; }
virtual void numWheelEventHandlersChanged(unsigned) { }
- virtual void numTouchEventHandlersChanged(unsigned) { }
#if USE(ACCELERATED_COMPOSITING)
virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 60d697325..9df345021 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,39 @@
+2012-07-23 Simon Fraser <simon.fraser@apple.com>
+
+ Part 2 of: Implement sticky positioning
+ https://bugs.webkit.org/show_bug.cgi?id=90046
+
+ Reviewed by Ojan Vafai.
+
+ Turn on ENABLE_CSS_STICKY_POSITION.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove numTouchEventHandlersChanged stub.
+
+ * WebCoreSupport/WebChromeClient.h:
+
+2012-07-23 Simon Fraser <simon.fraser@apple.com>
+
+ Part 1 of: Implement sticky positioning
+ https://bugs.webkit.org/show_bug.cgi?id=90046
+
+ Reviewed by Ojan Vafai.
+
+ Add ENABLE_CSS_STICKY_POSITION, defaulting to off initially.
+
+ Sort the ENABLE_CSS lines in the file. Make sure all the flags
+ are in FEATURE_DEFINES.
+
+ * Configurations/FeatureDefines.xcconfig:
+
2012-07-23 Kent Tamura <tkent@chromium.org>
Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively
diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
index dedcb83f2..49182f3a0 100644
--- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -37,15 +37,16 @@ ENABLE_ANIMATION_API = ;
ENABLE_BLOB = ENABLE_BLOB;
ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
ENABLE_CSP_NEXT = ;
-ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
ENABLE_CSS_BOX_DECORATION_BREAK = ENABLE_CSS_BOX_DECORATION_BREAK;
ENABLE_CSS_EXCLUSIONS = ENABLE_CSS_EXCLUSIONS;
ENABLE_CSS_FILTERS = ENABLE_CSS_FILTERS;
-ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
ENABLE_CSS_IMAGE_ORIENTATION = ;
ENABLE_CSS_IMAGE_RESOLUTION = ;
ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS;
+ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS;
+ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION;
ENABLE_CSS_VARIABLES = ;
+ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX;
ENABLE_CUSTOM_SCHEME_HANDLER = ;
ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME));
ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT;
@@ -135,4 +136,4 @@ ENABLE_WEB_TIMING = ;
ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_VARIABLES) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_FLEXBOX) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT);
diff --git a/Source/WebKit/mac/Configurations/Version.xcconfig b/Source/WebKit/mac/Configurations/Version.xcconfig
index 841345e10..b827ad3ef 100644
--- a/Source/WebKit/mac/Configurations/Version.xcconfig
+++ b/Source/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 537;
-MINOR_VERSION = 2;
+MINOR_VERSION = 3;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
index 16041b0cc..a473fe340 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -180,7 +180,6 @@ public:
virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const OVERRIDE;
virtual void numWheelEventHandlersChanged(unsigned) OVERRIDE { }
- virtual void numTouchEventHandlersChanged(unsigned) OVERRIDE { }
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const OVERRIDE { return false; }
private:
WebView *m_webView;
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index 1330870da..8e9633d18 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -122,6 +122,7 @@
#include <QApplication>
#include <QBasicTimer>
#include <QBitArray>
+#include <QColorDialog>
#include <QDebug>
#include <QDesktopWidget>
#include <QDragEnterEvent>
@@ -2443,6 +2444,19 @@ void QWebPage::triggerAction(WebAction action, bool)
editor->command(command).execute();
}
+
+QColor QWebPagePrivate::colorSelectionRequested(const QColor &selectedColor)
+{
+ QColor ret = selectedColor;
+#ifndef QT_NO_COLORDIALOG
+ QWidget* parent = (client) ? client->ownerWidget() : 0;
+ ret = QColorDialog::getColor(selectedColor, parent);
+ if (!ret.isValid())
+ ret = selectedColor;
+#endif
+ return ret;
+}
+
QSize QWebPage::viewportSize() const
{
if (d->mainFrame && d->mainFrame.data()->d->frame->view())
diff --git a/Source/WebKit/qt/Api/qwebpage_p.h b/Source/WebKit/qt/Api/qwebpage_p.h
index aabdd1174..ca3aa94ad 100644
--- a/Source/WebKit/qt/Api/qwebpage_p.h
+++ b/Source/WebKit/qt/Api/qwebpage_p.h
@@ -94,6 +94,8 @@ public:
void updateNavigationActions();
void updateEditorActions();
+ QColor colorSelectionRequested(const QColor& selectedColor);
+
void timerEvent(QTimerEvent*);
template<class T> void mouseMoveEvent(T*);
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index d75294502..fbfcf398c 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,57 @@
+2012-07-24 Pierre Rossi <pierre.rossi@gmail.com>
+
+ [Qt][WK1] color input type support
+ https://bugs.webkit.org/show_bug.cgi?id=91998
+
+ Reviewed by Simon Hausmann.
+
+ Using QColorDialog. This is private for now, but
+ it could be exposed via a virtual function in
+ QWebPage at a later point in a Qt 5 minor release
+ if there are requests for that.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::colorSelectionRequested):
+ * Api/qwebpage_p.h:
+ (QWebPagePrivate):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createColorChooser):
+
+2012-07-23 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
+
+ [Qt] Fix compilation against namespaced Qt
+
+ Reviewed by Simon Hausmann.
+
+ * WebCoreSupport/GeolocationClientQt.h:
+ * examples/platformplugin/WebPlugin.h:
+
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove numTouchEventHandlersChanged stub.
+
+ * WebCoreSupport/ChromeClientQt.h:
+
+2012-07-23 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
+ [Qt] RenderThemeQtMobile highlight colors are not being used
+ https://bugs.webkit.org/show_bug.cgi?id=92004
+
+ Reviewed by Noam Rosenthal.
+
+ * WebCoreSupport/RenderThemeQStyle.cpp:
+ (WebCore::RenderThemeQStyle::setPaletteFromPageClientIfExists): Moved here since
+ it's used only by RenderThemeQStyle. Remove unnecessary check for m_page->chrome().
+ (WebCore):
+ (WebCore::RenderThemeQStyle::colorPalette):
+ * WebCoreSupport/RenderThemeQStyle.h:
+ (RenderThemeQStyle):
+
2012-07-22 Kent Tamura <tkent@chromium.org>
Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index b21ce9e98..43b105ef3 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -32,6 +32,7 @@
#include "ApplicationCacheStorage.h"
#include "ColorChooser.h"
+#include "ColorChooserClient.h"
#include "DatabaseTracker.h"
#include "Document.h"
#include "FileChooser.h"
@@ -559,9 +560,11 @@ void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin* origin,
}
#if ENABLE(INPUT_TYPE_COLOR)
-PassOwnPtr<ColorChooser> ChromeClientQt::createColorChooser(ColorChooserClient*, const Color&)
+PassOwnPtr<ColorChooser> ChromeClientQt::createColorChooser(ColorChooserClient* client, const Color& color)
{
- notImplemented();
+ const QColor selectedColor = m_webPage->d->colorSelectionRequested(QColor(color));
+ client->didChooseColor(selectedColor);
+ client->didEndChooser();
return nullptr;
}
#endif
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index a7d7dc23e..af1fff6d4 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -191,7 +191,6 @@ public:
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return true; }
virtual void numWheelEventHandlersChanged(unsigned) { }
- virtual void numTouchEventHandlersChanged(unsigned) { }
QWebPage* m_webPage;
KURL lastHoverURL;
diff --git a/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h b/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
index 94b0f6531..726be157a 100644
--- a/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
@@ -39,7 +39,9 @@ class QGeoPositionInfoSource;
using namespace QtMobility;
#elif HAVE(QT5)
#include <QtLocation/QGeoPositionInfo>
+QT_BEGIN_NAMESPACE
class QGeoPositionInfoSource;
+QT_END_NAMESPACE
#endif
diff --git a/Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp b/Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp
index 7cfdabfc2..8bc0df497 100644
--- a/Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp
@@ -161,6 +161,20 @@ QStyle* RenderThemeQStyle::fallbackStyle() const
return (m_fallbackStyle) ? m_fallbackStyle : QApplication::style();
}
+void RenderThemeQStyle::setPaletteFromPageClientIfExists(QPalette& palette) const
+{
+ if (!m_page)
+ return;
+
+ ASSERT(m_page->chrome());
+ ChromeClient* chromeClient = m_page->chrome()->client();
+ if (!chromeClient)
+ return;
+
+ if (QWebPageClient* pageClient = chromeClient->platformPageClient())
+ palette = pageClient->palette();
+}
+
QStyle* RenderThemeQStyle::qStyle() const
{
if (m_page) {
@@ -432,6 +446,12 @@ void RenderThemeQStyle::setPopupPadding(RenderStyle* style) const
style->setPaddingBottom(Length(2, Fixed));
}
+QPalette RenderThemeQStyle::colorPalette() const
+{
+ QPalette palette = RenderThemeQt::colorPalette();
+ setPaletteFromPageClientIfExists(palette);
+ return palette;
+}
bool RenderThemeQStyle::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& r)
{
diff --git a/Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h b/Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h
index 7e8c26e91..2cc999308 100644
--- a/Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h
+++ b/Source/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h
@@ -97,6 +97,8 @@ protected:
virtual void setPopupPadding(RenderStyle*) const;
+ virtual QPalette colorPalette() const;
+
private:
ControlPart initializeCommonQStyleOptions(QStyleOption&, RenderObject*) const;
@@ -106,6 +108,8 @@ private:
QStyle* fallbackStyle() const;
+ void setPaletteFromPageClientIfExists(QPalette&) const;
+
#ifdef Q_OS_MAC
int m_buttonFontPixelSize;
#endif
diff --git a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
index 74bc2eccc..de06f4a84 100644
--- a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
+++ b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
@@ -28,8 +28,10 @@
#include <QVideoWidget>
#endif
+QT_BEGIN_NAMESPACE
class QListWidgetItem;
class QListWidget;
+QT_END_NAMESPACE
class Popup : public QDialog {
Q_OBJECT
diff --git a/Source/WebKit/win/COMEnumVariant.h b/Source/WebKit/win/COMEnumVariant.h
index 67251073f..40ab414dd 100644
--- a/Source/WebKit/win/COMEnumVariant.h
+++ b/Source/WebKit/win/COMEnumVariant.h
@@ -26,7 +26,9 @@
#ifndef COMEnumVariant_h
#define COMEnumVariant_h
+#ifndef NOMINMAX
#define NOMINMAX
+#endif
#include <unknwn.h>
diff --git a/Source/WebKit/win/COMPropertyBag.h b/Source/WebKit/win/COMPropertyBag.h
index dd0a8c42f..c76863f15 100644
--- a/Source/WebKit/win/COMPropertyBag.h
+++ b/Source/WebKit/win/COMPropertyBag.h
@@ -26,7 +26,9 @@
#ifndef COMPropertyBag_h
#define COMPropertyBag_h
+#ifndef NOMINMAX
#define NOMINMAX
+#endif
#include <ocidl.h>
#include <unknwn.h>
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index e836a123e..5eb1be3f8 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,21 @@
+2012-07-23 Patrick Gansterer <paroga@webkit.org>
+
+ Build fix if NOMINMAX is defined by the build system.
+
+ * COMEnumVariant.h: Added #ifndef NOMINMAX around #define NOMINMAX.
+ * COMPropertyBag.h: Ditto.
+
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove numTouchEventHandlersChanged stub.
+
+ * WebCoreSupport/WebChromeClient.h:
+
2012-07-17 Vivek Galatage <vivekgalatage@gmail.com>
Web Inspector: refactor InspectorController::connectFrontend() to accept InspectorFrontendChannel.
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
index f5559b0c9..9825922f5 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -172,7 +172,6 @@ public:
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return true; }
virtual void numWheelEventHandlersChanged(unsigned) { }
- virtual void numTouchEventHandlersChanged(unsigned) { }
private:
COMPtr<IWebUIDelegate> uiDelegate();
diff --git a/Source/WebKit/wince/ChangeLog b/Source/WebKit/wince/ChangeLog
index 714aefa2c..1b81b8549 100644
--- a/Source/WebKit/wince/ChangeLog
+++ b/Source/WebKit/wince/ChangeLog
@@ -1,3 +1,14 @@
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove numTouchEventHandlersChanged stub.
+
+ * WebCoreSupport/ChromeClientWinCE.h:
+
2012-07-17 Vivek Galatage <vivekgalatage@gmail.com>
Web Inspector: refactor InspectorController::connectFrontend() to accept InspectorFrontendChannel.
diff --git a/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h b/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
index 57c2f9388..00226d0c8 100644
--- a/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
+++ b/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
@@ -168,7 +168,6 @@ public:
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return true; }
virtual void numWheelEventHandlersChanged(unsigned) { }
- virtual void numTouchEventHandlersChanged(unsigned) { }
private:
WebView* m_webView;
diff --git a/Source/WebKit/wx/ChangeLog b/Source/WebKit/wx/ChangeLog
index 7e68e4a80..5af5a7eef 100644
--- a/Source/WebKit/wx/ChangeLog
+++ b/Source/WebKit/wx/ChangeLog
@@ -1,3 +1,14 @@
+2012-07-23 Pierre Rossi <pierre.rossi@gmail.com>
+
+ Unify numTouchEventHandlersChanged and needTouchEvents in the chrome client
+ https://bugs.webkit.org/show_bug.cgi?id=91006
+
+ Reviewed by Ryosuke Niwa.
+
+ Remove numTouchEventHandlersChanged stub.
+
+ * WebKitSupport/ChromeClientWx.h:
+
2012-07-17 Vivek Galatage <vivekgalatage@gmail.com>
Web Inspector: refactor InspectorController::connectFrontend() to accept InspectorFrontendChannel.
diff --git a/Source/WebKit/wx/WebKitSupport/ChromeClientWx.h b/Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
index c16948fbe..50540f094 100644
--- a/Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
+++ b/Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
@@ -145,7 +145,6 @@ public:
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return true; }
virtual void numWheelEventHandlersChanged(unsigned) { }
- virtual void numTouchEventHandlersChanged(unsigned) { }
virtual bool hasOpenedPopup() const;