- Revision
- 91572
- Author
- [email protected]
- Date
- 2011-07-22 10:31:04 -0700 (Fri, 22 Jul 2011)
Log Message
Source/WebKit/efl: [EFL] ewk_frame_hit_test_new enhancement
https://bugs.webkit.org/show_bug.cgi?id=64260
Replaces structure 'flags' with enum 'context' containing more hit test
result types and adds new char* fields to Ewk_Hit_Test structure:
image_uri and media_uri.
Patch by Michal Pakula vel Rutka <[email protected]> on 2011-07-22
Reviewed by Antonio Gomes.
* ewk/ewk_frame.cpp:
(ewk_frame_hit_test_free):
(ewk_frame_hit_test_new):
* ewk/ewk_frame.h:
Tools: [EFL] ewk_frame_hit_test_new enchancement
https://bugs.webkit.org/show_bug.cgi?id=64260
Apply changes done in ewk_frame_hit_test_new in EWebLauncher:
Replacing Ewk_Hit_Test_Result_Context structure 'flags'
in hit test output to by enum 'context'.
Patch by Michal Pakula vel Rutka <[email protected]> on 2011-07-22
Reviewed by Antonio Gomes.
* EWebLauncher/main.c:
(on_key_down):
Modified Paths
Diff
Modified: trunk/Source/WebKit/efl/ChangeLog (91571 => 91572)
--- trunk/Source/WebKit/efl/ChangeLog 2011-07-22 17:07:15 UTC (rev 91571)
+++ trunk/Source/WebKit/efl/ChangeLog 2011-07-22 17:31:04 UTC (rev 91572)
@@ -1,3 +1,19 @@
+2011-07-22 Michal Pakula vel Rutka <[email protected]>
+
+ [EFL] ewk_frame_hit_test_new enhancement
+ https://bugs.webkit.org/show_bug.cgi?id=64260
+
+ Replaces structure 'flags' with enum 'context' containing more hit test
+ result types and adds new char* fields to Ewk_Hit_Test structure:
+ image_uri and media_uri.
+
+ Reviewed by Antonio Gomes.
+
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_hit_test_free):
+ (ewk_frame_hit_test_new):
+ * ewk/ewk_frame.h:
+
2011-07-19 Gyuyoung Kim <[email protected]>
[EFL] Add ewk_network.cpp|h files.
Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (91571 => 91572)
--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp 2011-07-22 17:07:15 UTC (rev 91571)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp 2011-07-22 17:31:04 UTC (rev 91572)
@@ -982,6 +982,8 @@
eina_stringshare_del(hit_test->link.text);
eina_stringshare_del(hit_test->link.url);
eina_stringshare_del(hit_test->link.title);
+ eina_stringshare_del(hit_test->image_uri);
+ eina_stringshare_del(hit_test->media_uri);
free(hit_test);
}
@@ -1047,9 +1049,24 @@
hit_test->link.title = eina_stringshare_add(result.titleDisplayString().utf8().data());
hit_test->link.target_frame = kit(result.targetFrame());
- hit_test->flags.editable = result.isContentEditable();
- hit_test->flags.selected = result.isSelected();
+ hit_test->image_uri = eina_stringshare_add(result.absoluteImageURL().string().utf8().data());
+ hit_test->media_uri = eina_stringshare_add(result.absoluteMediaURL().string().utf8().data());
+ int context = EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT;
+
+ if (!result.absoluteLinkURL().isEmpty())
+ context |= EWK_HIT_TEST_RESULT_CONTEXT_LINK;
+ if (!result.absoluteImageURL().isEmpty())
+ context |= EWK_HIT_TEST_RESULT_CONTEXT_IMAGE;
+ if (!result.absoluteMediaURL().isEmpty())
+ context |= EWK_HIT_TEST_RESULT_CONTEXT_MEDIA;
+ if (result.isSelected())
+ context |= EWK_HIT_TEST_RESULT_CONTEXT_SELECTION;
+ if (result.isContentEditable())
+ context |= EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE;
+
+ hit_test->context = static_cast<Ewk_Hit_Test_Result_Context>(context);
+
return hit_test;
}
Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.h (91571 => 91572)
--- trunk/Source/WebKit/efl/ewk/ewk_frame.h 2011-07-22 17:07:15 UTC (rev 91571)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.h 2011-07-22 17:31:04 UTC (rev 91572)
@@ -104,6 +104,16 @@
const unsigned long identifier; /**< identifier of resource, can not be changed */
};
+/// Enum containing hit test data types
+typedef enum {
+ EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1,
+ EWK_HIT_TEST_RESULT_CONTEXT_LINK = 1 << 2,
+ EWK_HIT_TEST_RESULT_CONTEXT_IMAGE = 1 << 3,
+ EWK_HIT_TEST_RESULT_CONTEXT_MEDIA = 1 << 4,
+ EWK_HIT_TEST_RESULT_CONTEXT_SELECTION = 1 << 5,
+ EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE = 1 << 6
+} Ewk_Hit_Test_Result_Context;
+
/// Creates a type name for _Ewk_Hit_Test.
typedef struct _Ewk_Hit_Test Ewk_Hit_Test;
/// Structure used to report hit test result.
@@ -122,10 +132,10 @@
const char *title; /**< the title of link */
Evas_Object *target_frame;
} link;
- struct {
- Eina_Bool editable:1; /**< @c EINA_TRUE if element is editable, @c EINA_FALSE if not */
- Eina_Bool selected:1; /**< @c EINA_TRUE if element is selected, @c EINA_FALSE if not */
- } flags;
+ const char *image_uri;
+ const char *media_uri;
+
+ Ewk_Hit_Test_Result_Context context;
};
/// Represents actions of touch events.
Modified: trunk/Tools/ChangeLog (91571 => 91572)
--- trunk/Tools/ChangeLog 2011-07-22 17:07:15 UTC (rev 91571)
+++ trunk/Tools/ChangeLog 2011-07-22 17:31:04 UTC (rev 91572)
@@ -1,3 +1,17 @@
+2011-07-22 Michal Pakula vel Rutka <[email protected]>
+
+ [EFL] ewk_frame_hit_test_new enchancement
+ https://bugs.webkit.org/show_bug.cgi?id=64260
+
+ Apply changes done in ewk_frame_hit_test_new in EWebLauncher:
+ Replacing Ewk_Hit_Test_Result_Context structure 'flags'
+ in hit test output to by enum 'context'.
+
+ Reviewed by Antonio Gomes.
+
+ * EWebLauncher/main.c:
+ (on_key_down):
+
2011-07-21 Adam Roben <[email protected]>
Fix typo in TestFailures
Modified: trunk/Tools/EWebLauncher/main.c (91571 => 91572)
--- trunk/Tools/EWebLauncher/main.c 2011-07-22 17:07:15 UTC (rev 91571)
+++ trunk/Tools/EWebLauncher/main.c 2011-07-22 17:31:04 UTC (rev 91572)
@@ -554,10 +554,12 @@
" title='%s'\n"
" target frame=%p (%s)\n"
" }\n"
- " flags {\n"
- " editable=%hhu\n"
- " selected=%hhu\n"
- " }\n",
+ "context:\n"
+ "%s"
+ "%s"
+ "%s"
+ "%s"
+ "%s\n",
x, y,
ht->x, ht->y,
ht->bounding_box.x, ht->bounding_box.y, ht->bounding_box.w, ht->bounding_box.h,
@@ -568,8 +570,11 @@
ht->link.url,
ht->link.title,
ht->link.target_frame, evas_object_name_get(ht->link.target_frame),
- ht->flags.editable,
- ht->flags.selected);
+ ht->context & EWK_HIT_TEST_RESULT_CONTEXT_LINK ? " LINK\n" : "",
+ ht->context & EWK_HIT_TEST_RESULT_CONTEXT_IMAGE ? " IMAGE\n" : "",
+ ht->context & EWK_HIT_TEST_RESULT_CONTEXT_MEDIA ? " MEDIA\n" : "",
+ ht->context & EWK_HIT_TEST_RESULT_CONTEXT_SELECTION ? " SELECTION\n" : "",
+ ht->context & EWK_HIT_TEST_RESULT_CONTEXT_EDITABLE ? " EDITABLE" : "");
ewk_frame_hit_test_free(ht);
}