diff options
author | Steve Block <steveblock@google.com> | 2010-08-24 07:50:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-24 07:50:47 -0700 |
commit | c570a147a94b126d4172c30914f53dea17b4c8f5 (patch) | |
tree | 99c11741887d21f65d67c5bbdab58b7ba2a5d4d5 /WebCore/accessibility/AccessibilityRenderObject.cpp | |
parent | c952714bc6809a5ad081baaf9fcc04107b92ea3f (diff) | |
parent | 6c65f16005b91786c2b7c0791b9ea1dd684d57f4 (diff) | |
download | external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.zip external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.gz external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.bz2 |
Merge changes I2e7e2317,Ie6ccde3a,I3e89f231,Id06ff339,I268dfe7d,Icaf70d9f,Ie234f1a0,Iff5c7aaa,I69b75bf0,Ifbf384f4
* changes:
Merge WebKit at r65615 : Update WebKit revision number
Merge WebKit at r65615 : Ignore http/tests/appcache/origin-quota.html
Merge WebKit at r65615 : Android-specific results for Geolocation tests.
Merge WebKit at r65615 : Fix GraphicsContext and ImageBuffer.
Merge WebKit at r65615 : processingUserGesture() is now static.
Merge WebKit at r65615 : UTF8String() becomes utf8().
Merge WebKit at r65615 : Fix include paths for string headers.
Merge WebKit at r65615 : Fix Makefiles.
Merge WebKit at r65615 : Fix conflicts.
Merge WebKit at r65615 : Initial merge by git.
Diffstat (limited to 'WebCore/accessibility/AccessibilityRenderObject.cpp')
-rw-r--r-- | WebCore/accessibility/AccessibilityRenderObject.cpp | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp index 24c29d4..6b90b63 100644 --- a/WebCore/accessibility/AccessibilityRenderObject.cpp +++ b/WebCore/accessibility/AccessibilityRenderObject.cpp @@ -354,10 +354,10 @@ AccessibilityObject* AccessibilityRenderObject::nextSibling() const else if (isInlineWithContinuation(m_renderer->parent())) { RenderObject* continuation = toRenderInline(m_renderer->parent())->continuation(); - // Case 4a: continuation is a block - in this case the block itself is the next sibling. + // Case 5a: continuation is a block - in this case the block itself is the next sibling. if (continuation->isRenderBlock()) nextSibling = continuation; - // Case 4b: continuation is an inline - in this case the inline's first child is the next sibling + // Case 5b: continuation is an inline - in this case the inline's first child is the next sibling else nextSibling = firstChildConsideringContinuation(continuation); } @@ -368,6 +368,13 @@ AccessibilityObject* AccessibilityRenderObject::nextSibling() const return axObjectCache()->getOrCreate(nextSibling); } +static RenderBoxModelObject* nextContinuation(RenderObject* renderer) +{ + if (renderer->isInline() && !renderer->isReplaced()) + return toRenderInline(renderer)->continuation(); + return toRenderBlock(renderer)->inlineElementContinuation(); +} + RenderObject* AccessibilityRenderObject::renderParentObject() const { if (!m_renderer) @@ -377,7 +384,8 @@ RenderObject* AccessibilityRenderObject::renderParentObject() const // Case 1: node is a block and is an inline's continuation. Parent // is the start of the continuation chain. - RenderInline* startOfConts = 0; + RenderObject* startOfConts = 0; + RenderObject* firstChild = 0; if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_renderer))) parent = startOfConts; @@ -386,6 +394,20 @@ RenderObject* AccessibilityRenderObject::renderParentObject() const else if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent))) parent = startOfConts; + // Case 3: The first sibling is the beginning of a continuation chain. Find the origin of that continuation. + else if (parent && (firstChild = parent->firstChild()) && firstChild->node()) { + // Get the node's renderer and follow that continuation chain until the first child is found + RenderObject* nodeRenderFirstChild = firstChild->node()->renderer(); + if (nodeRenderFirstChild != firstChild) { + for (RenderObject* contsTest = nodeRenderFirstChild; contsTest; contsTest = nextContinuation(contsTest)) { + if (contsTest == firstChild) { + parent = nodeRenderFirstChild->parent(); + break; + } + } + } + } + return parent; } @@ -486,8 +508,9 @@ bool AccessibilityRenderObject::isFileUploadButton() const bool AccessibilityRenderObject::isInputImage() const { - if (m_renderer && m_renderer->node() && m_renderer->node()->hasTagName(inputTag)) { - HTMLInputElement* input = static_cast<HTMLInputElement*>(m_renderer->node()); + Node* elementNode = node(); + if (roleValue() == ButtonRole && elementNode && elementNode->hasTagName(inputTag)) { + HTMLInputElement* input = static_cast<HTMLInputElement*>(elementNode); return input->inputType() == HTMLInputElement::IMAGE; } @@ -569,8 +592,11 @@ bool AccessibilityRenderObject::isIndeterminate() const bool AccessibilityRenderObject::isNativeCheckboxOrRadio() const { Node* elementNode = node(); - if (elementNode && elementNode->isElementNode()) - return toInputElement(static_cast<Element*>(elementNode)); + if (elementNode && elementNode->isElementNode()) { + InputElement* input = toInputElement(static_cast<Element*>(elementNode)); + if (input) + return input->isCheckbox() || input->isRadioButton(); + } return false; } @@ -3299,8 +3325,10 @@ void AccessibilityRenderObject::addChildren() unsigned length = children.size(); for (unsigned i = 0; i < length; ++i) m_children.append(children[i]); - } else + } else { + ASSERT(obj->parentObject() == this); m_children.append(obj); + } } // for a RenderImage, add the <area> elements as individual accessibility objects |