Bug 90540

Summary: [WK2][EFL] Ewk_View needs API to load HTML data
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: hyerim.bae, kenneth, ryuan.choi, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 61838    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Chris Dumez 2012-07-04 03:53:08 PDT
Now that the Ewk_View reports load errors, we need to handle them in MiniBrowser to display an error page.
Comment 1 Chris Dumez 2012-07-04 03:56:56 PDT
Created attachment 150764 [details]
Patch
Comment 2 Ryuan Choi 2012-07-04 04:13:22 PDT
Comment on attachment 150764 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150764&action=review

> Source/WebKit2/ChangeLog:4
> +        [WK2][EFL] MiniBrowser needs to handle load errors
> +        https://bugs.webkit.org/show_bug.cgi?id=90540

IMO, more important change of this patch looks adding new API, right?

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:692
> +Eina_Bool ewk_view_html_load(Evas_Object* ewkView, const char* html, const char* baseUrl, const char* unreachableUrl)

In WK1/Efl, we used ewk_frame_contents_set and ewk_frame_contents_alternate_set for same feature.

http://trac.webkit.org/browser/trunk/Source/WebKit/efl/ewk/ewk_frame.cpp#L422
Comment 3 Chris Dumez 2012-07-04 04:29:10 PDT
Comment on attachment 150764 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150764&action=review

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:692
>> +Eina_Bool ewk_view_html_load(Evas_Object* ewkView, const char* html, const char* baseUrl, const char* unreachableUrl)
> 
> In WK1/Efl, we used ewk_frame_contents_set and ewk_frame_contents_alternate_set for same feature.
> 
> http://trac.webkit.org/browser/trunk/Source/WebKit/efl/ewk/ewk_frame.cpp#L422

In WK2, we don't have frame-level APIs anymore so we are breaking compatibility with WK1 API anyway. Since we break compatibility, I decided to simplify the API a bit and propose something similar to what is in Qt port.
The method I'm proposing can achieve the same behavior as the 2 methods you mention. We don't loose any functionality.
Comment 4 Ryuan Choi 2012-07-04 04:50:52 PDT
(In reply to comment #3)
> (From update of attachment 150764 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=150764&action=review
> 
> >> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:692
> >> +Eina_Bool ewk_view_html_load(Evas_Object* ewkView, const char* html, const char* baseUrl, const char* unreachableUrl)
> > 
> > In WK1/Efl, we used ewk_frame_contents_set and ewk_frame_contents_alternate_set for same feature.
> > 
> > http://trac.webkit.org/browser/trunk/Source/WebKit/efl/ewk/ewk_frame.cpp#L422
> 
> In WK2, we don't have frame-level APIs anymore so we are breaking compatibility with WK1 API anyway. Since we break compatibility, I decided to simplify the API a bit and propose something similar to what is in Qt port.
> The method I'm proposing can achieve the same behavior as the 2 methods you mention. We don't loose any functionality.

Although we don't break compatibility, is it better to use similar name for application developers to easily understand ?

I think that 1 method looks enough.
Comment 5 Chris Dumez 2012-07-04 04:54:47 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 150764 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=150764&action=review
> > 
> > >> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:692
> > >> +Eina_Bool ewk_view_html_load(Evas_Object* ewkView, const char* html, const char* baseUrl, const char* unreachableUrl)
> > > 
> > > In WK1/Efl, we used ewk_frame_contents_set and ewk_frame_contents_alternate_set for same feature.
> > > 
> > > http://trac.webkit.org/browser/trunk/Source/WebKit/efl/ewk/ewk_frame.cpp#L422
> > 
> > In WK2, we don't have frame-level APIs anymore so we are breaking compatibility with WK1 API anyway. Since we break compatibility, I decided to simplify the API a bit and propose something similar to what is in Qt port.
> > The method I'm proposing can achieve the same behavior as the 2 methods you mention. We don't loose any functionality.
> 
> Although we don't break compatibility, is it better to use similar name for application developers to easily understand ?
> 
> I think that 1 method looks enough.

Yes, I usually try to keep compatibility or at least stay close to the WK1 API. But in this case, I think it is a good opportunity to simplify the API. Also, I don't really like the WK1 function names for this and I don't find them clear enough. Unless there is strong opinion on Samsung side against it, I would like to land this patch as it is.
Comment 6 Chris Dumez 2012-07-04 06:22:09 PDT
Created attachment 150783 [details]
Patch

Update bug title in Changelogs as Ryuan suggested.
Comment 7 Kenneth Rohde Christiansen 2012-07-04 19:58:43 PDT
Comment on attachment 150783 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150783&action=review

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:692
> +Eina_Bool ewk_view_html_load(Evas_Object* ewkView, const char* html, const char* baseUrl, const char* unreachableUrl)

html_data_load ? btw, wouldnt it load svg as well?
Comment 8 Chris Dumez 2012-07-04 22:25:26 PDT
Comment on attachment 150783 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150783&action=review

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:692
>> +Eina_Bool ewk_view_html_load(Evas_Object* ewkView, const char* html, const char* baseUrl, const char* unreachableUrl)
> 
> html_data_load ? btw, wouldnt it load svg as well?

html_data_load(), why not if you prefer. I would even go for html_string_load() then. if you look at the methods I'm calling internally: loadHTMLString(), this would map quite closely. If it does load SVG, then the page API is confusing :)
Comment 9 Kenneth Rohde Christiansen 2012-07-04 22:35:59 PDT
I am all for string_load :-)
Comment 10 Chris Dumez 2012-07-04 23:20:02 PDT
Created attachment 150881 [details]
Patch

Take Kenneth's feedback into consideration.
Comment 11 WebKit Review Bot 2012-07-05 01:15:15 PDT
Comment on attachment 150881 [details]
Patch

Clearing flags on attachment: 150881

Committed r121890: <http://trac.webkit.org/changeset/121890>
Comment 12 WebKit Review Bot 2012-07-05 01:15:20 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Hyerim Bae 2012-07-15 19:33:10 PDT
*** Bug 91352 has been marked as a duplicate of this bug. ***