WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
new patch correcting the ChangeLog
0001-GTK-Expose-HitTestResult-scrollbar-condition-in-API.patch (text/plain), 14.45 KB, created by
Eduardo Lima Mitev
on 2012-12-10 07:43:10 PST
(
hide
)
Description:
new patch correcting the ChangeLog
Filename:
MIME Type:
Creator:
Eduardo Lima Mitev
Created:
2012-12-10 07:43:10 PST
Size:
14.45 KB
patch
obsolete
>From def5c2fb5a5b9fa789d5b699545fde5d73c3c272 Mon Sep 17 00:00:00 2001 >From: Eduardo Lima Mitev <elima@igalia.com> >Date: Fri, 7 Dec 2012 18:37:03 +0100 >Subject: [PATCH] [GTK] Expose HitTestResult::scrollbar() condition in API > https://bugs.webkit.org/show_bug.cgi?id=104369 > >Reviewed by NOBODY (OOPS!). > >This patch populates WebCore::HitTestResult::scrollbar() condition >in WebKitHitTestResult public API, and includes a corresponding unit >test. > >* Shared/WebHitTestResult.cpp: Adds new isScrollbar member to > encoding and decoding methods to carry the scrollbar condition > from Web process to UI process. >(WebKit::WebHitTestResult::Data::encode): >(WebKit::WebHitTestResult::Data::decode): >* Shared/WebHitTestResult.h: Adds new bool member isScrollbar and > initializes it from WebCore::HitTestResult::scrollbar(). >(Data): >(WebKit::WebHitTestResult::Data::Data): >(WebKit::WebHitTestResult::isScrollbar): >(WebHitTestResult): >* UIProcess/API/gtk/WebKitHitTestResult.cpp: Adds scrollbar condition > to context upon initialization of WebKitHitTestResult and adds > corresponding public accessor context_is_scrollbar(). >(webkitHitTestResultCreate): >(webkitHitTestResultCompare): >(webkit_hit_test_result_context_is_scrollbar): >* UIProcess/API/gtk/WebKitHitTestResult.h: Adds new flag > WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR to > WebKitHitTestResultContext enum. >* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Adds new API symbol > to the corresponding documentation sections. >* UIProcess/API/gtk/tests/TestWebKitWebView.cpp: Updates mouse-target > test to include assertions for hitting scrollbar condition, and > an new HTML to privide a positive case. >(testWebViewMouseTarget): >--- > Source/WebKit2/ChangeLog | 38 ++++++++++++++++++++ > Source/WebKit2/Shared/WebHitTestResult.cpp | 4 ++- > Source/WebKit2/Shared/WebHitTestResult.h | 4 +++ > .../UIProcess/API/gtk/WebKitHitTestResult.cpp | 21 +++++++++++ > .../UIProcess/API/gtk/WebKitHitTestResult.h | 15 +++++--- > .../UIProcess/API/gtk/docs/webkit2gtk-sections.txt | 1 + > .../UIProcess/API/gtk/tests/TestWebKitWebView.cpp | 14 ++++++++ > 7 files changed, 91 insertions(+), 6 deletions(-) > >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 13b1422..6cec1e4 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,41 @@ >+2012-12-07 Eduardo Lima Mitev <elima@igalia.com> >+ >+ [GTK] Expose HitTestResult::scrollbar() condition in API >+ https://bugs.webkit.org/show_bug.cgi?id=104369 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch populates WebCore::HitTestResult::scrollbar() condition >+ in WebKitHitTestResult public API, and includes a corresponding unit >+ test. >+ >+ * Shared/WebHitTestResult.cpp: Adds new isScrollbar member to >+ encoding and decoding methods to carry the scrollbar condition >+ from Web process to UI process. >+ (WebKit::WebHitTestResult::Data::encode): >+ (WebKit::WebHitTestResult::Data::decode): >+ * Shared/WebHitTestResult.h: Adds new bool member isScrollbar and >+ initializes it from WebCore::HitTestResult::scrollbar(). >+ (Data): >+ (WebKit::WebHitTestResult::Data::Data): >+ (WebKit::WebHitTestResult::isScrollbar): >+ (WebHitTestResult): >+ * UIProcess/API/gtk/WebKitHitTestResult.cpp: Adds scrollbar condition >+ to context upon initialization of WebKitHitTestResult and adds >+ corresponding public accessor context_is_scrollbar(). >+ (webkitHitTestResultCreate): >+ (webkitHitTestResultCompare): >+ (webkit_hit_test_result_context_is_scrollbar): >+ * UIProcess/API/gtk/WebKitHitTestResult.h: Adds new flag >+ WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR to >+ WebKitHitTestResultContext enum. >+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Adds new API symbol >+ to the corresponding documentation sections. >+ * UIProcess/API/gtk/tests/TestWebKitWebView.cpp: Updates mouse-target >+ test to include assertions for hitting scrollbar condition, and >+ an new HTML to privide a positive case. >+ (testWebViewMouseTarget): >+ > 2012-12-10 Simon Hausmann <simon.hausmann@digia.com> > > [Qt] Fix build without QtQuick 2 >diff --git a/Source/WebKit2/Shared/WebHitTestResult.cpp b/Source/WebKit2/Shared/WebHitTestResult.cpp >index c2f054e..1bcf951 100644 >--- a/Source/WebKit2/Shared/WebHitTestResult.cpp >+++ b/Source/WebKit2/Shared/WebHitTestResult.cpp >@@ -44,6 +44,7 @@ void WebHitTestResult::Data::encode(CoreIPC::ArgumentEncoder& encoder) const > encoder << linkTitle; > encoder << isContentEditable; > encoder << elementBoundingBox; >+ encoder << isScrollbar; > } > > bool WebHitTestResult::Data::decode(CoreIPC::ArgumentDecoder* decoder, WebHitTestResult::Data& hitTestResultData) >@@ -55,7 +56,8 @@ bool WebHitTestResult::Data::decode(CoreIPC::ArgumentDecoder* decoder, WebHitTes > || !decoder->decode(hitTestResultData.linkLabel) > || !decoder->decode(hitTestResultData.linkTitle) > || !decoder->decode(hitTestResultData.isContentEditable) >- || !decoder->decode(hitTestResultData.elementBoundingBox)) >+ || !decoder->decode(hitTestResultData.elementBoundingBox) >+ || !decoder->decode(hitTestResultData.isScrollbar)) > return false; > > return true; >diff --git a/Source/WebKit2/Shared/WebHitTestResult.h b/Source/WebKit2/Shared/WebHitTestResult.h >index 739050e..7e6e0a9 100644 >--- a/Source/WebKit2/Shared/WebHitTestResult.h >+++ b/Source/WebKit2/Shared/WebHitTestResult.h >@@ -52,6 +52,7 @@ public: > String linkTitle; > bool isContentEditable; > WebCore::IntRect elementBoundingBox; >+ bool isScrollbar; > > Data() > { >@@ -83,6 +84,7 @@ public: > , linkTitle(hitTestResult.titleDisplayString()) > , isContentEditable(hitTestResult.isContentEditable()) > , elementBoundingBox(elementBoundingBoxInWindowCoordinates(hitTestResult)) >+ , isScrollbar(hitTestResult.scrollbar()) > { > } > >@@ -104,6 +106,8 @@ public: > > WebCore::IntRect elementBoundingBox() const { return m_data.elementBoundingBox; } > >+ bool isScrollbar() const { return m_data.isScrollbar; } >+ > private: > explicit WebHitTestResult(const WebHitTestResult::Data& hitTestResultData) > : m_data(hitTestResultData) >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp >index 8df293c..918d316 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp >@@ -240,6 +240,9 @@ WebKitHitTestResult* webkitHitTestResultCreate(WebHitTestResult* hitTestResult) > if (hitTestResult->isContentEditable()) > context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE; > >+ if (hitTestResult->isScrollbar()) >+ context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR; >+ > const String& linkTitle = hitTestResult->linkTitle(); > const String& linkLabel = hitTestResult->linkLabel(); > >@@ -262,6 +265,7 @@ bool webkitHitTestResultCompare(WebKitHitTestResult* hitTestResult, WebHitTestRe > { > WebKitHitTestResultPrivate* priv = hitTestResult->priv; > return webHitTestResult->isContentEditable() == webkit_hit_test_result_context_is_editable(hitTestResult) >+ && webHitTestResult->isScrollbar() == webkit_hit_test_result_context_is_scrollbar(hitTestResult) > && stringIsEqualToCString(webHitTestResult->absoluteLinkURL(), priv->linkURI) > && stringIsEqualToCString(webHitTestResult->linkTitle(), priv->linkTitle) > && stringIsEqualToCString(webHitTestResult->linkLabel(), priv->linkLabel) >@@ -433,3 +437,20 @@ const gchar* webkit_hit_test_result_get_media_uri(WebKitHitTestResult* hitTestRe > > return hitTestResult->priv->mediaURI.data(); > } >+ >+/** >+ * webkit_hit_test_result_context_is_scrollbar: >+ * @hit_test_result: a #WebKitHitTestResult >+ * >+ * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR flag is present in >+ * #WebKitHitTestResult:context. >+ * >+ * Returns: %TRUE if there's a scrollbar element at the coordinates of the @hit_test_result, >+ * or %FALSE otherwise >+ */ >+gboolean webkit_hit_test_result_context_is_scrollbar(WebKitHitTestResult* hitTestResult) >+{ >+ g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE); >+ >+ return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR; >+} >diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h >index 01e66c9..7451e4b 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h >+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h >@@ -47,16 +47,18 @@ typedef struct _WebKitHitTestResultPrivate WebKitHitTestResultPrivate; > * @WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE: an image element. > * @WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA: a video or audio element. > * @WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE: an editable element >+ * @WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR: a scrollbar element. > * > * Enum values with flags representing the context of a #WebKitHitTestResult. > */ > typedef enum > { >- WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1, >- WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK = 1 << 2, >- WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE = 1 << 3, >- WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA = 1 << 4, >- WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE = 1 << 5 >+ WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1, >+ WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK = 1 << 2, >+ WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE = 1 << 3, >+ WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA = 1 << 4, >+ WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE = 1 << 5, >+ WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR = 1 << 6 > } WebKitHitTestResultContext; > > struct _WebKitHitTestResult { >@@ -102,6 +104,9 @@ webkit_hit_test_result_get_image_uri (WebKitHitTestResult *hit_test_resul > WEBKIT_API const gchar * > webkit_hit_test_result_get_media_uri (WebKitHitTestResult *hit_test_result); > >+WEBKIT_API gboolean >+webkit_hit_test_result_context_is_scrollbar (WebKitHitTestResult *hit_test_result); >+ > G_END_DECLS > > #endif >diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt >index 2f6f54b..b7c9548 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt >+++ b/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt >@@ -526,6 +526,7 @@ webkit_hit_test_result_get_link_title > webkit_hit_test_result_get_link_label > webkit_hit_test_result_get_image_uri > webkit_hit_test_result_get_media_uri >+webkit_hit_test_result_context_is_scrollbar > > <SUBSECTION Standard> > WebKitHitTestResultClass >diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp >index 08cdbe8..ea5e404 100644 >--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp >+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp >@@ -481,6 +481,7 @@ static void testWebViewMouseTarget(UIClientTest* test, gconstpointer) > " <a style='position:absolute; left:1; top:20' href='http://www.webkitgtk.org/logo' title='WebKitGTK+ Logo'><img src='0xdeadbeef' width=5 height=5></img></a>" > " <video style='position:absolute; left:1; top:30' width=10 height=10 controls='controls'><source src='movie.ogg' type='video/ogg' /></video>" > " <input style='position:absolute; left:1; top:50' size='10'></input>" >+ " <div style='position:absolute; left:1; top:70; width:30; height:30; overflow:scroll'> </div>" > "</body></html>"; > > test->loadHtml(linksHoveredHTML, "file:///"); >@@ -511,6 +512,7 @@ static void testWebViewMouseTarget(UIClientTest* test, gconstpointer) > g_assert(webkit_hit_test_result_context_is_image(hitTestResult)); > g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); > g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); > g_assert_cmpstr(webkit_hit_test_result_get_image_uri(hitTestResult), ==, "file:///0xdeadbeef"); > g_assert(test->m_mouseTargetModifiers & GDK_CONTROL_MASK); > >@@ -520,6 +522,7 @@ static void testWebViewMouseTarget(UIClientTest* test, gconstpointer) > g_assert(webkit_hit_test_result_context_is_image(hitTestResult)); > g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); > g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); > g_assert_cmpstr(webkit_hit_test_result_get_link_uri(hitTestResult), ==, "http://www.webkitgtk.org/logo"); > g_assert_cmpstr(webkit_hit_test_result_get_image_uri(hitTestResult), ==, "file:///0xdeadbeef"); > g_assert_cmpstr(webkit_hit_test_result_get_link_title(hitTestResult), ==, "WebKitGTK+ Logo"); >@@ -532,6 +535,7 @@ static void testWebViewMouseTarget(UIClientTest* test, gconstpointer) > g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); > g_assert(webkit_hit_test_result_context_is_media(hitTestResult)); > g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); > g_assert_cmpstr(webkit_hit_test_result_get_media_uri(hitTestResult), ==, "file:///movie.ogg"); > g_assert(!test->m_mouseTargetModifiers); > >@@ -540,8 +544,18 @@ static void testWebViewMouseTarget(UIClientTest* test, gconstpointer) > g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); > g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); > g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); > g_assert(webkit_hit_test_result_context_is_editable(hitTestResult)); > g_assert(!test->m_mouseTargetModifiers); >+ >+ // Move over scrollbar. >+ hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(5, 95); >+ g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert(webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >+ g_assert(!test->m_mouseTargetModifiers); > } > > static void testWebViewPermissionRequests(UIClientTest* test, gconstpointer) >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 104369
:
178221
|
178234
|
178550
|
178594