Title: [93813] trunk/Source/WebKit/efl
Revision
93813
Author
commit-qu...@webkit.org
Date
2011-08-25 13:21:40 -0700 (Thu, 25 Aug 2011)

Log Message

[EFL] Implement FrameLoaderClient::didTransferChildFrameToNewDocument
https://bugs.webkit.org/show_bug.cgi?id=66690

Patch by Raphael Kubo da Costa <k...@profusion.mobi> on 2011-08-25
Reviewed by Antonio Gomes.

The implementation is mostly based on the GTK+ port's, as we just need
to transfer the ownership of the frame to a new view and adjust the
smart object part accordingly.

This should help make fast/frames/iframe-reparenting-adopt-node.html
pass.

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::didTransferChildFrameToNewDocument):
* ewk/ewk_frame.cpp:
(ewk_frame_view_set):
(ewk_frame_view_create_for_view):
* ewk/ewk_private.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (93812 => 93813)


--- trunk/Source/WebKit/efl/ChangeLog	2011-08-25 19:57:23 UTC (rev 93812)
+++ trunk/Source/WebKit/efl/ChangeLog	2011-08-25 20:21:40 UTC (rev 93813)
@@ -1,3 +1,24 @@
+2011-08-25  Raphael Kubo da Costa  <k...@profusion.mobi>
+
+        [EFL] Implement FrameLoaderClient::didTransferChildFrameToNewDocument
+        https://bugs.webkit.org/show_bug.cgi?id=66690
+
+        Reviewed by Antonio Gomes.
+
+        The implementation is mostly based on the GTK+ port's, as we just need
+        to transfer the ownership of the frame to a new view and adjust the
+        smart object part accordingly.
+
+        This should help make fast/frames/iframe-reparenting-adopt-node.html
+        pass.
+
+        * WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore::FrameLoaderClientEfl::didTransferChildFrameToNewDocument):
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_view_set):
+        (ewk_frame_view_create_for_view):
+        * ewk/ewk_private.h:
+
 2011-08-24  Jaehun Lim  <ljaehun....@samsung.com>
 
         [EFL] Add dummy IconDatabaseClientEfl.

Modified: trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp (93812 => 93813)


--- trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp	2011-08-25 19:57:23 UTC (rev 93812)
+++ trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp	2011-08-25 20:21:40 UTC (rev 93813)
@@ -362,6 +362,22 @@
 
 void FrameLoaderClientEfl::didTransferChildFrameToNewDocument(Page*)
 {
+    ASSERT(m_frame);
+
+    Frame* currentFrame = ewk_frame_core_get(m_frame);
+    Evas_Object* currentView = ewk_frame_view_get(m_frame);
+    Frame* parentFrame = currentFrame->tree()->parent();
+
+    FrameLoaderClientEfl* client = static_cast<FrameLoaderClientEfl*>(parentFrame->loader()->client());
+    Evas_Object* clientFrame = client ? client->webFrame() : 0;
+    Evas_Object* clientView = ewk_frame_view_get(clientFrame);
+
+    if (currentView != clientView) {
+        ewk_frame_view_set(m_frame, clientView);
+        m_view = clientView;
+    }
+
+    ASSERT(ewk_view_core_page_get(ewk_frame_view_get(m_frame)) == currentFrame->page());
 }
 
 void FrameLoaderClientEfl::transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*)

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (93812 => 93813)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2011-08-25 19:57:23 UTC (rev 93812)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2011-08-25 20:21:40 UTC (rev 93813)
@@ -1181,6 +1181,23 @@
 
 /**
  * @internal
+ * Change the ewk view this frame is associated with.
+ *
+ * @param o The ewk frame to act upon.
+ * @param newParent The new view that will be set as the parent of the frame.
+ */
+void ewk_frame_view_set(Evas_Object* o, Evas_Object* newParent)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+
+    evas_object_smart_member_del(o);
+    evas_object_smart_member_add(o, newParent);
+
+    sd->view = newParent;
+}
+
+/**
+ * @internal
  * Frame was destroyed by loader, remove internal reference.
  */
 void ewk_frame_core_gone(Evas_Object *o)
@@ -1460,9 +1477,6 @@
     EINA_SAFETY_ON_NULL_RETURN(sd->frame);
     Evas_Coord w, h;
 
-    if (sd->frame->view())
-        return;
-
     evas_object_geometry_get(view, 0, 0, &w, &h);
 
     WebCore::IntSize size(w, h);

Modified: trunk/Source/WebKit/efl/ewk/ewk_private.h (93812 => 93813)


--- trunk/Source/WebKit/efl/ewk/ewk_private.h	2011-08-25 19:57:23 UTC (rev 93812)
+++ trunk/Source/WebKit/efl/ewk/ewk_private.h	2011-08-25 20:21:40 UTC (rev 93813)
@@ -179,6 +179,7 @@
 Evas_Object *ewk_frame_add(Evas *e);
 Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame);
 Eina_Bool ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String &name, const WebCore::KURL &url, const WTF::String &referrer);
+void ewk_frame_view_set(Evas_Object *o, Evas_Object *newParent);
 
 WebCore::Frame *ewk_frame_core_get(const Evas_Object *o);
 void ewk_frame_core_gone(Evas_Object *o);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to