Bug 125565 - Frame's composited content is visible when the frame has visibility: hidden.
Summary: Frame's composited content is visible when the frame has visibility: hidden.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
: 134774 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-11 04:47 PST by j5726
Modified: 2017-05-25 20:53 PDT (History)
5 users (show)

See Also:


Attachments
the iframe visibility:hidden test case (900 bytes, application/zip)
2013-12-11 04:53 PST, j5726
no flags Details
Patch (1.74 KB, patch)
2014-02-28 02:35 PST, Manish Gurnaney
no flags Details | Formatted Diff | Diff
Patch (1.78 KB, patch)
2014-03-04 18:58 PST, Manish Gurnaney
no flags Details | Formatted Diff | Diff
Patch (28.65 KB, patch)
2014-03-17 20:39 PDT, Manish Gurnaney
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 (530.58 KB, application/zip)
2014-03-17 21:39 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion (536.63 KB, application/zip)
2014-03-17 22:06 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion (535.95 KB, application/zip)
2014-03-17 23:10 PDT, Build Bot
no flags Details
Patch (52.69 KB, patch)
2014-03-18 04:12 PDT, Manish Gurnaney
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion (563.01 KB, application/zip)
2014-03-18 04:43 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2 (527.80 KB, application/zip)
2014-03-18 05:21 PDT, Build Bot
no flags Details
Patch (52.44 KB, patch)
2014-03-18 05:59 PDT, Manish Gurnaney
simon.fraser: review-
simon.fraser: commit-queue-
Details | Formatted Diff | Diff
Patch (52.36 KB, patch)
2014-03-18 23:03 PDT, Manish Gurnaney
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 (552.82 KB, application/zip)
2014-03-19 00:15 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion (547.41 KB, application/zip)
2014-03-19 00:35 PDT, Build Bot
no flags Details
Patch (65.89 KB, patch)
2014-03-21 02:19 PDT, Manish Gurnaney
no flags Details | Formatted Diff | Diff
Patch (8.59 KB, patch)
2014-04-04 08:35 PDT, Manish Gurnaney
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion (556.59 KB, application/zip)
2014-04-04 10:57 PDT, Build Bot
no flags Details
Patch (8.59 KB, patch)
2014-07-11 00:24 PDT, Manish Gurnaney
darin: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion (567.79 KB, application/zip)
2014-07-11 01:49 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion (567.33 KB, application/zip)
2014-07-11 02:49 PDT, Build Bot
no flags Details
Test reduction (203 bytes, text/html)
2017-05-25 10:21 PDT, zalan
no flags Details
Patch (9.79 KB, patch)
2017-05-25 16:31 PDT, zalan
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews126 for ios-simulator-wk2 (11.66 MB, application/zip)
2017-05-25 17:57 PDT, Build Bot
no flags Details
Patch (10.11 KB, patch)
2017-05-25 19:09 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (10.10 KB, patch)
2017-05-25 20:15 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description j5726 2013-12-11 04:47:25 PST
If a page contains an iframe, and there're some elements in the iframe been set as -webkit-transform: translate3d(0px, 0px, 0) . 

When set the iframe as visibility: hidden , It can't be hidden normally. 

visibility:hidden is invalid on an iframe with elements been set as -webkit-transform: translate3d
Comment 1 j5726 2013-12-11 04:53:16 PST
Created attachment 218950 [details]
the iframe visibility:hidden test case

If a page contains an iframe, and there're some elements in the iframe been set as -webkit-transform: translate3d(0px, 0px, 0) . 

When set the iframe as visibility: hidden , It can't be hidden normally.
Comment 2 Manish Gurnaney 2014-02-28 02:35:11 PST
Created attachment 225450 [details]
Patch
Comment 3 Simon Fraser (smfr) 2014-02-28 11:08:31 PST
Comment on attachment 225450 [details]
Patch

Very bizarre patch. Why non-debug only? Not painting isn't the correct solution either; the actual bug here is that the WinCairo compositing code doesn't respect visibility:hidden for iframes (although maybe that's an issue with other platforms). Does this work on Mac, or iOS?
Comment 4 Manish Gurnaney 2014-03-03 00:49:28 PST
Hi Simon,
   I have checked the issue on Mac, Linux and Windows. Issues is getting reproducible in Mac(Safari and Chrome), Linux(Efl Port), Windows (WinCG, Safari and Chrome). So the issues is not specific to WinCG.
   Also I have observed that issue is happening in case of Webkit transform property that too when only 3d properties are given or when RenderLayerBacking is getting created. When we paint any element we do check for the Visibility of the element.
   Hence I am checking here in RenderLayerBacking itself.
--Please Suggest
Comment 5 Manish Gurnaney 2014-03-04 18:58:08 PST
Created attachment 225841 [details]
Patch
Comment 6 Manish Gurnaney 2014-03-10 09:17:06 PDT
Hi Simon, 
        Can you please review the updated patch.
Regards,
Manish R Gurnaney
Comment 7 zalan 2014-03-16 12:21:18 PDT
Comment on attachment 225841 [details]
Patch

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

> Source/WebCore/rendering/RenderLayerBacking.cpp:2204
> +        return;

It doesnt make much sense to create compositing for something that we never display. I think we should make a decision earlier so that an iframe with visibility: hidden would not be creating a compositing layer. If we manage to not create this compositing layer, existing code will probably take care of the not-painting part.
Comment 8 Manish Gurnaney 2014-03-17 20:39:52 PDT
Created attachment 227005 [details]
Patch
Comment 9 Build Bot 2014-03-17 21:39:56 PDT
Comment on attachment 227005 [details]
Patch

Attachment 227005 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6589632393248768

New failing tests:
fast/events/mouseover-mouseout2.html
compositing/iframes/iframe-visibility-hidden.html
compositing/visibility/hidden-iframe.html
Comment 10 Build Bot 2014-03-17 21:39:59 PDT
Created attachment 227009 [details]
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-13  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 11 Build Bot 2014-03-17 22:06:45 PDT
Comment on attachment 227005 [details]
Patch

Attachment 227005 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6597531911847936

New failing tests:
fast/events/mouseover-mouseout2.html
compositing/iframes/iframe-visibility-hidden.html
compositing/visibility/hidden-iframe.html
Comment 12 Build Bot 2014-03-17 22:06:49 PDT
Created attachment 227012 [details]
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-04  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 13 Build Bot 2014-03-17 23:10:52 PDT
Comment on attachment 227005 [details]
Patch

Attachment 227005 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5141360831102976

New failing tests:
fast/events/mouseover-mouseout2.html
compositing/iframes/iframe-visibility-hidden.html
compositing/visibility/hidden-iframe.html
Comment 14 Build Bot 2014-03-17 23:10:58 PDT
Created attachment 227014 [details]
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-01  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 15 Manish Gurnaney 2014-03-18 04:12:50 PDT
Created attachment 227030 [details]
Patch
Comment 16 Build Bot 2014-03-18 04:43:24 PDT
Comment on attachment 227030 [details]
Patch

Attachment 227030 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6495959156523008

New failing tests:
compositing/iframes/iframe-visibility-hidden.html
Comment 17 Build Bot 2014-03-18 04:43:28 PDT
Created attachment 227035 [details]
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-05  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 18 Build Bot 2014-03-18 05:21:24 PDT
Comment on attachment 227030 [details]
Patch

Attachment 227030 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5211600726261760

New failing tests:
media/W3C/audio/canPlayType/canPlayType_application_octet_stream.html
compositing/iframes/iframe-visibility-hidden.html
Comment 19 Build Bot 2014-03-18 05:21:28 PDT
Created attachment 227040 [details]
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-10  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 20 Manish Gurnaney 2014-03-18 05:59:47 PDT
Created attachment 227042 [details]
Patch
Comment 21 Simon Fraser (smfr) 2014-03-18 10:24:18 PDT
Comment on attachment 227042 [details]
Patch

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

> Source/WebCore/rendering/RenderIFrame.cpp:66
>  bool RenderIFrame::requiresLayer() const
>  {
> -    return RenderFrameBase::requiresLayer() || style().resize() != RESIZE_NONE;
> +    return (style().visibility() == VISIBLE || style().hasOutOfFlowPosition())
> +        && (RenderFrameBase::requiresLayer() || style().resize() != RESIZE_NONE);
>  }

This is the wrong place. This is about RenderLayer creation, not compositing (GraphicsLayer) creation.

RenderLayerCompositor::requiresCompositingForFrame() is the one you should change.
Comment 22 Manish Gurnaney 2014-03-18 23:03:50 PDT
Created attachment 227156 [details]
Patch
Comment 23 Build Bot 2014-03-19 00:12:40 PDT
Comment on attachment 227156 [details]
Patch

Attachment 227156 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5917214460870656

New failing tests:
compositing/iframes/iframe-visibility-hidden.html
Comment 24 Build Bot 2014-03-19 00:15:54 PDT
Created attachment 227164 [details]
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-16  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 25 Build Bot 2014-03-19 00:34:32 PDT
Comment on attachment 227156 [details]
Patch

Attachment 227156 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5733958943768576

New failing tests:
compositing/iframes/iframe-visibility-hidden.html
Comment 26 Build Bot 2014-03-19 00:35:19 PDT
Created attachment 227166 [details]
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-08  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 27 Manish Gurnaney 2014-03-21 02:19:57 PDT
Created attachment 227403 [details]
Patch
Comment 28 zalan 2014-03-25 08:41:48 PDT
Comment on attachment 227403 [details]
Patch

The code change looks good, however I'd create a ref test instead testing maybe even against a non-layer case. I'd also add a test case to check if dynamically removing the hidden property will bring the compositing content back.
Comment 29 Simon Fraser (smfr) 2014-03-29 14:15:08 PDT
Comment on attachment 227403 [details]
Patch

r- to add the tests that Zalan suggets.
Comment 30 Manish Gurnaney 2014-04-04 08:35:15 PDT
Created attachment 228594 [details]
Patch
Comment 31 Build Bot 2014-04-04 10:57:22 PDT
Comment on attachment 228594 [details]
Patch

Attachment 228594 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5326209713963008

New failing tests:
compositing/iframes/iframe-visibility-change-dynamically.html
Comment 32 Build Bot 2014-04-04 10:57:26 PDT
Created attachment 228606 [details]
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-08  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 33 Manish Gurnaney 2014-07-11 00:24:33 PDT
Created attachment 234746 [details]
Patch
Comment 34 Build Bot 2014-07-11 01:49:16 PDT
Comment on attachment 234746 [details]
Patch

Attachment 234746 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6095123725156352

New failing tests:
compositing/iframes/iframe-visibility-change-dynamically.html
Comment 35 Build Bot 2014-07-11 01:49:20 PDT
Created attachment 234749 [details]
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-08  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 36 Build Bot 2014-07-11 02:49:30 PDT
Comment on attachment 234746 [details]
Patch

Attachment 234746 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6329632160743424

New failing tests:
compositing/iframes/iframe-visibility-change-dynamically.html
Comment 37 Build Bot 2014-07-11 02:49:34 PDT
Created attachment 234752 [details]
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-04  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 38 Darin Adler 2014-07-12 19:08:37 PDT
Comment on attachment 234746 [details]
Patch

Change looks OK, but the test did not pass on the EWS bot, so I am concerned.
Comment 39 Manish Gurnaney 2014-07-13 21:51:28 PDT
I have added two test cases in support of my Patch, where one test Cases is getting failed (iframe-visibility-change-dynamically.html).

In this test cases Iframe is visibility is hidden initially, and dynamically we are changing visibility to visible. But this case is getting failed in mac as when visibility is changed, all the elements are rendered except the element having property (-webkit-transform: translate3d(0px, 0px, 0);) due to which test case is getting failed.

I tried to run this test case on Webkit Gtk and efl port in both the cases it is getting passed. It is failing only in mac.

I am not having mac machine with me, hence struggling to get the route cause of this issue. Can you please suggest what can be done in this case?
Comment 40 Tim Horton 2014-07-13 23:20:34 PDT
*** Bug 134774 has been marked as a duplicate of this bug. ***
Comment 41 Manish Gurnaney 2014-07-23 23:12:33 PDT
Hi Darin/Zalan, 
              Can you please suggest what can be done in this case ?
Manish
Comment 42 zalan 2017-05-25 10:21:15 PDT
Created attachment 311239 [details]
Test reduction
Comment 43 zalan 2017-05-25 10:23:17 PDT
rdar://problem/32196849
Comment 44 zalan 2017-05-25 14:24:00 PDT
anything that's a RenderWidget.
Comment 45 zalan 2017-05-25 16:31:56 PDT
Created attachment 311313 [details]
Patch
Comment 46 Build Bot 2017-05-25 17:57:10 PDT
Comment on attachment 311313 [details]
Patch

Attachment 311313 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3818142

New failing tests:
compositing/visibility/iframe-visibility-hidden.html
Comment 47 Build Bot 2017-05-25 17:57:12 PDT
Created attachment 311321 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 48 zalan 2017-05-25 19:09:58 PDT
Created attachment 311325 [details]
Patch
Comment 49 Simon Fraser (smfr) 2017-05-25 19:20:37 PDT
Comment on attachment 311325 [details]
Patch

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

> LayoutTests/compositing/visibility/iframe-visibility-hidden.html:14
> +    document.getElementById("divToVisible").style.visibility = "visible";

But divToVisible (which is actually an iframe) is already visible?

> LayoutTests/compositing/visibility/iframe-visibility-hidden.html:44
> +<iframe frameborder=no id=divToVisible onload="makeDivVisible()" width="80" height="80" style="visibility: visible"

Should this start hidden?
Comment 50 zalan 2017-05-25 20:15:39 PDT
Created attachment 311328 [details]
Patch
Comment 51 WebKit Commit Bot 2017-05-25 20:53:27 PDT
Comment on attachment 311328 [details]
Patch

Clearing flags on attachment: 311328

Committed r217472: <http://trac.webkit.org/changeset/217472>
Comment 52 WebKit Commit Bot 2017-05-25 20:53:30 PDT
All reviewed patches have been landed.  Closing bug.