зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1618678 - Make scrollbar style caching work on Android. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D65915 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
958e711f07
Коммит
84a2155141
|
@ -3863,7 +3863,8 @@ nsresult nsCSSFrameConstructor::GetAnonymousContent(
|
|||
// * when visibility or pointer-events is anything other than the initial
|
||||
// value; we rely on visibility and pointer-events inheriting into anonymous
|
||||
// content, but don't bother adding this state to the AnonymousContentKey,
|
||||
// since it's not so common
|
||||
// since it's not so common. Note that on android scrollbars always have
|
||||
// pointer-events: none so we don't need to check for that.
|
||||
//
|
||||
// * when the medium is anything other than screen; some UA style sheet rules
|
||||
// apply in e.g. print medium, and will give different results from the
|
||||
|
@ -3871,7 +3872,9 @@ nsresult nsCSSFrameConstructor::GetAnonymousContent(
|
|||
bool allowStyleCaching =
|
||||
StaticPrefs::layout_css_cached_scrollbar_styles_enabled() &&
|
||||
aParentFrame->StyleVisibility()->mVisible == StyleVisibility::Visible &&
|
||||
#ifndef ANDROID
|
||||
aParentFrame->StyleUI()->mPointerEvents == StylePointerEvents::Auto &&
|
||||
#endif
|
||||
mPresShell->GetPresContext()->Medium() == nsGkAtoms::screen;
|
||||
|
||||
// Compute styles for the anonymous content tree.
|
||||
|
@ -3925,6 +3928,9 @@ nsresult nsCSSFrameConstructor::GetAnonymousContent(
|
|||
cachedStyles[i]->EqualForCachedAnonymousContentStyle(*cs),
|
||||
"cached anonymous content styles should be identical to those we "
|
||||
"would compute normally");
|
||||
#ifdef ANDROID
|
||||
MOZ_ASSERT(cs->StyleUI()->mPointerEvents == StylePointerEvents::None);
|
||||
#endif
|
||||
#endif
|
||||
Servo_SetExplicitStyle(elements[i], cachedStyles[i]);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,13 @@ xul|scrollbar {
|
|||
display: block;
|
||||
}
|
||||
|
||||
/* We don't show resizers on android, so they may as well have
|
||||
* pointer-events: none to simplify scrollbar caching */
|
||||
xul|resizer,
|
||||
xul|scrollcorner {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
xul|scrollbar[orient="vertical"] {
|
||||
min-width: 6px;
|
||||
max-width: 6px;
|
||||
|
|
Загрузка…
Ссылка в новой задаче