haikuwebkit/LayoutTests/fast/shadow-dom/focus-navigation-passes-sha...

33 lines
875 B
HTML
Raw Permalink Normal View History

REGRESSION(r200964): Tab focus navigation is broken on results.en.voyages-sncf.com https://bugs.webkit.org/show_bug.cgi?id=164888 Reviewed by Antti Koivisto. Source/WebCore: The bug was caused by FocusNavigationScope::parentInScope incorrectly returning nullptr when moving out of a user agent shadow tree of a SVG use element. Fixed the bug by explicitly checking against the focus scope's root node or its slot element. Also removed a superfluous early return when the parent node is a focus scope. Tests: fast/shadow-dom/focus-navigation-out-of-slot.html fast/shadow-dom/focus-navigation-passes-shadow-host.html fast/shadow-dom/focus-navigation-passes-svg-use-element.html * page/FocusController.cpp: (WebCore::FocusNavigationScope::parentInScope): LayoutTests: Add regression tests for moving the focus across a shadow tree and a SVG use element and the one that moves out of a slot element. * fast/shadow-dom/focus-navigation-out-of-slot-expected.txt: Added. * fast/shadow-dom/focus-navigation-out-of-slot.html: Added. * fast/shadow-dom/focus-navigation-passes-shadow-host-expected.txt: Added. * fast/shadow-dom/focus-navigation-passes-shadow-host.html: Added. * fast/shadow-dom/focus-navigation-passes-svg-use-element-expected.txt: Added. * fast/shadow-dom/focus-navigation-passes-svg-use-element.html: Added. * platform/ios-simulator/TestExpectations: Skip the newly added tests on iOS. Canonical link: https://commits.webkit.org/182631@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-19 08:02:03 +00:00
<!DOCTYPE html>
<html>
<body>
<p>This tests moving a focus across slotted input elements.
To test manually, press Tab key to move the focus from the first input element to the next.</p>
<div>
<div><input id="first"> <span></span></div>
<div><input id="second"></div>
</div>
<div id="result">FAIL</div>
<script>
document.querySelector('span').attachShadow({mode: 'closed'}).innerHTML = '';
document.getElementById('first').focus();
const resultElement = document.getElementById('result');
const secondInputElement = document.getElementById('second');
if (window.eventSender) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
eventSender.keyDown('\t');
setTimeout(() => {
resultElement.textContent = document.activeElement == secondInputElement ? 'PASS' : 'FAIL'
testRunner.notifyDone();
}, 1);
}
</script>
</body>
</html>