Bug 1677774 - don't clear descendant's overrides when setting TouchEventsOverride. r=farre
This should prevent content process crashes when there are cross-origin descendants with an override set. There is a slight change in behaviour when an override is set after a descendant context has previously set one. This shouldn't be a problem since devtools only wants to expose touch simulation at the tab level. Additionally this new behaviour is reasonable and would allow devtools to implement the same semantics by doing the clearing themselves (if needed). Differential Revision: https://phabricator.services.mozilla.com/D97797
This commit is contained in:
@@ -2405,19 +2405,6 @@ mozilla::dom::TouchEventsOverride BrowsingContext::TouchEventsOverride() const {
|
||||
|
||||
void BrowsingContext::SetTouchEventsOverride(
|
||||
const enum TouchEventsOverride aTouchEventsOverride, ErrorResult& aRv) {
|
||||
// Clear overrides from descendents first.
|
||||
for (BrowsingContext* child : Children()) {
|
||||
child->PreOrderWalk([](BrowsingContext* aContext) {
|
||||
if (aContext->GetTouchEventsOverrideInternal() !=
|
||||
mozilla::dom::TouchEventsOverride::None) {
|
||||
// Ignore failed sets because the override of a discarded
|
||||
// descendent shouldn't matter.
|
||||
Unused << aContext->SetTouchEventsOverrideInternal(
|
||||
mozilla::dom::TouchEventsOverride::None);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
SetTouchEventsOverrideInternal(aTouchEventsOverride, aRv);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user