Reviewed by Xan Lopez.
[GTK] WebKitWebFrame can return a stale frame name when calling webkit_web_frame_get_name
https://bugs.webkit.org/show_bug.cgi?id=53797
* platform/gtk/Skipped: Unskip a test which is now passing.
2011-02-04 Martin Robinson <mrobinson@igalia.com>
Reviewed by Xan Lopez.
[GTK] WebKitWebFrame can return a stale frame name when calling webkit_web_frame_get_name
https://bugs.webkit.org/show_bug.cgi?id=53797
When the frame name changes between different calls to webkit_web_frame_get_name
on the same frame, return the new frame name instead of the one valid during the
previous call.
* webkit/webkitwebframe.cpp:
(webkit_web_frame_init): Initialize the frame name to 0.
(webkit_web_frame_get_name): Check the current frame name first before
returning the cached value.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77714
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-04 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] WebKitWebFrame can return a stale frame name when calling webkit_web_frame_get_name
+ https://bugs.webkit.org/show_bug.cgi?id=53797
+
+ * platform/gtk/Skipped: Unskip a test which is now passing.
+
2011-02-04 Martin Robinson <mrobinson@igalia.com>
Rebaseline a few tests after r77665 and add a GTK-specific baseline
# New events failing; see https://bugs.webkit.org/show_bug.cgi?id=28823
fast/events/pageshow-pagehide-on-back-cached.html
-fast/events/pageshow-pagehide-on-back-uncached.html
fast/events/pageshow-pagehide.html
# https://bugs.webkit.org/show_bug.cgi?id=30724
+2011-02-04 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] WebKitWebFrame can return a stale frame name when calling webkit_web_frame_get_name
+ https://bugs.webkit.org/show_bug.cgi?id=53797
+
+ When the frame name changes between different calls to webkit_web_frame_get_name
+ on the same frame, return the new frame name instead of the one valid during the
+ previous call.
+
+ * webkit/webkitwebframe.cpp:
+ (webkit_web_frame_init): Initialize the frame name to 0.
+ (webkit_web_frame_get_name): Check the current frame name first before
+ returning the cached value.
+
2011-02-04 Martin Robinson <mrobinson@igalia.com>
Reviewed by Gustavo Noronha Silva.
*
* Returns the @frame's name
*
- * Return value: the name of @frame
+ * Return value: the name of @frame. This method will return NULL if
+ * the #WebKitWebFrame is invalid or an empty string if it is not backed
+ * by a live WebCore frame.
*/
G_CONST_RETURN gchar* webkit_web_frame_get_name(WebKitWebFrame* frame)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);
-
- WebKitWebFramePrivate* priv = frame->priv;
-
- if (priv->name)
- return priv->name;
-
Frame* coreFrame = core(frame);
if (!coreFrame)
return "";
- String string = coreFrame->tree()->uniqueName();
- priv->name = g_strdup(string.utf8().data());
+ WebKitWebFramePrivate* priv = frame->priv;
+ CString frameName = coreFrame->tree()->uniqueName().string().utf8();
+ if (!g_strcmp0(frameName.data(), priv->name))
+ return priv->name;
+
+ g_free(priv->name);
+ priv->name = g_strdup(frameName.data());
return priv->name;
}