haikuwebkit/LayoutTests/accessibility/accessibility-object-update...

30 lines
906 B
HTML
Raw Permalink Normal View History

Release assert in updateLayout() via AXObjectCache::childrenChanged https://bugs.webkit.org/show_bug.cgi?id=182279 <rdar://problem/36994456> Reviewed by Antti Koivisto. Source/WebCore: Disable the assertion in Document::updateLayout and Document::updateStyle* in this particular circumstance as fixing it would require a large architectural refactoring of the accessibility code. Test: accessibility/accessibility-object-update-during-style-resolution-crash.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::childrenChanged): Disabled the release assertion here. * dom/Document.cpp: (WebCore::Document::isSafeToUpdateStyleOrLayout const): Check LayoutAssertionDisableScope::shouldDisable. * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Added. (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::LayoutAssertionDisableScope): Added. (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::~LayoutAssertionDisableScope): Added. (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable): Added. * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): Check LayoutAssertionDisableScope::shouldDisable. LayoutTests: Added a regression test. * accessibility/accessibility-object-update-during-style-resolution-crash-expected.txt: Added. * accessibility/accessibility-object-update-during-style-resolution-crash.html: Added. Canonical link: https://commits.webkit.org/198109@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-30 22:47:05 +00:00
<!DOCTYPE html>
<html>
<body>
<p>This tests invoking updateLayout durign a live region update from the style recalc.<br>
WebKit should not hit a release assertion.</p>
<section style="display: none">
<label for="input"><input id="input" type="text" aria-labelledby="hello"><div id="in-label" aria-live="polite"></div></label>
<span id="hello">hello</span>
</section>
<script>
function runTest()
{
document.querySelector('section').style.display = null;
document.body.getBoundingClientRect();
}
if (window.testRunner) {
testRunner.dumpAsText();
document.body.getBoundingClientRect();
const webArea = accessibilityController.rootElement.childAtIndex(0);
runTest();
document.querySelector('section').style.display = 'none';
document.write('PASS. WebKit did not crash.');
} else
document.write('<button onclick="runTest()">Go</button>');
</script>
</body>
</html>