[Webkit-unassigned] [Bug 135286] New: highlight-insert-paragraph mixing KeyEvent and KeyboardEvent

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 25 03:27:51 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=135286

           Summary: highlight-insert-paragraph mixing KeyEvent and
                    KeyboardEvent
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: Minor
          Priority: P2
         Component: Event Handling
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: fvallee at connected-labs.com


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);
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list