Bug 139984 - [EFL] The size of contents wasn't updated immediately after r176631
Summary: [EFL] The size of contents wasn't updated immediately after r176631
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hunseop Jeong
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-28 23:14 PST by Hunseop Jeong
Modified: 2017-03-11 10:36 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.61 KB, patch)
2014-12-28 23:26 PST, Hunseop Jeong
no flags Details | Formatted Diff | Diff
Patch (1.76 KB, patch)
2014-12-30 01:29 PST, Hunseop Jeong
no flags Details | Formatted Diff | Diff
Patch (3.35 KB, patch)
2015-01-12 00:06 PST, Hunseop Jeong
gyuyoung.kim: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hunseop Jeong 2014-12-28 23:14:32 PST
You can watch this problem after clicking the button of maximize window in MiniBrowser.
It looks like page has wrong scale factor.
I added logs in PageViewportController::updateMinimumScaleToFit() to fix this issue.

Logs are : (when click the maximize button)
[PageViewportController::updateMinimumScaleToFit] m_viewportSize width:1920.000000 height:964.000000
[PageViewportController::updateMinimumScaleToFit] m_contentsSize width:800.000000 height:560.000000
[PageViewportController::updateMinimumScaleToFit] currentlyScaledToFit:1
[PageViewportController::updateMinimumScaleToFit] minimumScale:2.400000
[PageViewportController::updateMinimumScaleToFit] m_minimumScaleToFit:1.000000
[PageViewportController::applyScaleAfterRenderingContents] scale:2.400000

minimumScale updated the wrong value because the size of viewport was not the same with contents.
Comment 1 Hunseop Jeong 2014-12-28 23:26:55 PST
Created attachment 243791 [details]
Patch
Comment 2 Hunseop Jeong 2014-12-28 23:44:18 PST
I try to update the size of contents immediately to fix this problem but it still occurred at www.naver.com.
I will try to find the cause to fix this issue.
Comment 3 Hunseop Jeong 2014-12-30 01:29:33 PST
Created attachment 243818 [details]
Patch
Comment 4 Hunseop Jeong 2014-12-30 01:43:10 PST
After attachment 243818 [details], Page was scaled correctly when clicked the maxmize button in MiniBrowser. 

Gyuyoung, Could I ask why you removed m_hadUserInteraction in updateMinimumScaleToFit()?

But api test still failed in EWK2ViewTest.ewk_view_scale_with_fixed_layout.

../../Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:917: Failure
Value of: ewk_view_scale_get(webView())
  Actual: 0.81632656
Expected: 1

916:     // Default scale value is 1.0.
917:     ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));
Comment 5 Gyuyoung Kim 2014-12-30 23:38:37 PST
(In reply to comment #4)
> After attachment 243818 [details], Page was scaled correctly when clicked
> the maxmize button in MiniBrowser. 
> 
> Gyuyoung, Could I ask why you removed m_hadUserInteraction in
> updateMinimumScaleToFit()?

IIRC, I removed it because it seems we don't need to use it. If we need to use it, we can revert it.


> But api test still failed in EWK2ViewTest.ewk_view_scale_with_fixed_layout.
> 
> ../../Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:917: Failure
> Value of: ewk_view_scale_get(webView())
>   Actual: 0.81632656
> Expected: 1
> 
> 916:     // Default scale value is 1.0.
> 917:     ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));

Hmm, this test was passed when I landed r176631. I guess following patch made this regression.
Comment 6 Hunseop Jeong 2015-01-12 00:06:09 PST
Created attachment 244432 [details]
Patch
Comment 7 Gyuyoung Kim 2015-01-12 00:29:10 PST
Comment on attachment 244432 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-914
> -    ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));

If we don't load a test page, what is meaning to check if default scale value is 1.0 below ?

ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-919
> -    ASSERT_TRUE(ewk_view_scale_set(webView(), 1.2, 0, 0));

This is to test that webview can keep previous scale factor after reloading a page.

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-924
> -    ASSERT_TRUE(ewk_view_scale_set(webView(), 1.5, 0, 0));

ditto.
Comment 8 Hunseop Jeong 2015-01-12 00:35:35 PST
Comment on attachment 244432 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-914
>> -    ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
> 
> If we don't load a test page, what is meaning to check if default scale value is 1.0 below ?
> 
> ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));

If load the defaultTestPage, pageScaleFactor was changed from 1.0 to 0.81632656 because default contentSize(980x735) bigger then default viewSize(800x560).
So I removed the "loadUrlSync(environment->defaultTestPageUrl())" to check the default value of pageScaleFactor whether it is 1.0.

>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-919
>> -    ASSERT_TRUE(ewk_view_scale_set(webView(), 1.2, 0, 0));
> 
> This is to test that webview can keep previous scale factor after reloading a page.

If ewk_view_scale_set() was invoked before loadUrl(), it didn't set pageScaleFactor because syncVisibleContents() failed.
If syncVisibleContents() failed, it recover the original pageScaleFactor that was old one. 
So I moved the ewk_view_scale_set() after invoking the loadUrlSync().
Comment 9 Gyuyoung Kim 2015-01-12 01:34:11 PST
Comment on attachment 244432 [details]
Patch

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

>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-914
>>> -    ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
>> 
>> If we don't load a test page, what is meaning to check if default scale value is 1.0 below ?
>> 
>> ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));
> 
> If load the defaultTestPage, pageScaleFactor was changed from 1.0 to 0.81632656 because default contentSize(980x735) bigger then default viewSize(800x560).
> So I removed the "loadUrlSync(environment->defaultTestPageUrl())" to check the default value of pageScaleFactor whether it is 1.0.

If so, we have to change the default content size with 800x560. I think you change test behavior without reasonable reason.

>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-919
>>> -    ASSERT_TRUE(ewk_view_scale_set(webView(), 1.2, 0, 0));
>> 
>> This is to test that webview can keep previous scale factor after reloading a page.
> 
> If ewk_view_scale_set() was invoked before loadUrl(), it didn't set pageScaleFactor because syncVisibleContents() failed.
> If syncVisibleContents() failed, it recover the original pageScaleFactor that was old one. 
> So I moved the ewk_view_scale_set() after invoking the loadUrlSync().

I don't understand well. We already load a default test page in 914 line before you removed it. If so, ewk_view_scale_set(webView(), 1.2, 0, 0) should not be failed, isn't it ?
Comment 10 Hunseop Jeong 2015-01-12 02:12:14 PST
Comment on attachment 244432 [details]
Patch

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

>>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-914
>>>> -    ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
>>> 
>>> If we don't load a test page, what is meaning to check if default scale value is 1.0 below ?
>>> 
>>> ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));
>> 
>> If load the defaultTestPage, pageScaleFactor was changed from 1.0 to 0.81632656 because default contentSize(980x735) bigger then default viewSize(800x560).
>> So I removed the "loadUrlSync(environment->defaultTestPageUrl())" to check the default value of pageScaleFactor whether it is 1.0.
> 
> If so, we have to change the default content size with 800x560. I think you change test behavior without reasonable reason.

Yes, ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView())) passed if I changed the default page width from 980 to 800 in ViewportConfiguration::webpageParameters().
Should I changed the value in EFL port?

>>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-919
>>>> -    ASSERT_TRUE(ewk_view_scale_set(webView(), 1.2, 0, 0));
>>> 
>>> This is to test that webview can keep previous scale factor after reloading a page.
>> 
>> If ewk_view_scale_set() was invoked before loadUrl(), it didn't set pageScaleFactor because syncVisibleContents() failed.
>> If syncVisibleContents() failed, it recover the original pageScaleFactor that was old one. 
>> So I moved the ewk_view_scale_set() after invoking the loadUrlSync().
> 
> I don't understand well. We already load a default test page in 914 line before you removed it. If so, ewk_view_scale_set(webView(), 1.2, 0, 0) should not be failed, isn't it ?

Yes, it is. But it failed if I changed the default page width to 800. 

../../Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:922: Failure
Value of: ewk_view_scale_get(webView())
  Actual: 0.81632656
Expected: 1.2

I think ewk_view_scale_set(webView(), 1.2, 0, 0) didn'set the pageScaleFactor because syncVisibleContents() failed.
So it recover the old pageScaleFactor but I don't know why actual value is 0.81632656.
Comment 11 Gyuyoung Kim 2015-01-12 18:24:57 PST
Comment on attachment 244432 [details]
Patch

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

>>>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-914
>>>>> -    ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
>>>> 
>>>> If we don't load a test page, what is meaning to check if default scale value is 1.0 below ?
>>>> 
>>>> ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));
>>> 
>>> If load the defaultTestPage, pageScaleFactor was changed from 1.0 to 0.81632656 because default contentSize(980x735) bigger then default viewSize(800x560).
>>> So I removed the "loadUrlSync(environment->defaultTestPageUrl())" to check the default value of pageScaleFactor whether it is 1.0.
>> 
>> If so, we have to change the default content size with 800x560. I think you change test behavior without reasonable reason.
> 
> Yes, ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView())) passed if I changed the default page width from 980 to 800 in ViewportConfiguration::webpageParameters().
> Should I changed the value in EFL port?

When I landed r176631, this API test was passed. Could you check if content Size was also 980x735 at that time ?

>>>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-919
>>>>> -    ASSERT_TRUE(ewk_view_scale_set(webView(), 1.2, 0, 0));
>>>> 
>>>> This is to test that webview can keep previous scale factor after reloading a page.
>>> 
>>> If ewk_view_scale_set() was invoked before loadUrl(), it didn't set pageScaleFactor because syncVisibleContents() failed.
>>> If syncVisibleContents() failed, it recover the original pageScaleFactor that was old one. 
>>> So I moved the ewk_view_scale_set() after invoking the loadUrlSync().
>> 
>> I don't understand well. We already load a default test page in 914 line before you removed it. If so, ewk_view_scale_set(webView(), 1.2, 0, 0) should not be failed, isn't it ?
> 
> Yes, it is. But it failed if I changed the default page width to 800. 
> 
> ../../Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:922: Failure
> Value of: ewk_view_scale_get(webView())
>   Actual: 0.81632656
> Expected: 1.2
> 
> I think ewk_view_scale_set(webView(), 1.2, 0, 0) didn'set the pageScaleFactor because syncVisibleContents() failed.
> So it recover the old pageScaleFactor but I don't know why actual value is 0.81632656.

I made to restore previous scale factor if sysnVisibleContents() is failed. I think we should not keep the failing pageScaleFactor in PageViewportController though coordinatedGraphics fails to change scale. I think we should check why syncVisibleContents() is failed first.
Comment 12 Hunseop Jeong 2015-01-19 17:48:54 PST
Comment on attachment 244432 [details]
Patch

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

>>>>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-914
>>>>>> -    ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
>>>>> 
>>>>> If we don't load a test page, what is meaning to check if default scale value is 1.0 below ?
>>>>> 
>>>>> ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView()));
>>>> 
>>>> If load the defaultTestPage, pageScaleFactor was changed from 1.0 to 0.81632656 because default contentSize(980x735) bigger then default viewSize(800x560).
>>>> So I removed the "loadUrlSync(environment->defaultTestPageUrl())" to check the default value of pageScaleFactor whether it is 1.0.
>>> 
>>> If so, we have to change the default content size with 800x560. I think you change test behavior without reasonable reason.
>> 
>> Yes, ASSERT_FLOAT_EQ(1, ewk_view_scale_get(webView())) passed if I changed the default page width from 980 to 800 in ViewportConfiguration::webpageParameters().
>> Should I changed the value in EFL port?
> 
> When I landed r176631, this API test was passed. Could you check if content Size was also 980x735 at that time ?

I tried to test the ewk_view_scale_with_fixed_layout after reset r176631.
Failed in 5 times among the 10 times.
Maybe,,there are some timing issue.

Value of: ewk_view_scale_get(webView())
  Actual: 0.81632656
Expected: 1.5

Value of: ewk_view_scale_get(webView())
  Actual: 0.81632656
Expected: 1.2

Result is different whenever I try to test.

And I checked the content size in PageViewportController::updateMinimumScaleToFit().

contentSize width:980.000000 height:735.000000
m_viewportSize width:800.000000 height:600.000000
minimumScale:0.816327

>>>>>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:-919
>>>>>> -    ASSERT_TRUE(ewk_view_scale_set(webView(), 1.2, 0, 0));
>>>>> 
>>>>> This is to test that webview can keep previous scale factor after reloading a page.
>>>> 
>>>> If ewk_view_scale_set() was invoked before loadUrl(), it didn't set pageScaleFactor because syncVisibleContents() failed.
>>>> If syncVisibleContents() failed, it recover the original pageScaleFactor that was old one. 
>>>> So I moved the ewk_view_scale_set() after invoking the loadUrlSync().
>>> 
>>> I don't understand well. We already load a default test page in 914 line before you removed it. If so, ewk_view_scale_set(webView(), 1.2, 0, 0) should not be failed, isn't it ?
>> 
>> Yes, it is. But it failed if I changed the default page width to 800. 
>> 
>> ../../Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:922: Failure
>> Value of: ewk_view_scale_get(webView())
>>   Actual: 0.81632656
>> Expected: 1.2
>> 
>> I think ewk_view_scale_set(webView(), 1.2, 0, 0) didn'set the pageScaleFactor because syncVisibleContents() failed.
>> So it recover the old pageScaleFactor but I don't know why actual value is 0.81632656.
> 
> I made to restore previous scale factor if sysnVisibleContents() is failed. I think we should not keep the failing pageScaleFactor in PageViewportController though coordinatedGraphics fails to change scale. I think we should check why syncVisibleContents() is failed first.

I checked the syncVisiblieContents() whether is failed or not.
It is not a problem of syncVisibleContent(),,,
syncVisibleContents() isn't failed in test.
I will find what is problem.
Comment 13 Michael Catanzaro 2017-03-11 10:36:30 PST
Closing this bug because the EFL port has been removed from trunk.

If you feel this bug applies to a different upstream WebKit port and was closed in error, please either update the title and reopen the bug, or leave a comment to request this.