Bug 124954

Summary: REGRESSION(r154658): webkit_web_view_get_view_source_mode always returns false
Product: WebKit Reporter: David <david>
Component: WebKit APIAssignee: Gustavo Noronha (kov) <gustavo>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, gustavo, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch cgarcia: review+

Description David 2013-11-27 18:34:14 PST
this is webkit 2.2.1.  The following code correctly toggled viewing the source with previous webkit versions.

int
toggle() {
gboolean mode;

mode = webkit_web_view_get_view_source_mode(t->wv);
mode = !mode;
webkit_web_view_set_view_source_mode(t->wv, mode);
return (0);
}

However, the first call correctly views the source code, but the next call does not toggle back due to mode = webkit_web_view_get_view_source_mode(t->wv); always returning FALSE.

webkit is compiled with --disable-webkit2.
Comment 1 Gustavo Noronha (kov) 2013-11-28 05:06:12 PST
Heh:

@@ -5181,8 +5166,7 @@ gboolean webkit_web_view_get_view_source_mode (WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
 
-    if (Frame* mainFrame = core(webView)->mainFrame())
-        return mainFrame->inViewSourceMode();
+    core(webView)->mainFrame().inViewSourceMode();
 
     return FALSE;
 }

From 095b544b7.
Comment 2 Gustavo Noronha (kov) 2013-11-28 06:19:42 PST
Created attachment 217995 [details]
Patch
Comment 3 Gustavo Noronha (kov) 2013-11-28 08:00:18 PST
Committed r159843: <http://trac.webkit.org/changeset/159843>