Bug 197105

Summary: REGRESSION (iOS 12.2): CSS perspective property value can only be set correctly once
Product: WebKit Reporter: Iker Jamardo Zugaza <ijamardo>
Component: CompositingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Blocker CC: dino, ews-watchlist, graouts, me, rniwa, simon.fraser, wassgha, webkit-bug-importer, zalan, zenktaka
Priority: P2 Keywords: InRadar
Version: Safari 12   
Hardware: iPhone / iPad   
OS: iOS 12   
Attachments:
Description Flags
Patch
zalan: review+, ews-watchlist: commit-queue-
Archive of layout-test-results from ews102 for mac-highsierra
none
Archive of layout-test-results from ews123 for ios-simulator-wk2 none

Description Iker Jamardo Zugaza 2019-04-19 09:38:21 PDT
Since iOS 12.2 WebKit is not able to reset the perspective value correctly more than once. This issue is reproducible on both iOS 12.2 Safari and WKWebView and also in OSX Mojave Safari version 12.1. It could be that this is happening in earlier versions.

In order to reproduce, check this W3 School example: https://www.w3schools.com/cssref/trycss3_perspective_inuse.htm

Moving the slider does not correctly modify the perspective CSS value.

Tested on a MacBook Pro with OSX 10.14.4 and on an iPhone 7 Plus with iOS 12.2. It was not happening on iOS 12.0 nor in 11.4.
Comment 1 Radar WebKit Bug Importer 2019-04-19 22:02:36 PDT
<rdar://problem/50068230>
Comment 2 Simon Fraser (smfr) 2019-04-24 10:55:03 PDT
Created attachment 368143 [details]
Patch
Comment 3 EWS Watchlist 2019-04-24 11:44:06 PDT
Comment on attachment 368143 [details]
Patch

Attachment 368143 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11985316

New failing tests:
compositing/style-change/transform-style-change.html
compositing/style-change/transform-origin-change.html
compositing/style-change/backface-visibility-change.html
compositing/style-change/perspective-change.html
compositing/style-change/perspective-origin-change.html
Comment 4 EWS Watchlist 2019-04-24 11:44:08 PDT
Created attachment 368152 [details]
Archive of layout-test-results from ews102 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 5 EWS Watchlist 2019-04-24 12:35:25 PDT
Comment on attachment 368143 [details]
Patch

Attachment 368143 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/11985548

New failing tests:
editing/pasteboard/5761530-1.html
Comment 6 EWS Watchlist 2019-04-24 12:35:26 PDT
Created attachment 368159 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 7 Simon Fraser (smfr) 2019-04-24 14:27:34 PDT
https://trac.webkit.org/r244612
Comment 8 Hironori Takaryou 2019-05-29 22:03:09 PDT
I ran into the same issue on an iPhone 6 Plus with iOS 12.3.1.
And I solved it by adding the following code to force Safari to redraw,

-----------------------------------------------------
divElement.style.perspective = newPerspective + 'px';
divElement.style.overflow = 'hidden'; //ADDED
divElement.offsetHeight;              //ADDED
divElement.style.overflow = 'auto';   //ADDED
-----------------------------------------------------

I hope this will help you.
Comment 9 Simon Fraser (smfr) 2019-09-10 13:50:54 PDT
*** Bug 201656 has been marked as a duplicate of this bug. ***