Title: [185020] trunk/Source/WebCore
Revision
185020
Author
[email protected]
Date
2015-05-29 16:59:26 -0700 (Fri, 29 May 2015)

Log Message

Clean up logic for updating caps lock indicator state
https://bugs.webkit.org/show_bug.cgi?id=145329

Reviewed by Sam Weinig.

Remove logic to explicitly update the state of the caps lock indicator, which was used
when the caps logic indicator was implemented as part of RenderTextControl. Currently,
the caps logic indicator is implemented as part of a shadow DOM and we have existing
logic to forward DOM focus and blur events to it so that it may update its state.

No change in behavior.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::focusedOrActiveStateChanged): Deleted.
* editing/FrameSelection.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent): Inline the code from EventHandler::capsLockStateMayHaveChanged()
into this function because it is the only caller of EventHandler::capsLockStateMayHaveChanged() after
we removed the call site in FrameSelection::focusedOrActiveStateChanged().
(WebCore::EventHandler::capsLockStateMayHaveChanged): Deleted.
* page/EventHandler.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (185019 => 185020)


--- trunk/Source/WebCore/ChangeLog	2015-05-29 23:53:24 UTC (rev 185019)
+++ trunk/Source/WebCore/ChangeLog	2015-05-29 23:59:26 UTC (rev 185020)
@@ -1,3 +1,27 @@
+2015-05-29  Daniel Bates  <[email protected]>
+
+        Clean up logic for updating caps lock indicator state
+        https://bugs.webkit.org/show_bug.cgi?id=145329
+
+        Reviewed by Sam Weinig.
+
+        Remove logic to explicitly update the state of the caps lock indicator, which was used
+        when the caps logic indicator was implemented as part of RenderTextControl. Currently,
+        the caps logic indicator is implemented as part of a shadow DOM and we have existing
+        logic to forward DOM focus and blur events to it so that it may update its state.
+
+        No change in behavior.
+
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::focusedOrActiveStateChanged): Deleted.
+        * editing/FrameSelection.h:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::keyEvent): Inline the code from EventHandler::capsLockStateMayHaveChanged()
+        into this function because it is the only caller of EventHandler::capsLockStateMayHaveChanged() after
+        we removed the call site in FrameSelection::focusedOrActiveStateChanged().
+        (WebCore::EventHandler::capsLockStateMayHaveChanged): Deleted.
+        * page/EventHandler.h:
+
 2015-05-29  Zalan Bujtas  <[email protected]>
 
         Text disappears shortly after page load on Nexus 7 site.

Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (185019 => 185020)


--- trunk/Source/WebCore/editing/FrameSelection.cpp	2015-05-29 23:53:24 UTC (rev 185019)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp	2015-05-29 23:59:26 UTC (rev 185020)
@@ -1839,9 +1839,6 @@
         setSelectionFromNone();
     setCaretVisibility(activeAndFocused ? Visible : Hidden);
 
-    // Update for caps lock state
-    m_frame->eventHandler().capsLockStateMayHaveChanged();
-
     // Because StyleResolver::checkOneSelector() and
     // RenderTheme::isFocused() check if the frame is active, we have to
     // update style and theme state that depended on those.

Modified: trunk/Source/WebCore/editing/FrameSelection.h (185019 => 185020)


--- trunk/Source/WebCore/editing/FrameSelection.h	2015-05-29 23:53:24 UTC (rev 185019)
+++ trunk/Source/WebCore/editing/FrameSelection.h	2015-05-29 23:59:26 UTC (rev 185020)
@@ -200,7 +200,7 @@
     bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; }
 
     // Focus
-    WEBCORE_EXPORT void setFocused(bool);
+    void setFocused(bool);
     bool isFocused() const { return m_focused; }
     WEBCORE_EXPORT bool isFocusedAndActive() const;
     void pageActivationChanged();

Modified: trunk/Source/WebCore/page/EventHandler.cpp (185019 => 185020)


--- trunk/Source/WebCore/page/EventHandler.cpp	2015-05-29 23:53:24 UTC (rev 185019)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2015-05-29 23:59:26 UTC (rev 185020)
@@ -3078,8 +3078,12 @@
         return false;
 #endif
 
-    if (initialKeyEvent.windowsVirtualKeyCode() == VK_CAPITAL)
-        capsLockStateMayHaveChanged();
+    if (initialKeyEvent.windowsVirtualKeyCode() == VK_CAPITAL) {
+        if (auto* element = m_frame.document()->focusedElement()) {
+            if (is<HTMLInputElement>(*element))
+                downcast<HTMLInputElement>(*element).capsLockStateMayHaveChanged();
+        }
+    }
 
 #if ENABLE(PAN_SCROLLING)
     if (m_frame.mainFrame().eventHandler().panScrollInProgress()) {
@@ -3750,15 +3754,6 @@
         event->setDefaultHandled();
 }
 
-void EventHandler::capsLockStateMayHaveChanged()
-{
-    Document* document = m_frame.document();
-    if (auto* element = document->focusedElement()) {
-        if (is<HTMLInputElement>(*element))
-            downcast<HTMLInputElement>(*element).capsLockStateMayHaveChanged();
-    }
-}
-
 void EventHandler::sendScrollEvent()
 {
     setFrameWasScrolledByUser();

Modified: trunk/Source/WebCore/page/EventHandler.h (185019 => 185020)


--- trunk/Source/WebCore/page/EventHandler.h	2015-05-29 23:53:24 UTC (rev 185019)
+++ trunk/Source/WebCore/page/EventHandler.h	2015-05-29 23:59:26 UTC (rev 185020)
@@ -259,8 +259,6 @@
 #endif
 
     void focusDocumentView();
-
-    void capsLockStateMayHaveChanged(); // Only called by FrameSelection
     
     WEBCORE_EXPORT void sendScrollEvent(); // Ditto
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to