Bug 135286
| Summary: | highlight-insert-paragraph regression test mixing KeyEvent and KeyboardEvent | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Fabien Vallée <fvallee> |
| Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Minor | CC: | rniwa |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | Linux | ||
Fabien Vallée
LayoutTests/editing/style/highlight-insert-paragraph.html is mixing
- KeyEvent (e.g. defined in CEHTML, but seems firefox is using it too)
and
- KeyboardEvent ( http://www.w3.org/TR/DOM-Level-3-Events/#widl-KeyboardEvent-shiftKey )
in pressKey function
if (window.KeyEvent) {
var ev = document.createEvent("KeyboardEvent");
ev.initKeyEvent("keypress", true, true, window, 0,0,0,0, 0, key.charCodeAt(0));
document.body.dispatchEvent(ev);
}
I assume the test mean to use Keyboard event, so the code should be something like :
function pressKey( key ) {
- if (window.KeyEvent) {
+ if (window.KeyboardEvent) {
var ev = document.createEvent("KeyboardEvent");
- ev.initKeyEvent("keypress", true, true, window, 0,0,0,0, 0, key.charCodeAt(0));
+ ev.initKeyboardEvent("keypress", true, true, window, 0,0,0,0, 0, key.charCodeAt(0));
document.body.dispatchEvent(ev);
}
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Fabien Vallée
please note that window.KeyEvent is not defined, so the test is never using this code... Maybe it can just be removed.
Fabien Vallée
Same issue can also be found in :
LayoutTests/editing/inserting/insert-paragraph-separator-in-blockquote.html
LayoutTests/editing/inserting/typing-space-to-trigger-smart-link.html
LayoutTests/editing/execCommand/script-tests/break-out-of-empty-list-item.js