Title: [253894] trunk/Source/WebCore
- Revision
- 253894
- Author
- [email protected]
- Date
- 2019-12-23 17:03:13 -0800 (Mon, 23 Dec 2019)
Log Message
IsolatedObject implementation of property setters.
https://bugs.webkit.org/show_bug.cgi?id=205566
Reviewed by Chris Fleizach.
- Implementation of setters that need to be executed in the main
thread.
- Sanity check of the associatedAXObject() before calling corresponding
method on main thread.
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::performFunctionOnMainThread):
(WebCore::AXIsolatedObject::setARIAGrabbed):
(WebCore::AXIsolatedObject::setIsExpanded):
(WebCore::AXIsolatedObject::setValue):
(WebCore::AXIsolatedObject::setSelected):
(WebCore::AXIsolatedObject::setSelectedRows):
(WebCore::AXIsolatedObject::setFocused):
(WebCore::AXIsolatedObject::setSelectedText):
(WebCore::AXIsolatedObject::setSelectedTextRange):
(WebCore::AXIsolatedObject::setCaretBrowsingEnabled):
(WebCore::AXIsolatedObject::setPreventKeyboardDOMEventDispatch):
(WebCore::AXIsolatedObject::findTextRanges const):
(WebCore::AXIsolatedObject::performTextOperation):
(WebCore::AXIsolatedObject::widget const):
(WebCore::AXIsolatedObject::document const):
(WebCore::AXIsolatedObject::documentFrameView const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (253893 => 253894)
--- trunk/Source/WebCore/ChangeLog 2019-12-24 00:32:04 UTC (rev 253893)
+++ trunk/Source/WebCore/ChangeLog 2019-12-24 01:03:13 UTC (rev 253894)
@@ -1,3 +1,35 @@
+2019-12-23 Andres Gonzalez <[email protected]>
+
+ IsolatedObject implementation of property setters.
+ https://bugs.webkit.org/show_bug.cgi?id=205566
+
+ Reviewed by Chris Fleizach.
+
+ - Implementation of setters that need to be executed in the main
+ thread.
+ - Sanity check of the associatedAXObject() before calling corresponding
+ method on main thread.
+
+ * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
+ (WebCore::AXIsolatedObject::initializeAttributeData):
+ (WebCore::AXIsolatedObject::performFunctionOnMainThread):
+ (WebCore::AXIsolatedObject::setARIAGrabbed):
+ (WebCore::AXIsolatedObject::setIsExpanded):
+ (WebCore::AXIsolatedObject::setValue):
+ (WebCore::AXIsolatedObject::setSelected):
+ (WebCore::AXIsolatedObject::setSelectedRows):
+ (WebCore::AXIsolatedObject::setFocused):
+ (WebCore::AXIsolatedObject::setSelectedText):
+ (WebCore::AXIsolatedObject::setSelectedTextRange):
+ (WebCore::AXIsolatedObject::setCaretBrowsingEnabled):
+ (WebCore::AXIsolatedObject::setPreventKeyboardDOMEventDispatch):
+ (WebCore::AXIsolatedObject::findTextRanges const):
+ (WebCore::AXIsolatedObject::performTextOperation):
+ (WebCore::AXIsolatedObject::widget const):
+ (WebCore::AXIsolatedObject::document const):
+ (WebCore::AXIsolatedObject::documentFrameView const):
+ * accessibility/isolatedtree/AXIsolatedTreeNode.h:
+
2019-12-23 Daniel Bates <[email protected]>
REGRESSION (r212693): getClientRects(), getBoundingClientRect() for range that spans multi-lines differs depending on whether text is selected
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp (253893 => 253894)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp 2019-12-24 00:32:04 UTC (rev 253893)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp 2019-12-24 01:03:13 UTC (rev 253894)
@@ -185,7 +185,9 @@
setProperty(AXPropertyName::ReadOnlyValue, object.readOnlyValue());
setProperty(AXPropertyName::AutoCompleteValue, object.autoCompleteValue());
setProperty(AXPropertyName::SpeakAs, object.speakAsProperty());
+#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY)
setProperty(AXPropertyName::CaretBrowsingEnabled, object.caretBrowsingEnabled());
+#endif
setObjectProperty(AXPropertyName::FocusableAncestor, object.focusableAncestor());
setObjectProperty(AXPropertyName::EditableAncestor, object.editableAncestor());
setObjectProperty(AXPropertyName::HighestEditableAncestor, object.highestEditableAncestor());
@@ -518,6 +520,92 @@
return objectAttributeValue(orientation == AccessibilityOrientation::Vertical ? AXPropertyName::VerticalScrollBar : AXPropertyName::HorizontalScrollBar);
}
+template<typename U>
+void AXIsolatedObject::performFunctionOnMainThread(U&& lambda)
+{
+ Accessibility::performFunctionOnMainThread([&lambda, this] () {
+ if (auto object = associatedAXObject())
+ lambda(object);
+ });
+}
+
+void AXIsolatedObject::setARIAGrabbed(bool value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setARIAGrabbed(value);
+ });
+}
+
+void AXIsolatedObject::setIsExpanded(bool value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setIsExpanded(value);
+ });
+}
+void AXIsolatedObject::setValue(float value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setValue(value);
+ });
+}
+
+void AXIsolatedObject::setSelected(bool value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setSelected(value);
+ });
+}
+void AXIsolatedObject::setSelectedRows(AccessibilityChildrenVector& value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setSelectedRows(value);
+ });
+}
+
+void AXIsolatedObject::setFocused(bool value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setFocused(value);
+ });
+}
+
+void AXIsolatedObject::setSelectedText(const String& value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setSelectedText(value);
+ });
+}
+
+void AXIsolatedObject::setSelectedTextRange(const PlainTextRange& value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setSelectedTextRange(value);
+ });
+}
+
+void AXIsolatedObject::setValue(const String& value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setValue(value);
+ });
+}
+
+#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY)
+void AXIsolatedObject::setCaretBrowsingEnabled(bool value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setCaretBrowsingEnabled(value);
+ });
+}
+#endif
+
+void AXIsolatedObject::setPreventKeyboardDOMEventDispatch(bool value)
+{
+ performFunctionOnMainThread([&value](AXCoreObject* object) {
+ object->setPreventKeyboardDOMEventDispatch(value);
+ });
+}
+
void AXIsolatedObject::colorValue(int& r, int& g, int& b) const
{
auto color = colorAttributeValue(AXPropertyName::ColorValue);
@@ -699,7 +787,9 @@
Vector<RefPtr<Range>> AXIsolatedObject::findTextRanges(AccessibilitySearchTextCriteria const& criteria) const
{
return Accessibility::retrieveValueFromMainThread<Vector<RefPtr<Range>>>([&criteria, this] () -> Vector<RefPtr<Range>> {
- return associatedAXObject()->findTextRanges(criteria);
+ if (auto object = associatedAXObject())
+ return object->findTextRanges(criteria);
+ return Vector<RefPtr<Range>>();
});
}
@@ -706,7 +796,9 @@
Vector<String> AXIsolatedObject::performTextOperation(AccessibilityTextOperation const& textOperation)
{
return Accessibility::retrieveValueFromMainThread<Vector<String>>([&textOperation, this] () -> Vector<String> {
- return associatedAXObject()->performTextOperation(textOperation);
+ if (auto object = associatedAXObject())
+ return object->performTextOperation(textOperation);
+ return Vector<String>();
});
}
@@ -1384,7 +1476,9 @@
Widget* AXIsolatedObject::widget() const
{
- return associatedAXObject()->widget();
+ if (auto object = associatedAXObject())
+ return object->widget();
+ return nullptr;
}
Widget* AXIsolatedObject::widgetForAttachmentView() const
@@ -1401,12 +1495,16 @@
Document* AXIsolatedObject::document() const
{
- return associatedAXObject()->document();
+ if (auto object = associatedAXObject())
+ return object->document();
+ return nullptr;
}
FrameView* AXIsolatedObject::documentFrameView() const
{
- return associatedAXObject()->documentFrameView();
+ if (auto object = associatedAXObject())
+ return object->documentFrameView();
+ return nullptr;
}
Frame* AXIsolatedObject::frame() const
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h (253893 => 253894)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h 2019-12-24 00:32:04 UTC (rev 253893)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h 2019-12-24 01:03:13 UTC (rev 253894)
@@ -104,7 +104,9 @@
CanSetTextRangeAttributes,
CanSetValueAttribute,
CanvasHasFallbackContent,
+#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY)
CaretBrowsingEnabled,
+#endif
ClassList,
ClickPoint,
ColorValue,
@@ -325,7 +327,8 @@
void fillChildrenVectorForProperty(AXPropertyName, AccessibilityChildrenVector&) const;
void setMathscripts(AXPropertyName, AXCoreObject&);
void insertMathPairs(Vector<AccessibilityIsolatedTreeMathMultiscriptPair>&, AccessibilityMathMultiscriptPairs&);
-
+ template<typename U> void performFunctionOnMainThread(U&&);
+
// Attribute retrieval overrides.
bool isHeading() const override { return boolAttributeValue(AXPropertyName::IsHeading); }
bool isLink() const override { return boolAttributeValue(AXPropertyName::IsLink); }
@@ -502,7 +505,9 @@
String descriptionAttributeValue() const override { return stringAttributeValue(AXPropertyName::Description); }
String helpTextAttributeValue() const override { return stringAttributeValue(AXPropertyName::HelpText); }
String titleAttributeValue() const override { return stringAttributeValue(AXPropertyName::Title); }
+#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY)
bool caretBrowsingEnabled() const override { return boolAttributeValue(AXPropertyName::CaretBrowsingEnabled); }
+#endif
AXCoreObject* focusableAncestor() override { return objectAttributeValue(AXPropertyName::FocusableAncestor); }
AXCoreObject* editableAncestor() override { return objectAttributeValue(AXPropertyName::EditableAncestor); }
AXCoreObject* highestEditableAncestor() override { return objectAttributeValue(AXPropertyName::HighestEditableAncestor); }
@@ -595,18 +600,20 @@
IntRect doAXBoundsForRangeUsingCharacterOffset(const PlainTextRange&) const override { return IntRect(); }
unsigned doAXLineForIndex(unsigned) override { return 0; }
- // TODO: Attribute setters.
- void setARIAGrabbed(bool) override { }
- void setIsExpanded(bool) override { }
- void setValue(float) override { }
- void setSelected(bool) override { }
- void setSelectedRows(AccessibilityChildrenVector&) override { }
- void setFocused(bool) override { }
- void setSelectedText(const String&) override { }
- void setSelectedTextRange(const PlainTextRange&) override { }
- void setValue(const String&) override { }
- void setCaretBrowsingEnabled(bool) override { }
- void setPreventKeyboardDOMEventDispatch(bool) override { }
+ // Attribute setters.
+ void setARIAGrabbed(bool) override;
+ void setIsExpanded(bool) override;
+ void setValue(float) override;
+ void setSelected(bool) override;
+ void setSelectedRows(AccessibilityChildrenVector&) override;
+ void setFocused(bool) override;
+ void setSelectedText(const String&) override;
+ void setSelectedTextRange(const PlainTextRange&) override;
+ void setValue(const String&) override;
+#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY)
+ void setCaretBrowsingEnabled(bool) override;
+#endif
+ void setPreventKeyboardDOMEventDispatch(bool) override;
// TODO: Functions
String textUnderElement(AccessibilityTextUnderElementMode = AccessibilityTextUnderElementMode()) const override { return String(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes