Diff
Modified: trunk/Source/WebKit/efl/ChangeLog (118328 => 118329)
--- trunk/Source/WebKit/efl/ChangeLog 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Source/WebKit/efl/ChangeLog 2012-05-24 07:03:15 UTC (rev 118329)
@@ -1,3 +1,35 @@
+2012-05-24 Christophe Dumez <[email protected]>
+
+ [EFL] The EFL port has no support for title directionality
+ https://bugs.webkit.org/show_bug.cgi?id=86462
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Define a new Ewk_Text_With_Direction type to store the direction of
+ the text along with the text itself. This is needed to support text
+ directionality in EFL port.
+
+ Use the new Ewk_Text_With_Direction type for the frame title. Updated
+ "title,changed" signal, title getter/setter and Ewk_Hit_Test struct.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::dispatchDidReceiveTitle):
+ * ewk/ewk_frame.cpp:
+ (Ewk_Frame_Smart_Data):
+ (_ewk_frame_smart_del):
+ (ewk_frame_title_get):
+ (ewk_frame_hit_test_free):
+ (ewk_frame_hit_test_new):
+ (ewk_frame_title_set):
+ * ewk/ewk_frame.h:
+ * ewk/ewk_frame_private.h:
+ * ewk/ewk_view.cpp:
+ (_Ewk_View_Private_Data):
+ (ewk_view_title_get):
+ (ewk_view_title_set):
+ * ewk/ewk_view.h:
+ * ewk/ewk_view_private.h:
+
2012-05-23 Christophe Dumez <[email protected]>
[EFL] EFL's DRT does not print didFailProvisionalLoadWithError messages
Modified: trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp (118328 => 118329)
--- trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp 2012-05-24 07:03:15 UTC (rev 118329)
@@ -616,13 +616,15 @@
void FrameLoaderClientEfl::dispatchDidReceiveTitle(const StringWithDirection& title)
{
- // FIXME: use direction of title.
+ Ewk_Text_With_Direction ewkTitle;
CString cs = title.string().utf8();
- ewk_frame_title_set(m_frame, cs.data());
+ ewkTitle.string = cs.data();
+ ewkTitle.direction = (title.direction() == LTR) ? EWK_TEXT_DIRECTION_LEFT_TO_RIGHT : EWK_TEXT_DIRECTION_RIGHT_TO_LEFT;
+ ewk_frame_title_set(m_frame, &ewkTitle);
if (ewk_view_frame_main_get(m_view) != m_frame)
return;
- ewk_view_title_set(m_view, cs.data());
+ ewk_view_title_set(m_view, &ewkTitle);
}
void FrameLoaderClientEfl::dispatchDidChangeIcons(WebCore::IconType iconType)
Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (118328 => 118329)
--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp 2012-05-24 07:03:15 UTC (rev 118329)
@@ -74,7 +74,7 @@
Evas_Object* region;
#endif
WebCore::Frame* frame;
- const char* title;
+ Ewk_Text_With_Direction title;
const char* uri;
const char* name;
bool editable : 1;
@@ -240,7 +240,7 @@
smartData->frame = 0;
}
- eina_stringshare_del(smartData->title);
+ eina_stringshare_del(smartData->title.string);
eina_stringshare_del(smartData->uri);
eina_stringshare_del(smartData->name);
}
@@ -343,10 +343,10 @@
return smartData->uri;
}
-const char* ewk_frame_title_get(const Evas_Object* ewkFrame)
+const Ewk_Text_With_Direction* ewk_frame_title_get(const Evas_Object* ewkFrame)
{
EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, 0);
- return smartData->title;
+ return &smartData->title;
}
const char* ewk_frame_name_get(const Evas_Object* ewkFrame)
@@ -668,7 +668,7 @@
void ewk_frame_hit_test_free(Ewk_Hit_Test* hitTest)
{
EINA_SAFETY_ON_NULL_RETURN(hitTest);
- eina_stringshare_del(hitTest->title);
+ eina_stringshare_del(hitTest->title.string);
eina_stringshare_del(hitTest->alternate_text);
eina_stringshare_del(hitTest->link.text);
eina_stringshare_del(hitTest->link.url);
@@ -713,7 +713,8 @@
#endif
WebCore::TextDirection direction;
- hitTest->title = eina_stringshare_add(result.title(direction).utf8().data());
+ hitTest->title.string = eina_stringshare_add(result.title(direction).utf8().data());
+ hitTest->title.direction = (direction == WebCore::LTR) ? EWK_TEXT_DIRECTION_LEFT_TO_RIGHT : EWK_TEXT_DIRECTION_RIGHT_TO_LEFT;
hitTest->alternate_text = eina_stringshare_add(result.altDisplayString().utf8().data());
if (result.innerNonSharedNode() && result.innerNonSharedNode()->document()
&& result.innerNonSharedNode()->document()->frame())
@@ -1572,13 +1573,14 @@
*
* Reports title changed.
*/
-void ewk_frame_title_set(Evas_Object* ewkFrame, const char* title)
+void ewk_frame_title_set(Evas_Object* ewkFrame, const Ewk_Text_With_Direction* title)
{
- DBG("ewkFrame=%p, title=%s", ewkFrame, title ? title : "(null)");
+ DBG("ewkFrame=%p, title=%s", ewkFrame, title->string ? title->string : "(null)");
EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData);
- if (!eina_stringshare_replace(&smartData->title, title))
+ if (!eina_stringshare_replace(&smartData->title.string, title->string))
return;
- evas_object_smart_callback_call(ewkFrame, "title,changed", (void*)smartData->title);
+ smartData->title.direction = title->direction;
+ evas_object_smart_callback_call(ewkFrame, "title,changed", (void*)title);
}
/**
Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.h (118328 => 118329)
--- trunk/Source/WebKit/efl/ewk/ewk_frame.h 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.h 2012-05-24 07:03:15 UTC (rev 118329)
@@ -73,7 +73,7 @@
* - "resource,response,received", Ewk_Frame_Resource_Response*: reports that a response
* to a resource request was received.
* - "state,save", void: frame's state will be saved as a history item.
- * - "title,changed", const char*: title of the main frame was changed.
+ * - "title,changed", Ewk_Text_With_Direction*: title of the main frame was changed.
* - "uri,changed", const char*: uri of the main frame was changed.
* - "xss,detected", Ewk_Frame_Xss_Notification*: reflected XSS is encountered in the page and suppressed.
*/
@@ -152,6 +152,21 @@
Ewk_Frame_Resource_Response *redirect_response; /**< redirect response, can not be changed */
};
+/// Enum containing text directionality values.
+typedef enum {
+ EWK_TEXT_DIRECTION_DEFAULT, /**< Natural writing direction ("inherit") */
+ EWK_TEXT_DIRECTION_LEFT_TO_RIGHT,
+ EWK_TEXT_DIRECTION_RIGHT_TO_LEFT
+} Ewk_Text_Direction;
+
+/// Creates a type name for Ewk_Text_With_Direction.
+typedef struct _Ewk_Text_With_Direction Ewk_Text_With_Direction;
+
+struct _Ewk_Text_With_Direction {
+ const char *string;
+ Ewk_Text_Direction direction;
+};
+
/// Creates a type name for Ewk_Frame_Xss_Notification.
typedef struct _Ewk_Frame_Xss_Notification Ewk_Frame_Xss_Notification;
@@ -196,7 +211,7 @@
struct {
int x, y, w, h;
} bounding_box; /**< DEPRECATED, see ewk_frame_hit_test_new() */
- const char *title; /**< title of the element */
+ Ewk_Text_With_Direction title; /**< title of the element */
const char *alternate_text; /**< the alternate text for image, area, input and applet */
Evas_Object *frame; /**< the pointer to frame where hit test was requested */
struct {
@@ -351,7 +366,7 @@
*
* @return frame title on success or @c 0 on failure
*/
-EAPI const char *ewk_frame_title_get(const Evas_Object *o);
+EAPI const Ewk_Text_With_Direction *ewk_frame_title_get(const Evas_Object *o);
/**
* Gets the name of this frame.
Modified: trunk/Source/WebKit/efl/ewk/ewk_frame_private.h (118328 => 118329)
--- trunk/Source/WebKit/efl/ewk/ewk_frame_private.h 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame_private.h 2012-05-24 07:03:15 UTC (rev 118329)
@@ -63,7 +63,7 @@
void ewk_frame_did_perform_first_navigation(Evas_Object* ewkFrame);
void ewk_frame_contents_size_changed(Evas_Object* ewkFrame, Evas_Coord width, Evas_Coord height);
-void ewk_frame_title_set(Evas_Object* ewkFrame, const char* title);
+void ewk_frame_title_set(Evas_Object* ewkFrame, const Ewk_Text_With_Direction* title);
void ewk_frame_view_create_for_view(Evas_Object* ewkFrame, Evas_Object* view);
bool ewk_frame_uri_changed(Evas_Object* ewkFrame);
Modified: trunk/Source/WebKit/efl/ewk/ewk_view.cpp (118328 => 118329)
--- trunk/Source/WebKit/efl/ewk/ewk_view.cpp 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.cpp 2012-05-24 07:03:15 UTC (rev 118329)
@@ -1404,7 +1404,7 @@
return ewk_frame_uri_get(smartData->main_frame);
}
-const char* ewk_view_title_get(const Evas_Object* ewkView)
+const Ewk_Text_With_Direction* ewk_view_title_get(const Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
return ewk_frame_title_get(smartData->main_frame);
@@ -2953,9 +2953,9 @@
*
* Emits signal: "title,changed" with pointer to new title string.
*/
-void ewk_view_title_set(Evas_Object* ewkView, const char* title)
+void ewk_view_title_set(Evas_Object* ewkView, const Ewk_Text_With_Direction* title)
{
- DBG("ewkView=%p, title=%s", ewkView, title ? title : "(null)");
+ DBG("ewkView=%p, title=%s", ewkView, (title && title->string) ? title->string : "(null)");
evas_object_smart_callback_call(ewkView, "title,changed", (void*)title);
}
Modified: trunk/Source/WebKit/efl/ewk/ewk_view.h (118328 => 118329)
--- trunk/Source/WebKit/efl/ewk/ewk_view.h 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.h 2012-05-24 07:03:15 UTC (rev 118329)
@@ -86,7 +86,7 @@
* - "statusbar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if statusbar is
* visible; @c EINA_FALSE, otherwise.
* - "statusbar,visible,set", Eina_Bool: sets statusbar visibility.
- * - "title,changed", const char*: title of the main frame was changed.
+ * - "title,changed", Ewk_Text_With_Direction*: title of the main frame was changed.
* - "toolbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if toolbar
* is visible; @c EINA_FALSE, otherwise.
* - "toolbars,visible,set", Eina_Bool: sets toolbar visibility.
@@ -751,7 +751,7 @@
*
* @return current title on success or @c 0 on failure
*/
-EAPI const char *ewk_view_title_get(const Evas_Object *o);
+EAPI const Ewk_Text_With_Direction *ewk_view_title_get(const Evas_Object *o);
/**
* Queries if the main frame is editable.
Modified: trunk/Source/WebKit/efl/ewk/ewk_view_private.h (118328 => 118329)
--- trunk/Source/WebKit/efl/ewk/ewk_view_private.h 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Source/WebKit/efl/ewk/ewk_view_private.h 2012-05-24 07:03:15 UTC (rev 118329)
@@ -49,7 +49,7 @@
void ewk_view_ready(Evas_Object* ewkView);
void ewk_view_input_method_state_set(Evas_Object* ewkView, bool active);
-void ewk_view_title_set(Evas_Object* ewkView, const char* title);
+void ewk_view_title_set(Evas_Object* ewkView, const Ewk_Text_With_Direction* title);
void ewk_view_uri_changed(Evas_Object* ewkView);
void ewk_view_load_document_finished(Evas_Object* ewkView, Evas_Object* frame);
void ewk_view_load_started(Evas_Object* ewkView, Evas_Object* ewkFrame);
Modified: trunk/Tools/ChangeLog (118328 => 118329)
--- trunk/Tools/ChangeLog 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Tools/ChangeLog 2012-05-24 07:03:15 UTC (rev 118329)
@@ -1,3 +1,21 @@
+2012-05-24 Christophe Dumez <[email protected]>
+
+ [EFL] The EFL port has no support for title directionality
+ https://bugs.webkit.org/show_bug.cgi?id=86462
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Update "title,changed" signal handlers in DRT and EWebLauncher to
+ reflect the change from const char* to Ewk_Text_With_Direction* type
+ for the title.
+
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+ (DumpRenderTreeChrome::onTitleChanged):
+ * EWebLauncher/main.c:
+ (title_set):
+ (on_title_changed):
+ (on_key_down):
+
2012-05-23 Gyuyoung Kim <[email protected]>
Change EFL debug build name with more detail one
Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp (118328 => 118329)
--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp 2012-05-24 07:03:15 UTC (rev 118329)
@@ -431,15 +431,15 @@
void DumpRenderTreeChrome::onFrameTitleChanged(void*, Evas_Object* frame, void* eventInfo)
{
- const char* titleText = static_cast<const char*>(eventInfo);
+ const Ewk_Text_With_Direction* titleText = static_cast<const Ewk_Text_With_Direction*>(eventInfo);
if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame));
- printf("%s - didReceiveTitle: %s\n", frameName.utf8().data(), titleText);
+ printf("%s - didReceiveTitle: %s\n", frameName.utf8().data(), (titleText && titleText->string) ? titleText->string : "");
}
if (!done && gLayoutTestController->dumpTitleChanges())
- printf("TITLE CHANGED: %s\n", titleText);
+ printf("TITLE CHANGED: %s\n", (titleText && titleText->string) ? titleText->string : "");
}
void DumpRenderTreeChrome::onDocumentLoadFinished(void*, Evas_Object*, void* eventInfo)
Modified: trunk/Tools/EWebLauncher/main.c (118328 => 118329)
--- trunk/Tools/EWebLauncher/main.c 2012-05-24 07:00:24 UTC (rev 118328)
+++ trunk/Tools/EWebLauncher/main.c 2012-05-24 07:03:15 UTC (rev 118329)
@@ -229,22 +229,22 @@
}
static void
-title_set(Ecore_Evas *ee, const char *title, int progress)
+title_set(Ecore_Evas *ee, const Ewk_Text_With_Direction *title, int progress)
{
const char *appname = "EFL Test Launcher";
const char *separator = " - ";
char label[4096];
int size;
- if (!title || !strcmp(title, "")) {
+ if (!title || !title->string || !strcmp(title->string, "")) {
ecore_evas_title_set(ee, appname);
return;
}
if (progress < 100)
- size = snprintf(label, sizeof(label), "%s (%d%%)%s%s", title, progress, separator, appname);
+ size = snprintf(label, sizeof(label), "%s (%d%%)%s%s", title->string, progress, separator, appname);
else
- size = snprintf(label, sizeof(label), "%s %s%s", title, separator, appname);
+ size = snprintf(label, sizeof(label), "%s %s%s", title->string, separator, appname);
if (size >= (int)sizeof(label))
return;
@@ -256,7 +256,7 @@
on_title_changed(void *user_data, Evas_Object *webview, void *event_info)
{
ELauncher *app = (ELauncher *)user_data;
- const char *title = (const char *)event_info;
+ const Ewk_Text_With_Direction *title = (const Ewk_Text_With_Direction *)event_info;
title_set(app->ee, title, 100);
}
@@ -492,7 +492,7 @@
x, y,
ht->x, ht->y,
ht->bounding_box.x, ht->bounding_box.y, ht->bounding_box.w, ht->bounding_box.h,
- ht->title,
+ ht->title.string,
ht->alternate_text,
ht->frame, evas_object_name_get(ht->frame),
ht->link.text,