1. Start headless X server. Start basic window manager on it.
2. Run reftests with said X server. Take note of failing tests.
3. Disable all reftests that need focus:
find $topsrcdir -name '*.list' | xargs sed -i -e '/needs-focus/s/^/#/'
4. Make reftest.js:Focus never focus the window and always return true.
5. Start reftests with said X server again. Once the tests begin
running, start a xterm on the same X server. The window manager will
focus this xterm and will not return focus to the browser.
6. Compare now-failing tests with baseline. Mark all such tests as
needs-focus.
Comments on specific tests:
editor/reftests/
- spellcheck-input-ref.html and spellcheck-textarea-ref.html focus
input elements and don't work right without the window having focus.
- spellcheck-hyphen-invalid-ref.html and
spellcheck-hyphen-multiple-invalid-ref.html use @autofocus on
textarea.
- 674212-spellcheck.html, 338427-2.html, and
462758-grabbers-resizers.html all wait for onfocus for div elements.
layout/reftests/bugs/
- 652301-1b.html focuses a bogus element with an onfocus handler.
layout/reftests/selection/
- pseudo-element-of-native-anonymous-ref.html .select()s an <input>.
This patch was created by running the following sed commands:
s/MOZ_WIDGET_TOOLKIT=="\(gtk2\|cocoa\|qt\|windows\)"/\1Widget/g
s/MOZ_WIDGET_TOOLKIT!="\(gtk2\|cocoa\|qt\|windows\)"/!\1Widget/g
on all *.list files in the tree.