Changeset 237886 in webkit
- Timestamp:
- Nov 6, 2018 1:58:29 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r237880 r237886 1 2018-11-06 Per Arne Vollan <pvollan@apple.com> 2 3 REGRESSION (r230523): Caps lock indicator not shown in password field 4 https://bugs.webkit.org/show_bug.cgi?id=190056 5 6 Reviewed by Ryosuke Niwa. 7 8 * TestExpectations: 9 * fast/events/detect-caps-lock-expected.txt: Added. 10 * fast/events/detect-caps-lock.html: Added. 11 * platform/mac/TestExpectations: 12 1 13 2018-11-06 Ali Juma <ajuma@chromium.org> 2 14 -
trunk/LayoutTests/TestExpectations
r237864 r237886 422 422 423 423 fast/misc/valid-primary-screen-displayID.html [ Skip ] 424 425 fast/events/detect-caps-lock.html [ Skip ] 424 426 425 427 # This test currently only works for mac-wk2 -
trunk/LayoutTests/platform/mac/TestExpectations
r237569 r237886 40 40 fast/text/mac [ Pass ] 41 41 webkit.org/b/181964 fast/text/mac/select-character-before-zero-width-joiner.html [ ImageOnlyFailure ] 42 43 [ Mojave+ ] fast/events/detect-caps-lock.html [ Pass ] 42 44 43 45 #////////////////////////////////////////////////////////////////////////////////////////// -
trunk/Source/WebCore/ChangeLog
r237884 r237886 1 2018-11-06 Per Arne Vollan <pvollan@apple.com> 2 3 REGRESSION (r230523): Caps lock indicator not shown in password field 4 https://bugs.webkit.org/show_bug.cgi?id=190056 5 6 Reviewed by Ryosuke Niwa. 7 8 When WindowServer access is blocked, GetCurrentModifiers() always returns 0. Instead of calling 9 GetCurrentModifiers(), store the current modifiers from the key event argument in the method 10 WebKit::WebPage::keyEvent, and use the stored value to detect if Caps lock is on. Additionally, 11 the modifiers needs to be updated when the window becomes active. 12 13 Test: fast/events/detect-caps-lock.html 14 15 * Sources.txt: 16 * platform/PlatformKeyboardEvent.h: 17 * platform/graphics/FontTaggedSettings.cpp: 18 * platform/mac/KeyEventMac.mm: 19 (WebCore::PlatformKeyboardEvent::currentCapsLockState): 20 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): 21 * testing/Internals.cpp: 22 (WebCore::Internals::capsLockIsOn): 23 * testing/Internals.h: 24 * testing/Internals.idl: 25 1 26 2018-11-06 Javier Fernandez <jfernandez@igalia.com> 2 27 -
trunk/Source/WebCore/Sources.txt
r237880 r237886 1543 1543 platform/Pasteboard.cpp 1544 1544 platform/PasteboardWriterData.cpp 1545 platform/PlatformKeyboardEvent.cpp 1545 1546 platform/PlatformSpeechSynthesisUtterance.cpp 1546 1547 platform/PlatformSpeechSynthesisVoice.cpp -
trunk/Source/WebCore/platform/PlatformKeyboardEvent.h
r237266 r237886 136 136 bool isSystemKey() const { return m_isSystemKey; } 137 137 138 static bool currentCapsLockState(); 139 static void getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey); 138 WEBCORE_EXPORT static bool currentCapsLockState(); 139 WEBCORE_EXPORT static void getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey); 140 WEBCORE_EXPORT static void setCurrentModifierState(OptionSet<Modifier>); 141 WEBCORE_EXPORT static OptionSet<Modifier> currentStateOfModifierKeys(); 140 142 141 143 #if PLATFORM(COCOA) … … 207 209 CompositionResults m_compositionResults; 208 210 #endif 211 212 // The modifier state is optional, since it is not needed in the UI process or in legacy WebKit. 213 static std::optional<OptionSet<Modifier>> s_currentModifiers; 209 214 }; 210 215 -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp
r237844 r237886 31 31 32 32 #include "CairoOperations.h" 33 #include "FloatRoundedRect.h" 33 34 #include "Font.h" 34 35 #include "GlyphBuffer.h" 35 36 #include "GraphicsContextPlatformPrivateCairo.h" 37 #include "ImageBuffer.h" 38 #include "IntRect.h" 39 36 40 37 41 namespace WebCore { -
trunk/Source/WebCore/platform/mac/KeyEventMac.mm
r236427 r237886 33 33 #import "WindowsKeyboardCodes.h" 34 34 #import <Carbon/Carbon.h> 35 #import <wtf/MainThread.h> 35 36 36 37 namespace WebCore { … … 260 261 bool PlatformKeyboardEvent::currentCapsLockState() 261 262 { 262 return GetCurrentKeyModifiers() & alphaLock; 263 auto currentModifiers = currentStateOfModifierKeys(); 264 return currentModifiers.contains(PlatformEvent::Modifier::CapsLockKey); 263 265 } 264 266 265 267 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 266 268 { 269 auto currentModifiers = currentStateOfModifierKeys(); 270 shiftKey = currentModifiers.contains(PlatformEvent::Modifier::ShiftKey); 271 ctrlKey = currentModifiers.contains(PlatformEvent::Modifier::CtrlKey); 272 altKey = currentModifiers.contains(PlatformEvent::Modifier::AltKey); 273 metaKey = currentModifiers.contains(PlatformEvent::Modifier::MetaKey); 274 } 275 276 OptionSet<PlatformEvent::Modifier> PlatformKeyboardEvent::currentStateOfModifierKeys() 277 { 278 #if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) 279 // s_currentModifiers is only set in the WebContent process, not in the UI process. 280 if (s_currentModifiers) { 281 ASSERT(isMainThread()); 282 return *s_currentModifiers; 283 } 284 #endif 267 285 UInt32 currentModifiers = GetCurrentKeyModifiers(); 268 shiftKey = currentModifiers & ::shiftKey; 269 ctrlKey = currentModifiers & ::controlKey; 270 altKey = currentModifiers & ::optionKey; 271 metaKey = currentModifiers & ::cmdKey; 286 287 OptionSet<PlatformEvent::Modifier> modifiers; 288 if (currentModifiers & ::shiftKey) 289 modifiers.add(PlatformEvent::Modifier::ShiftKey); 290 if (currentModifiers & ::controlKey) 291 modifiers.add(PlatformEvent::Modifier::CtrlKey); 292 if (currentModifiers & ::optionKey) 293 modifiers.add(PlatformEvent::Modifier::AltKey); 294 if (currentModifiers & ::cmdKey) 295 modifiers.add(PlatformEvent::Modifier::MetaKey); 296 if (currentModifiers & ::alphaLock) 297 modifiers.add(PlatformEvent::Modifier::CapsLockKey); 298 299 return modifiers; 272 300 } 273 301 -
trunk/Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h
r237642 r237886 24 24 25 25 #pragma once 26 27 #include <wtf/Forward.h> 26 28 27 29 #if ENABLE(MEDIA_STREAM) -
trunk/Source/WebCore/testing/Internals.cpp
r237837 r237886 122 122 #include "PageOverlay.h" 123 123 #include "PathUtilities.h" 124 #include "PlatformKeyboardEvent.h" 124 125 #include "PlatformMediaSessionManager.h" 125 126 #include "PlatformScreen.h" … … 4737 4738 } 4738 4739 4740 bool Internals::capsLockIsOn() 4741 { 4742 return WebCore::PlatformKeyboardEvent::currentCapsLockState(); 4743 } 4744 4739 4745 bool Internals::supportsVCPEncoder() 4740 4746 { -
trunk/Source/WebCore/testing/Internals.h
r237837 r237886 739 739 unsigned primaryScreenDisplayID(); 740 740 741 bool capsLockIsOn(); 742 741 743 bool supportsVCPEncoder(); 742 744 -
trunk/Source/WebCore/testing/Internals.idl
r237837 r237886 710 710 unsigned long primaryScreenDisplayID(); 711 711 712 boolean capsLockIsOn(); 713 712 714 boolean supportsVCPEncoder(); 713 715 -
trunk/Source/WebKit/ChangeLog
r237885 r237886 1 2018-11-06 Per Arne Vollan <pvollan@apple.com> 2 3 REGRESSION (r230523): Caps lock indicator not shown in password field 4 https://bugs.webkit.org/show_bug.cgi?id=190056 5 6 Reviewed by Ryosuke Niwa. 7 8 Update cached modifier state in the WebProcess when WebKit::WebPage::keyEvent is called, and 9 when the window becomes active. 10 11 * UIProcess/WebPageProxy.cpp: 12 (WebKit::WebPageProxy::dispatchActivityStateChange): 13 (WebKit::WebPageProxy::updateCurrentModifierState): 14 * UIProcess/WebPageProxy.h: 15 * WebProcess/WebPage/WebPage.cpp: 16 (WebKit::WebPage::keyEvent): 17 (WebKit::WebPage::updateCurrentModifierState): 18 * WebProcess/WebPage/WebPage.h: 19 * WebProcess/WebPage/WebPage.messages.in: 20 1 21 2018-11-06 Alex Christensen <achristensen@webkit.org> 2 22 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r237863 r237886 146 146 #include <WebCore/MediaStreamRequest.h> 147 147 #include <WebCore/PerformanceLoggingClient.h> 148 #include <WebCore/PlatformEvent.h> 148 149 #include <WebCore/PublicSuffix.h> 149 150 #include <WebCore/RenderEmbeddedObject.h> … … 1561 1562 if (changed) 1562 1563 LOG_WITH_STREAM(ActivityState, stream << "WebPageProxy " << pageID() << " dispatchActivityStateChange: state changed from " << previousActivityState << " to " << m_activityState); 1564 1565 if ((changed & ActivityState::WindowIsActive) && isViewWindowActive()) 1566 updateCurrentModifierState(); 1563 1567 1564 1568 if ((m_potentiallyChangedActivityStateFlags & ActivityState::IsVisible) && isViewVisible()) … … 8126 8130 } 8127 8131 8132 void WebPageProxy::updateCurrentModifierState() 8133 { 8134 #if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) 8135 auto modifiers = PlatformKeyboardEvent::currentStateOfModifierKeys(); 8136 m_process->send(Messages::WebPage::UpdateCurrentModifierState(modifiers), m_pageID); 8137 #endif 8138 } 8139 8128 8140 } // namespace WebKit 8129 8141 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r237639 r237886 1852 1852 #endif 1853 1853 1854 void updateCurrentModifierState(); 1855 1854 1856 void reportPageLoadResult(const WebCore::ResourceError& = { }); 1855 1857 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r237614 r237886 2565 2565 m_userActivityHysteresis.impulse(); 2566 2566 2567 PlatformKeyboardEvent::setCurrentModifierState(platform(keyboardEvent).modifiers()); 2568 2567 2569 CurrentEvent currentEvent(keyboardEvent); 2568 2570 … … 6312 6314 #endif // ENABLE(APPLICATION_MANIFEST) 6313 6315 6316 void WebPage::updateCurrentModifierState(OptionSet<PlatformEvent::Modifier> modifiers) 6317 { 6318 PlatformKeyboardEvent::setCurrentModifierState(modifiers); 6319 } 6320 6314 6321 } // namespace WebKit 6315 6322 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r237480 r237886 1092 1092 #endif 1093 1093 1094 void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers); 1095 1094 1096 UserContentControllerIdentifier userContentControllerIdentifier() const { return m_userContentController->identifier(); } 1095 1097 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r237467 r237886 528 528 529 529 SetDefersLoading(bool defersLoading) 530 531 UpdateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers) 530 532 } -
trunk/Tools/ChangeLog
r237882 r237886 1 2018-11-06 Per Arne Vollan <pvollan@apple.com> 2 3 REGRESSION (r230523): Caps lock indicator not shown in password field 4 https://bugs.webkit.org/show_bug.cgi?id=190056 5 6 Reviewed by Ryosuke Niwa. 7 8 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 9 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 10 (WTR::TestRunner::toggleCapsLock): 11 * WebKitTestRunner/InjectedBundle/TestRunner.h: 12 * WebKitTestRunner/TestController.h: 13 * WebKitTestRunner/TestInvocation.cpp: 14 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 15 * WebKitTestRunner/cocoa/TestControllerCocoa.mm: 16 (WTR::TestController::toggleCapsLock): 17 1 18 2018-11-06 Sihui Liu <sihui_liu@apple.com> 2 19 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r237700 r237886 360 360 void cleanUpKeychain(DOMString attrLabel); 361 361 boolean keyExistsInKeychain(DOMString attrLabel, DOMString applicationTagBase64); 362 363 void toggleCapsLock(); 362 364 }; -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r237700 r237886 2514 2514 } 2515 2515 2516 void TestRunner::toggleCapsLock() 2517 { 2518 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ToggleCapsLock")); 2519 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); 2520 } 2521 2516 2522 } // namespace WTR -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r237700 r237886 478 478 bool keyExistsInKeychain(JSStringRef attrLabel, JSStringRef applicationTagBase64); 479 479 480 void toggleCapsLock(); 481 480 482 private: 481 483 TestRunner(); -
trunk/Tools/WebKitTestRunner/TestController.h
r237870 r237886 261 261 bool keyExistsInKeychain(const String& attrLabel, const String& applicationTagBase64); 262 262 263 void toggleCapsLock(); 264 263 265 private: 264 266 WKRetainPtr<WKPageConfigurationRef> generatePageConfiguration(WKContextConfigurationRef); … … 489 491 bool m_didReceiveServerRedirectForProvisionalNavigation { false }; 490 492 493 bool m_capsLockOn { false }; 494 491 495 WKRetainPtr<WKArrayRef> m_openPanelFileURLs; 492 496 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r237700 r237886 1504 1504 } 1505 1505 1506 #if PLATFORM(MAC) 1507 if (WKStringIsEqualToUTF8CString(messageName, "ToggleCapsLock")) { 1508 TestController::singleton().toggleCapsLock(); 1509 return nullptr; 1510 } 1511 #endif 1512 1506 1513 ASSERT_NOT_REACHED(); 1507 1514 return nullptr; -
trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
r237870 r237886 352 352 } 353 353 354 #if PLATFORM(MAC) 355 void TestController::toggleCapsLock() 356 { 357 m_capsLockOn = !m_capsLockOn; 358 NSEvent *fakeEvent = [NSEvent keyEventWithType:NSEventTypeFlagsChanged 359 location:NSZeroPoint 360 modifierFlags:m_capsLockOn ? NSEventModifierFlagCapsLock : 0 361 timestamp:0 362 windowNumber:[mainWebView()->platformWindow() windowNumber] 363 context:nullptr 364 characters:@"" 365 charactersIgnoringModifiers:@"" 366 isARepeat:NO 367 keyCode:57]; 368 369 [mainWebView()->platformWindow() sendEvent:fakeEvent]; 370 } 371 #endif 372 354 373 } // namespace WTR
Note: See TracChangeset
for help on using the changeset viewer.