Skip to content

Commit

Permalink
Make the inert flag independently inherit
Browse files Browse the repository at this point in the history
Improve performance of changing inertness.

Bug: 1360404
Change-Id: I1fa793d6023c6a80bee69ffc5157615419602a15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3877003
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1043693}
  • Loading branch information
lilles authored and Chromium LUCI CQ committed Sep 6, 2022
1 parent a629fa0 commit 526c5a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ static void AdjustStyleForInert(ComputedStyle& style, Element* element) {

if (element->IsInertRoot()) {
style.SetIsInert(true);
style.SetIsInertIsInherited(false);
return;
}

Expand All @@ -778,10 +779,12 @@ static void AdjustStyleForInert(ComputedStyle& style, Element* element) {
modal_element = Fullscreen::FullscreenElementFrom(document);
if (modal_element == element) {
style.SetIsInert(false);
style.SetIsInertIsInherited(false);
return;
}
if (modal_element && element == document.documentElement()) {
style.SetIsInert(true);
style.SetIsInertIsInherited(false);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@
// https://html.spec.whatwg.org/multipage/interaction.html#inert
name: "IsInert",
inherited: true,
independent: true,
field_template: "primitive",
type_name: "bool",
default_value: "false",
Expand Down

0 comments on commit 526c5a4

Please sign in to comment.