REGRESSION (251257@main): [ macOS wk1 ] fast/replaced/encrypted-pdf-as-object-and-embed.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=241879
<rdar://95728601>
Reviewed by Antoine Quint.
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::updateQueryContainerState):
Null test the view. It can be null on WK1.
Canonical link: https://commits.webkit.org/251780@main
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@295775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/platform/mac-wk1/TestExpectations b/LayoutTests/platform/mac-wk1/TestExpectations
index b708db6..d1dee4e 100644
--- a/LayoutTests/platform/mac-wk1/TestExpectations
+++ b/LayoutTests/platform/mac-wk1/TestExpectations
@@ -1852,5 +1852,3 @@
webkit.org/b/241266 compositing/video/video-border-radius.html [ Pass Timeout ]
webkit.org/b/241376 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-035.html [ Pass ImageOnlyFailure ]
-
-webkit.org/b/241879 fast/replaced/encrypted-pdf-as-object-and-embed.html [ Pass Crash ]
diff --git a/Source/WebCore/style/StyleScope.cpp b/Source/WebCore/style/StyleScope.cpp
index bb1b41d..645b3b8 100644
--- a/Source/WebCore/style/StyleScope.cpp
+++ b/Source/WebCore/style/StyleScope.cpp
@@ -794,7 +794,9 @@
bool Scope::updateQueryContainerState(QueryContainerUpdateContext& context)
{
ASSERT(!m_shadowRoot);
- ASSERT(m_document.renderView());
+
+ if (!m_document.renderView())
+ return false;
auto previousStates = WTFMove(m_queryContainerStates);
m_queryContainerStates.clear();