Bug 1585880 - Ensure pointer-events inherits into scrollbar parts. r=emilio

Like visibility, we rely on pointer-events values inheriting down into
scrollbar part elements.  So don't cached NAC styles for scrollbar parts
if we have a non-initial value for pointer-events, and adjust the UA
style sheet rules to ensure it is always inherited.

Differential Revision: https://phabricator.services.mozilla.com/D49359

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Cameron McCormack 2019-10-16 08:20:56 +00:00
Родитель a0b4a1fee2
Коммит bdb510a010
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -4003,9 +4003,10 @@ nsresult nsCSSFrameConstructor::GetAnonymousContent(
// Some situations where we don't cache anonymous content styles:
//
// * when visibility is anything other than visible; we rely on visibility
// inheriting into anonymous content, but don't bother adding this state
// to the AnonymousContentKey, since it's not so common
// * 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
//
// * 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
@ -4014,6 +4015,7 @@ nsresult nsCSSFrameConstructor::GetAnonymousContent(
StaticPrefs::layout_css_cached_scrollbar_styles_enabled() &&
aParentFrame->StyleVisibility()->mVisible ==
NS_STYLE_VISIBILITY_VISIBLE &&
aParentFrame->StyleUI()->mPointerEvents == NS_STYLE_POINTER_EVENTS_AUTO &&
mPresShell->GetPresContext()->Medium() == nsGkAtoms::screen;
// Compute styles for the anonymous content tree.

Просмотреть файл

@ -42,11 +42,12 @@
scrollcorner, resizer, scrollbar, scrollbarbutton, slider {
/* All scrollbar parts must not inherit any properties from the scrollable
* element (except for visibility), for the anonymous content style caching
* system to work.
* element (except for visibility and pointer-events), for the anonymous
* content style caching system to work.
*/
all: initial;
visibility: inherit;
pointer-events: inherit;
/* These properties are not included in 'all'. */
-moz-list-reversed: initial;