Changeset 176447 in webkit


Ignore:
Timestamp:
Nov 21, 2014 7:55:01 AM (9 years ago)
Author:
Chris Fleizach
Message:

AX: MathML expressions are misread by VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=138948

Reviewed by Mario Sanchez Prada.

Source/WebCore:

The logic for deciding what's the radicand and an index was too tied to children placement.
We should instead pull directly from the source.

Test: platform/mac/accessibility/mathml-root.html

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::mathRadicandObject):
(WebCore::AccessibilityRenderObject::mathRootIndexObject):

  • rendering/mathml/RenderMathMLRoot.h:

LayoutTests:

  • platform/mac/accessibility/mathml-root-expected.txt: Added.
  • platform/mac/accessibility/mathml-root.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176433 r176447  
     12014-11-21  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: MathML expressions are misread by VoiceOver
     4        https://bugs.webkit.org/show_bug.cgi?id=138948
     5
     6        Reviewed by Mario Sanchez Prada.
     7
     8        * platform/mac/accessibility/mathml-root-expected.txt: Added.
     9        * platform/mac/accessibility/mathml-root.html: Added.
     10
    1112014-11-20  Daniel Bates  <dabates@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r176437 r176447  
     12014-11-21  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: MathML expressions are misread by VoiceOver
     4        https://bugs.webkit.org/show_bug.cgi?id=138948
     5
     6        Reviewed by Mario Sanchez Prada.
     7
     8        The logic for deciding what's the radicand and an index was too tied to children placement.
     9        We should instead pull directly from the source.
     10
     11        Test: platform/mac/accessibility/mathml-root.html
     12
     13        * accessibility/AccessibilityRenderObject.cpp:
     14        (WebCore::AccessibilityRenderObject::mathRadicandObject):
     15        (WebCore::AccessibilityRenderObject::mathRootIndexObject):
     16        * rendering/mathml/RenderMathMLRoot.h:
     17
    1182014-11-20  Benjamin Poulain  <bpoulain@apple.com>
    219
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r176321 r176447  
    8383#include "RenderMathMLFraction.h"
    8484#include "RenderMathMLOperator.h"
     85#include "RenderMathMLRoot.h"
    8586#include "RenderMenuList.h"
    8687#include "RenderSVGRoot.h"
     
    36243625    if (!isMathRoot())
    36253626        return nullptr;
    3626    
    3627     const auto& children = this->children();
    3628     if (children.size() < 1)
    3629         return 0;
    3630    
    3631     // The radicand is the value being rooted and must be listed first.
    3632     return children[0].get();
     3627    RenderMathMLRoot* root = &downcast<RenderMathMLRoot>(*m_renderer);
     3628    AccessibilityObject* rootRadicandWrapper = axObjectCache()->getOrCreate(root->baseWrapper());
     3629    if (!rootRadicandWrapper)
     3630        return nullptr;
     3631    AccessibilityObject* rootRadicand = rootRadicandWrapper->children().first().get();
     3632    ASSERT(rootRadicand && children().contains(rootRadicand));
     3633    return rootRadicand;
    36333634}
    36343635
     
    36373638    if (!isMathRoot())
    36383639        return nullptr;
    3639    
    3640     const auto& children = this->children();
    3641     if (children.size() != 2)
    3642         return nullptr;
    3643 
    3644     // The index in a root is the value which determines if it's a square, cube, etc, root
    3645     // and must be listed second.
    3646     return children[1].get();
     3640    RenderMathMLRoot* root = &downcast<RenderMathMLRoot>(*m_renderer);
     3641    AccessibilityObject* rootIndexWrapper = axObjectCache()->getOrCreate(root->indexWrapper());
     3642    if (!rootIndexWrapper)
     3643        return nullptr;
     3644    AccessibilityObject* rootIndex = rootIndexWrapper->children().first().get();
     3645    ASSERT(rootIndex && children().contains(rootIndex));
     3646    return rootIndex;
    36473647}
    36483648
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.h

    r175084 r176447  
    5050    virtual void updateFromElement() override;
    5151   
     52    RenderMathMLRootWrapper* baseWrapper() const;
     53    RenderMathMLRootWrapper* indexWrapper() const;
     54
    5255protected:
    5356    virtual void layout() override;
     
    6265    void restructureWrappers();
    6366
    64     RenderMathMLRootWrapper* baseWrapper() const;
    6567    RenderMathMLBlock* radicalWrapper() const;
    66     RenderMathMLRootWrapper* indexWrapper() const;
    6768    RenderMathMLRadicalOperator* radicalOperator() const;
    6869
Note: See TracChangeset for help on using the changeset viewer.