Bug 102122 - [EFL][WK2] New window size should consult the window attributes
Summary: [EFL][WK2] New window size should consult the window attributes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-13 12:55 PST by Yael
Modified: 2012-11-14 05:07 PST (History)
6 users (show)

See Also:


Attachments
Patch (9.70 KB, patch)
2012-11-13 13:09 PST, Yael
no flags Details | Formatted Diff | Diff
Patch (9.80 KB, patch)
2012-11-13 14:50 PST, Yael
kenneth: review+
Details | Formatted Diff | Diff
Patch for landing. (9.87 KB, patch)
2012-11-13 16:06 PST, Yael
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yael 2012-11-13 12:55:18 PST
Currently, new window is always sized to 800x600, and only later resized to the desired size.
This can lead to ugly flashing.
Patch is coming.
Comment 1 Yael 2012-11-13 13:09:27 PST
Created attachment 173962 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-11-13 13:35:59 PST
Comment on attachment 173962 [details]
Patch

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

Nice!

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:841
> +    WKRetainPtr<WKStringRef> widthStr(AdoptWK, WKStringCreateWithUTF8CString("width"));
> +    WKRetainPtr<WKStringRef> heightStr(AdoptWK, WKStringCreateWithUTF8CString("height"));
> +

Maybe a comment that we don't do everything here? for showModalDialog are they also called width and height or dialogWidth etc?

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:842
> +    int width = 0;

unsigned?

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:846
> +    if (ref)
> +        width = WKDoubleGetValue(static_cast<WKDoubleRef>(ref));

unsigned width = ref ? WKDoubleGetValue(static_cast<WKDoubleRef>(ref)) : 0 ?

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:852
> +    width = std::max(width, 0);
> +    height = std::max(height, 0);

WebKit makes sure these are always bigger than 100px. You could assert
Comment 3 Yael 2012-11-13 14:04:55 PST
(In reply to comment #2)
> (From update of attachment 173962 [details])
Thanks for the review :)
> View in context: https://bugs.webkit.org/attachment.cgi?id=173962&action=review
> 
> Nice!
> 
> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:841
> > +    WKRetainPtr<WKStringRef> widthStr(AdoptWK, WKStringCreateWithUTF8CString("width"));
> > +    WKRetainPtr<WKStringRef> heightStr(AdoptWK, WKStringCreateWithUTF8CString("height"));
> > +
> 
> Maybe a comment that we don't do everything here? for showModalDialog are they also called width and height or dialogWidth etc?
> 
The dictionary is created in WebUIClient::createNewPage(), and always uses "width" and "height".
> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:842
> > +    int width = 0;
> 
> unsigned?
> 
ok
> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:846
> > +    if (ref)
> > +        width = WKDoubleGetValue(static_cast<WKDoubleRef>(ref));
> 
> unsigned width = ref ? WKDoubleGetValue(static_cast<WKDoubleRef>(ref)) : 0 ?
> 
> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:852
> > +    width = std::max(width, 0);
> > +    height = std::max(height, 0);
> 
> WebKit makes sure these are always bigger than 100px. You could assert
WebKit does that only if a value was specified. But you are right, I will never get a negative value here.
Comment 4 Yael 2012-11-13 14:50:21 PST
Created attachment 173996 [details]
Patch

Address comment #2.
Comment 5 Kenneth Rohde Christiansen 2012-11-13 14:59:22 PST
Comment on attachment 173996 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:844
> +    unsigned int width = ref ? WKDoubleGetValue(static_cast<WKDoubleRef>(ref)) : 0;

style says to just use "unsigned" ie. no int

> Tools/MiniBrowser/efl/main.c:187
> -        Browser_Window *window = window_create(DEFAULT_URL);
> +        Browser_Window *window = window_create(DEFAULT_URL, 0, 0);

// 0 equals default.
Comment 6 Yael 2012-11-13 16:06:30 PST
Created attachment 174019 [details]
Patch for landing.
Comment 7 WebKit Review Bot 2012-11-13 21:06:14 PST
Comment on attachment 174019 [details]
Patch for landing.

Clearing flags on attachment: 174019

Committed r134534: <http://trac.webkit.org/changeset/134534>
Comment 8 WebKit Review Bot 2012-11-13 21:06:20 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Chris Dumez 2012-11-13 22:02:53 PST
Shouldn't this patch take into consideration the window position as well? Or is it OK to move the window later on?
Comment 10 Jinwoo Song 2012-11-13 22:22:36 PST
Actually, I'm working on window features and will upload the patch for review soon.
https://bugs.webkit.org/show_bug.cgi?id=99114
Comment 11 Yael 2012-11-14 05:07:01 PST
(In reply to comment #9)
> Shouldn't this patch take into consideration the window position as well? Or is it OK to move the window later on?
Could be done in a separate patch, it seems that someone else is already working on it.