Bug 1764512 - Find in page should ignore content skipped via `content-visibility` r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D143573
This commit is contained in:
Martin Robinson 2022-04-21 06:33:59 +00:00
Родитель f9f0d556a7
Коммит c2e4c343e0
3 изменённых файлов: 14 добавлений и 0 удалений

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

@ -143,6 +143,10 @@ static bool IsVisibleNode(const nsINode* aNode) {
return true;
}
if (frame->IsContentHidden() || frame->AncestorHidesContent()) {
return false;
}
return frame->StyleVisibility()->IsVisible();
}

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

@ -1,2 +1,4 @@
[test_bug499115.html]
[test_nsFind.html]
prefs =
layout.css.content-visibility.enabled=true

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

@ -269,6 +269,10 @@ async function runTests() {
assertFound(nullcharsinjected, NULL_CHARACTER);
assertFound(nullcharsinjected, INJECTED_NULL_TEXT);
// Content skipped via content-visibility can't be found.
assertNotFound(quotes, "Tardigrade");
assertNotFound(quotes, "Amoeba");
// Do these test at the end since they trigger failure screenshots in
// the test harness, and we want as much information as possible about
// any OTHER tests that may have already failed.
@ -337,6 +341,10 @@ async function runTests() {
<p id="guarani">G̃uahe</p>
<p id="deseret">𐐐𐐯𐑊𐐬 𐐶𐐯𐑉𐑊𐐼!</p>
<p id="ruby"><ruby><rt>とう</rt></ruby><ruby><rt>きょう</ruby></p>
<div id="content-visibility-hidden" style="content-visibility: hidden">
Tardigrade
<div>Amoeba</div>
</div>
<div id="content" style="display: none">
</div>