Title: [288774] trunk/Source/WebCore
- Revision
- 288774
- Author
- [email protected]
- Date
- 2022-01-28 18:12:10 -0800 (Fri, 28 Jan 2022)
Log Message
AX: AccessibilitySlider::inputElement should check if the renderer has become null
https://bugs.webkit.org/show_bug.cgi?id=235827
Reviewed by Chris Fleizach.
After https://bugs.webkit.org/show_bug.cgi?id=235715, we no longer
call the update version of children() from logging. This has made
accessibility/mac/spinbutton-valuedescription.html a constant failure
in debug mode only, since the logging is trying to print an AX tree that
is out of sync with the DOM. This test uses JS to remove an `<input>`
renderer + node.
Fixes accessibility/mac/spinbutton-valuedescription.html in debug.
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::inputElement const):
Null check m_renderer before using it.
(WebCore::AccessibilitySlider::getAttribute const):
(WebCore::AccessibilitySlider::valueForRange const):
(WebCore::AccessibilitySlider::maxValueForRange const):
(WebCore::AccessibilitySlider::minValueForRange const):
Null check the result of inputElement() before dereferencing it.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (288773 => 288774)
--- trunk/Source/WebCore/ChangeLog 2022-01-29 01:23:54 UTC (rev 288773)
+++ trunk/Source/WebCore/ChangeLog 2022-01-29 02:12:10 UTC (rev 288774)
@@ -1,3 +1,28 @@
+2022-01-28 Tyler Wilcock <[email protected]>
+
+ AX: AccessibilitySlider::inputElement should check if the renderer has become null
+ https://bugs.webkit.org/show_bug.cgi?id=235827
+
+ Reviewed by Chris Fleizach.
+
+ After https://bugs.webkit.org/show_bug.cgi?id=235715, we no longer
+ call the update version of children() from logging. This has made
+ accessibility/mac/spinbutton-valuedescription.html a constant failure
+ in debug mode only, since the logging is trying to print an AX tree that
+ is out of sync with the DOM. This test uses JS to remove an `<input>`
+ renderer + node.
+
+ Fixes accessibility/mac/spinbutton-valuedescription.html in debug.
+
+ * accessibility/AccessibilitySlider.cpp:
+ (WebCore::AccessibilitySlider::inputElement const):
+ Null check m_renderer before using it.
+ (WebCore::AccessibilitySlider::getAttribute const):
+ (WebCore::AccessibilitySlider::valueForRange const):
+ (WebCore::AccessibilitySlider::maxValueForRange const):
+ (WebCore::AccessibilitySlider::minValueForRange const):
+ Null check the result of inputElement() before dereferencing it.
+
2022-01-28 Michael Saboff <[email protected]>
Catalyst builds for WebCore and WebKitLegacy don't create proper symlinks for builds with system content path
Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp (288773 => 288774)
--- trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp 2022-01-29 01:23:54 UTC (rev 288773)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp 2022-01-29 02:12:10 UTC (rev 288774)
@@ -105,7 +105,9 @@
const AtomString& AccessibilitySlider::getAttribute(const QualifiedName& attribute) const
{
- return inputElement()->getAttribute(attribute);
+ if (auto* input = inputElement())
+ return input->getAttribute(attribute);
+ return nullAtom();
}
AXCoreObject* AccessibilitySlider::elementAccessibilityHitTest(const IntPoint& point) const
@@ -121,17 +123,23 @@
float AccessibilitySlider::valueForRange() const
{
- return inputElement()->value().toFloat();
+ if (auto* input = inputElement())
+ return input->value().toFloat();
+ return 0;
}
float AccessibilitySlider::maxValueForRange() const
{
- return static_cast<float>(inputElement()->maximum());
+ if (auto* input = inputElement())
+ return static_cast<float>(input->maximum());
+ return 0;
}
float AccessibilitySlider::minValueForRange() const
{
- return static_cast<float>(inputElement()->minimum());
+ if (auto* input = inputElement())
+ return static_cast<float>(input->minimum());
+ return 0;
}
bool AccessibilitySlider::setValue(const String& value)
@@ -147,6 +155,8 @@
HTMLInputElement* AccessibilitySlider::inputElement() const
{
+ if (!m_renderer)
+ return nullptr;
return downcast<HTMLInputElement>(m_renderer->node());
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes