Title: [266805] trunk/Source/WebCore
Revision
266805
Author
[email protected]
Date
2020-09-09 16:04:28 -0700 (Wed, 09 Sep 2020)

Log Message

Remove unused enum PostType.
https://bugs.webkit.org/show_bug.cgi?id=216320

Reviewed by Chris Fleizach.

No functionality change.
- Removed the unused enum PostType, since all AX notifications are now
posted asynchronously.
- PostTarget is now an enum class.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::postNotification):
(WebCore::AXObjectCache::selectedChildrenChanged):
(WebCore::AXObjectCache::postTextStateChangeNotification):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::postNotification):
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::didUpdateActiveOption):
* accessibility/AccessibilityMenuListPopup.cpp:
(WebCore::AccessibilityMenuListPopup::didUpdateActiveOption):
* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
* editing/Editor.cpp:
(WebCore::Editor::respondToChangedContents):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (266804 => 266805)


--- trunk/Source/WebCore/ChangeLog	2020-09-09 22:54:40 UTC (rev 266804)
+++ trunk/Source/WebCore/ChangeLog	2020-09-09 23:04:28 UTC (rev 266805)
@@ -1,3 +1,32 @@
+2020-09-09  Andres Gonzalez  <[email protected]>
+
+        Remove unused enum PostType.
+        https://bugs.webkit.org/show_bug.cgi?id=216320
+
+        Reviewed by Chris Fleizach.
+
+        No functionality change.
+        - Removed the unused enum PostType, since all AX notifications are now
+        posted asynchronously.
+        - PostTarget is now an enum class.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::postNotification):
+        (WebCore::AXObjectCache::selectedChildrenChanged):
+        (WebCore::AXObjectCache::postTextStateChangeNotification):
+        * accessibility/AXObjectCache.h:
+        (WebCore::AXObjectCache::postNotification):
+        * accessibility/AccessibilityMenuList.cpp:
+        (WebCore::AccessibilityMenuList::didUpdateActiveOption):
+        * accessibility/AccessibilityMenuListPopup.cpp:
+        (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption):
+        * accessibility/ios/AXObjectCacheIOS.mm:
+        (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
+        * editing/Editor.cpp:
+        (WebCore::Editor::respondToChangedContents):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::setInnerTextValue):
+
 2020-09-09  Zalan Bujtas  <[email protected]>
 
         [Repaint] styleWillChange may call repaint on the same renderer multiple times.

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (266804 => 266805)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2020-09-09 22:54:40 UTC (rev 266804)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2020-09-09 23:04:28 UTC (rev 266805)
@@ -1106,8 +1106,8 @@
         postTextStateChangePlatformNotification(notification.get(), AXTextEditTypeInsert, " ", VisiblePosition());
 #endif
 }
-    
-void AXObjectCache::postNotification(RenderObject* renderer, AXNotification notification, PostTarget postTarget, PostType postType)
+
+void AXObjectCache::postNotification(RenderObject* renderer, AXNotification notification, PostTarget postTarget)
 {
     if (!renderer)
         return;
@@ -1125,10 +1125,10 @@
     if (!renderer)
         return;
     
-    postNotification(object.get(), &renderer->document(), notification, postTarget, postType);
+    postNotification(object.get(), &renderer->document(), notification, postTarget);
 }
 
-void AXObjectCache::postNotification(Node* node, AXNotification notification, PostTarget postTarget, PostType postType)
+void AXObjectCache::postNotification(Node* node, AXNotification notification, PostTarget postTarget)
 {
     if (!node)
         return;
@@ -1146,10 +1146,10 @@
     if (!node)
         return;
     
-    postNotification(object.get(), &node->document(), notification, postTarget, postType);
+    postNotification(object.get(), &node->document(), notification, postTarget);
 }
 
-void AXObjectCache::postNotification(AXCoreObject* object, Document* document, AXNotification notification, PostTarget postTarget, PostType postType)
+void AXObjectCache::postNotification(AXCoreObject* object, Document* document, AXNotification notification, PostTarget postTarget)
 {
     AXTRACE("AXObjectCache::postNotification");
     AXLOG(std::make_pair(object, notification));
@@ -1157,7 +1157,7 @@
 
     stopCachingComputedObjectAttributes();
 
-    if (object && postTarget == TargetObservableParent)
+    if (object && postTarget == PostTarget::ObservableParent)
         object = object->observableObject();
 
     if (!object && document)
@@ -1166,17 +1166,9 @@
     if (!object)
         return;
 
-    if (postType == PostAsynchronously) {
-        m_notificationsToPost.append(std::make_pair(object, notification));
-        if (!m_notificationPostTimer.isActive())
-            m_notificationPostTimer.startOneShot(0_s);
-    } else {
-#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
-        updateIsolatedTree(*object, notification);
-#endif
-
-        postPlatformNotification(object, notification);
-    }
+    m_notificationsToPost.append(std::make_pair(object, notification));
+    if (!m_notificationPostTimer.isActive())
+        m_notificationPostTimer.startOneShot(0_s);
 }
 
 void AXObjectCache::checkedStateChanged(Node* node)
@@ -1229,9 +1221,9 @@
 {
     handleMenuItemSelected(node);
     
-    // postTarget is TargetObservableParent so that you can pass in any child of an element and it will go up the parent tree
+    // postTarget is ObservableParent so that you can pass in any child of an element and it will go up the parent tree
     // to find the container which should send out the notification.
-    postNotification(node, AXSelectedChildrenChanged, TargetObservableParent);
+    postNotification(node, AXSelectedChildrenChanged, PostTarget::ObservableParent);
 }
 
 void AXObjectCache::selectedChildrenChanged(RenderObject* renderer)
@@ -1239,9 +1231,9 @@
     if (renderer)
         handleMenuItemSelected(renderer->node());
 
-    // postTarget is TargetObservableParent so that you can pass in any child of an element and it will go up the parent tree
+    // postTarget is ObservableParent so that you can pass in any child of an element and it will go up the parent tree
     // to find the container which should send out the notification.
-    postNotification(renderer, AXSelectedChildrenChanged, TargetObservableParent);
+    postNotification(renderer, AXSelectedChildrenChanged, PostTarget::ObservableParent);
 }
 
 #ifndef NDEBUG
@@ -1388,7 +1380,7 @@
 
     postTextStateChangeNotification(getOrCreate(node), intent, selection);
 #else
-    postNotification(node->renderer(), AXObjectCache::AXSelectedTextChanged, TargetObservableParent);
+    postNotification(node->renderer(), AXObjectCache::AXSelectedTextChanged, PostTarget::ObservableParent);
     UNUSED_PARAM(intent);
     UNUSED_PARAM(selection);
 #endif

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (266804 => 266805)


--- trunk/Source/WebCore/accessibility/AXObjectCache.h	2020-09-09 22:54:40 UTC (rev 266804)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h	2020-09-09 23:04:28 UTC (rev 266805)
@@ -135,10 +135,8 @@
 enum AXTextChange { AXTextInserted, AXTextDeleted, AXTextAttributesChanged };
 #endif
 
-enum PostTarget { TargetElement, TargetObservableParent };
+enum class PostTarget { Element, ObservableParent };
 
-enum PostType { PostSynchronously, PostAsynchronously };
-
 class AXObjectCache {
     WTF_MAKE_NONCOPYABLE(AXObjectCache); WTF_MAKE_FAST_ALLOCATED;
     friend WTF::TextStream& operator<<(WTF::TextStream&, AXObjectCache&);
@@ -312,9 +310,9 @@
         AXDraggingExitedDropZone
     };
 
-    void postNotification(RenderObject*, AXNotification, PostTarget = TargetElement, PostType = PostAsynchronously);
-    void postNotification(Node*, AXNotification, PostTarget = TargetElement, PostType = PostAsynchronously);
-    void postNotification(AXCoreObject*, Document*, AXNotification, PostTarget = TargetElement, PostType = PostAsynchronously);
+    void postNotification(RenderObject*, AXNotification, PostTarget = PostTarget::Element);
+    void postNotification(Node*, AXNotification, PostTarget = PostTarget::Element);
+    void postNotification(AXCoreObject*, Document*, AXNotification, PostTarget = PostTarget::Element);
 
 #ifndef NDEBUG
     void showIntent(const AXTextStateChangeIntent&);
@@ -591,9 +589,9 @@
 inline void AXObjectCache::passwordNotificationPostTimerFired() { }
 inline void AXObjectCache::performDeferredCacheUpdate() { }
 inline void AXObjectCache::postLiveRegionChangeNotification(AccessibilityObject*) { }
-inline void AXObjectCache::postNotification(AXCoreObject*, Document*, AXNotification, PostTarget, PostType) { }
-inline void AXObjectCache::postNotification(Node*, AXNotification, PostTarget, PostType) { }
-inline void AXObjectCache::postNotification(RenderObject*, AXNotification, PostTarget, PostType) { }
+inline void AXObjectCache::postNotification(AXCoreObject*, Document*, AXNotification, PostTarget) { }
+inline void AXObjectCache::postNotification(Node*, AXNotification, PostTarget) { }
+inline void AXObjectCache::postNotification(RenderObject*, AXNotification, PostTarget) { }
 inline void AXObjectCache::postPlatformNotification(AXCoreObject*, AXNotification) { }
 inline void AXObjectCache::postTextReplacementNotification(Node*, AXTextEditType, const String&, AXTextEditType, const String&, const VisiblePosition&) { }
 inline void AXObjectCache::postTextReplacementNotificationForTextControl(HTMLTextFormControlElement&, const String&, const String&) { }

Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp (266804 => 266805)


--- trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp	2020-09-09 22:54:40 UTC (rev 266804)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp	2020-09-09 23:04:28 UTC (rev 266805)
@@ -136,7 +136,7 @@
     }
 
     if (auto* cache = document->axObjectCache())
-        cache->postNotification(this, document.ptr(), AXObjectCache::AXMenuListValueChanged, TargetElement, PostAsynchronously);
+        cache->postNotification(this, document.ptr(), AXObjectCache::AXMenuListValueChanged);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp (266804 => 266805)


--- trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp	2020-09-09 22:54:40 UTC (rev 266804)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp	2020-09-09 23:04:28 UTC (rev 266805)
@@ -127,8 +127,8 @@
     RefPtr<AXCoreObject> child = m_children[optionIndex].get();
 
     if (auto* cache = axObjectCache()) {
-        cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIElementChanged, TargetElement, PostAsynchronously);
-        cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListItemSelected, TargetElement, PostAsynchronously);
+        cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIElementChanged);
+        cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListItemSelected);
     }
 }
 

Modified: trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm (266804 => 266805)


--- trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm	2020-09-09 22:54:40 UTC (rev 266804)
+++ trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm	2020-09-09 23:04:28 UTC (rev 266805)
@@ -123,7 +123,7 @@
 
 void AXObjectCache::platformHandleFocusedUIElementChanged(Node*, Node* newNode)
 {
-    postNotification(newNode, AXFocusedUIElementChanged, TargetElement, PostAsynchronously);
+    postNotification(newNode, AXFocusedUIElementChanged);
 }
 
 void AXObjectCache::handleScrolledToAnchor(const Node*)

Modified: trunk/Source/WebCore/editing/Editor.cpp (266804 => 266805)


--- trunk/Source/WebCore/editing/Editor.cpp	2020-09-09 22:54:40 UTC (rev 266804)
+++ trunk/Source/WebCore/editing/Editor.cpp	2020-09-09 23:04:28 UTC (rev 266805)
@@ -766,7 +766,7 @@
     if (AXObjectCache::accessibilityEnabled()) {
         Node* node = endingSelection.start().deprecatedNode();
         if (AXObjectCache* cache = document().existingAXObjectCache())
-            cache->postNotification(node, AXObjectCache::AXValueChanged, TargetObservableParent);
+            cache->postNotification(node, AXObjectCache::AXValueChanged, PostTarget::ObservableParent);
     }
 
     updateMarkersForWordsAffectedByEditing(true);

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (266804 => 266805)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2020-09-09 22:54:40 UTC (rev 266804)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2020-09-09 23:04:28 UTC (rev 266805)
@@ -584,7 +584,7 @@
 #if ENABLE(ACCESSIBILITY) && !PLATFORM(COCOA)
         if (textIsChanged && renderer()) {
             if (AXObjectCache* cache = document().existingAXObjectCache())
-                cache->postNotification(this, AXObjectCache::AXValueChanged, TargetObservableParent);
+                cache->postNotification(this, AXObjectCache::AXValueChanged, PostTarget::ObservableParent);
         }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to