Bug 106342

Summary: [GTK][WK2] accessibility/language-attribute.html is failing
Product: WebKit Reporter: Zan Dobersek <zan>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, gyuyoung.kim, k.czech, mario, mrobinson
Priority: P2 Keywords: Gtk, LayoutTestFailure
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 98347, 112030    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Zan Dobersek
Reported 2013-01-08 10:26:11 PST
The accessibility/language-attribute.html layout test is failing on GTK WK2 port. Here's the diff: --- /home/zan/Dev/webkit/webkit/WebKitBuild/Release/layout-test-results/accessibility/language-attribute-expected.txt +++ /home/zan/Dev/webkit/webkit/WebKitBuild/Release/layout-test-results/accessibility/language-attribute-actual.txt @@ -4,4 +4,4 @@ elvish and more english -Passed +Failed. Could not find AXLanguages: -
Attachments
Patch (3.74 KB, patch)
2013-04-09 03:41 PDT, Krzysztof Czech
no flags
Patch (5.07 KB, patch)
2013-04-18 06:36 PDT, Krzysztof Czech
no flags
Patch (5.07 KB, patch)
2013-04-19 00:17 PDT, Krzysztof Czech
no flags
Krzysztof Czech
Comment 1 2013-04-09 03:41:06 PDT
Mario Sanchez Prada
Comment 2 2013-04-16 02:31:56 PDT
Comment on attachment 197020 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=197020&action=review > Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:593 > + for (GSList* textAttributes = atk_text_get_default_attributes(ATK_TEXT(m_element)); textAttributes; textAttributes = textAttributes->next) { > + AtkAttribute* atkAttribute = static_cast<AtkAttribute*>(textAttributes->data); > + if (!strcmp(atkAttribute->name, atk_text_attribute_get_name(ATK_TEXT_ATTR_LANGUAGE))) { > + language.set(g_strdup_printf("AXLanguage: %s", atkAttribute->value)); > + return JSStringCreateWithUTF8CString(language.get()); > + } > + } You are leaking both the returned GSList* and the data in each of its elements here, since atk_text_get_default_attributes() is transfer-full. So, you should use a GOwnPtr<GSList> for that least, although you would still need to make sure that both the AtkAttribute structs and the gchar* pointers inside them (name, value) are freed before returning from this function.
Krzysztof Czech
Comment 3 2013-04-18 06:36:23 PDT
Krzysztof Czech
Comment 4 2013-04-18 06:38:42 PDT
> You are leaking both the returned GSList* and the data in each of its elements here, since atk_text_get_default_attributes() is transfer-full. > > So, you should use a GOwnPtr<GSList> for that least, although you would still need to make sure that both the AtkAttribute structs and the gchar* pointers inside them (name, value) are freed before returning from this function. Good point. Applied suggestions.
Mario Sanchez Prada
Comment 5 2013-04-18 09:24:42 PDT
(In reply to comment #4) > > You are leaking both the returned GSList* and the data in each of its elements here, since atk_text_get_default_attributes() is transfer-full. > > > > So, you should use a GOwnPtr<GSList> for that least, although you would still need to make sure that both the AtkAttribute structs and the gchar* pointers inside them (name, value) are freed before returning from this function. > > Good point. Applied suggestions. Thanks for considering those. The patch looks good to me now.
WebKit Commit Bot
Comment 6 2013-04-18 16:05:52 PDT
Attachment 198729 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/platform/gtk-wk2/TestExpectations', u'Tools/ChangeLog', u'Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp']" exit_code: 1 Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:48: Missing space before ( in for( [whitespace/parens] [5] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Krzysztof Czech
Comment 7 2013-04-19 00:17:25 PDT
Krzysztof Czech
Comment 8 2013-04-19 00:17:48 PDT
Corrected style errors.
Gyuyoung Kim
Comment 9 2013-04-19 00:37:55 PDT
Comment on attachment 198819 [details] Patch rs=me based on Mario informal review.
Mario Sanchez Prada
Comment 10 2013-04-19 02:26:02 PDT
Comment on attachment 198819 [details] Patch Adding to the commit queue, as per Krzystof request
WebKit Commit Bot
Comment 11 2013-04-19 03:36:07 PDT
Comment on attachment 198819 [details] Patch Clearing flags on attachment: 198819 Committed r148737: <http://trac.webkit.org/changeset/148737>
WebKit Commit Bot
Comment 12 2013-04-19 03:36:12 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.