-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression(255659@main) Unable to log into twitch.tv #10760
Regression(255659@main) Unable to log into twitch.tv #10760
Conversation
EWS run on previous version of this PR (hash 2b671ee) |
#if PLATFORM(IOS_FAMILY) | ||
return ScreenOrientationType::PortraitPrimary; | ||
#else | ||
// On Desktop, the natural orientation must be landscape-primary. | ||
return ScreenOrientationType::LandscapePrimary; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Apple platforms there are the following: iPhone, iPad, watchOS, tvOS, macOS. To me, it is obvious that iPhone is clearly portrait-primary. Not as clear that iPad, watchOS, and tvOS all should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had this discussion a while back with Tim and Wenson. iPad apparently doesn't have a clear "natural" orientation so we had decided to stick with PortraitPrimary like iPhone.
For watchOS and tvOS, we didn't explicitly discuss it so I had lumped them all together. I don't think the screen orientation API is super relevant to these platforms. We may want to refine this at some point though.
For now at least, this patch is not changing behavior for these platforms. The behavior change is for macOS at this point, where we have a clear regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And presumably also changes behavior for all non-Apple platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you wrote PLATFORM(IOS)
it would be iPhone and iPad; thatβs what I would do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other platforms don't support this yet:
bool defaultShouldEnableScreenOrientationAPI()
{
#if PLATFORM(MAC)
return true;
#elif PLATFORM(IOS_FAMILY)
static bool shouldEnableScreenOrientationAPI = linkedOnOrAfterSDKWithBehavior(SDKAlignedBehavior::ScreenOrientationAPIEnabled);
return shouldEnableScreenOrientationAPI;
#else
return false;
#endif
}
So yes but it doesn't matter yet to them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But why take the risk to change the behavior on Watch and TV on the branch at this point?
OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind changing behavior in a follow-up if people think TV and Watch should default to landscape (For TV I could see it make sense, for watch unsure). However, in this patch I'd rather focus on the macOS regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tvβs natural orientation should be landscape, if it even supports this API, but itβs not very important, not enough to change on a branch, certainly (but maybe on trunk).
For iPad, it seems the natural orientation is increasingly evolving to be landscape, but if it already was portrait, it doesnβt seem important to change it late in a release. (Maybe for a later release).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will follow-up for TV and iPad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up: #10803
2b671ee
to
e75c0a2
Compare
EWS run on previous version of this PR (hash e75c0a2) |
e75c0a2
to
491d27d
Compare
EWS run on current version of this PR (hash 491d27d) |
https://bugs.webkit.org/show_bug.cgi?id=253026 rdar://105891522 Reviewed by Wenson Hsieh and Darin Adler. The Twitch.tv login was failing because `screen.orientation` was returning "portrait-primary" on macOS. The natural/default orientation on desktop should be "landscape-primary" so this was confusing Twitch. Also update our `screen.angle` logic to take into account the natural orientation based on: - https://w3c.github.io/screen-orientation/#dfn-screen-orientation-values-table I have verified that Chrome on macOS returns "landscape-primary" for the type and 0 for the angle. Our behavior is now aligned. * LayoutTests/fast/screen-orientation/natural-orientation-expected.txt: Added. * LayoutTests/fast/screen-orientation/natural-orientation.html: Added. * LayoutTests/platform/ios/screen-orientation/natural-orientation-expected.txt: Added. * Source/WebCore/page/ScreenOrientation.cpp: (WebCore::ScreenOrientation::lock): * Source/WebCore/page/ScreenOrientationType.h: (WebCore::naturalScreenOrientationType): * Source/WebCore/platform/ScreenOrientationProvider.cpp: (WebCore::ScreenOrientationProvider::currentOrientation): * Source/WebKit/WebProcess/WebCoreSupport/WebScreenOrientationManager.cpp: (WebKit::WebScreenOrientationManager::currentOrientation): Canonical link: https://commits.webkit.org/260944@main
491d27d
to
541ca5a
Compare
Committed 260944@main (541ca5a): https://commits.webkit.org/260944@main Reviewed commits have been landed. Closing PR #10760 and removing active labels. |
541ca5a
491d27d
π wpeπ wincairoπ gtkπ§ͺ ios-wk2π§ͺ api-macπ§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-wk1π§ͺ api-gtkπ tvπ§ͺ mac-wk2π tv-simπ§ͺ mac-AS-debug-wk2π watchπ§ͺ mac-wk2-stress