Changeset 44941 in webkit


Ignore:
Timestamp:
Jun 22, 2009 10:33:23 AM (15 years ago)
Author:
ap@webkit.org
Message:

Reviewed by John Sullivan.

<rdar://problem/6956606> REGRESSION (S4Beta -> Final): After the password is input,
Japanese can't be input.

WebKit uses a per-frame input context for most editable fields, and application's global
context for password fields, manually controlling secure input state and the list of available
input methods.

We were setting TSMDocument property to disable non-Roman input methods after focus changed
to a password field, but before selection was updated. This resulted in the property being
applied to a wrong TSMDocument in some cases, because TSMGetActiveDocument() uses input
context cached by +[NSApplication updateWindows], we change context based on selection,
not on focus.

  • page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry): Since there is only one context that we use for password fields - the global one - there is no need to get the active one.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44940 r44941  
     12009-06-22  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by John Sullivan.
     4
     5        <rdar://problem/6956606> REGRESSION (S4Beta -> Final): After the password is input,
     6        Japanese can't be input.
     7
     8        WebKit uses a per-frame input context for most editable fields, and application's global
     9        context for password fields, manually controlling secure input state and the list of available
     10        input methods.
     11
     12        We were setting TSMDocument property to disable non-Roman input methods after focus changed
     13        to a password field, but before selection was updated. This resulted in the property being
     14        applied to a wrong TSMDocument in some cases, because TSMGetActiveDocument() uses input
     15        context cached by +[NSApplication updateWindows], we change context based on selection,
     16        not on focus.
     17
     18        * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry): Since there is only one
     19        context that we use for password fields - the global one - there is no need to get the active
     20        one.
     21
    1222009-06-22  David Levin  <levin@chromium.org>
    223
  • trunk/WebCore/page/mac/FrameMac.mm

    r43672 r44941  
    471471        KeyScript(enableRomanKeyboardsOnly);
    472472#else
     473        // WebKit substitutes nil for input context when in password field, which corresponds to null TSMDocument. So, there is
     474        // no need to call TSMGetActiveDocument(), which may return an incorrect result when selection hasn't been yet updated
     475        // after focusing a node.
    473476        CFArrayRef inputSources = TISCreateASCIICapableInputSourceList();
    474         TSMSetDocumentProperty(TSMGetActiveDocument(), kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources);
     477        TSMSetDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources);
    475478        CFRelease(inputSources);
    476479#endif
     
    480483        KeyScript(smKeyEnableKybds);
    481484#else
    482         TSMRemoveDocumentProperty(TSMGetActiveDocument(), kTSMDocumentEnabledInputSourcesPropertyTag);
     485        TSMRemoveDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag);
    483486#endif
    484487    }
  • trunk/WebKit/mac/ChangeLog

    r44939 r44941  
     12009-06-22  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by John Sullivan.
     4
     5        <rdar://problem/6956606> REGRESSION (S4Beta -> Final): After the password is input,
     6        Japanese can't be input.
     7
     8        * WebView/WebHTMLView.mm: (-[WebHTMLView _updateSelectionForInputManager]): Removed an
     9        unnecessary check - the function has an early return for null frame.
     10
    1112009-06-22  Dan Bernstein  <mitz@apple.com>
    212
  • trunk/WebKit/mac/WebView/WebHTMLView.mm

    r44753 r44941  
    57825782        // Let AppKit cache a potentially changed input context.
    57835783        // WebCore routinely sets the selection to None when editing, and IMs become unhappy when an input context suddenly turns nil, see bug 26009.
    5784         if (!coreFrame || !coreFrame->selection()->isNone())
     5784        if (!coreFrame->selection()->isNone())
    57855785            [NSApp updateWindows];
    57865786    }
Note: See TracChangeset for help on using the changeset viewer.