Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Side by Side Diff: Source/core/accessibility/AccessibilityRenderObject.cpp

Issue 19096009: Use isHTMLTextAreaElement and toHTMLTextAreaElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 return; 1769 return;
1770 Node* node = m_renderer->node(); 1770 Node* node = m_renderer->node();
1771 frame->selection()->setSelection(VisibleSelection(Position(node, range.start , Position::PositionIsOffsetInAnchor), 1771 frame->selection()->setSelection(VisibleSelection(Position(node, range.start , Position::PositionIsOffsetInAnchor),
1772 Position(node, range.start + range.length, Position::PositionIsOffsetInA nchor), DOWNSTREAM)); 1772 Position(node, range.start + range.length, Position::PositionIsOffsetInA nchor), DOWNSTREAM));
1773 } 1773 }
1774 1774
1775 void AccessibilityRenderObject::setValue(const String& string) 1775 void AccessibilityRenderObject::setValue(const String& string)
1776 { 1776 {
1777 if (!m_renderer || !m_renderer->node() || !m_renderer->node()->isElementNode ()) 1777 if (!m_renderer || !m_renderer->node() || !m_renderer->node()->isElementNode ())
1778 return; 1778 return;
1779 Element* element = toElement(m_renderer->node());
1780
1781 if (!m_renderer->isBoxModelObject()) 1779 if (!m_renderer->isBoxModelObject())
1782 return; 1780 return;
1783 RenderBoxModelObject* renderer = toRenderBoxModelObject(m_renderer); 1781 RenderBoxModelObject* renderer = toRenderBoxModelObject(m_renderer);
1784 1782
1785 // FIXME: Do we want to do anything here for ARIA textboxes? 1783 // FIXME: Do we want to do anything here for ARIA textboxes?
1786 if (renderer->isTextField()) { 1784 if (renderer->isTextField()) {
1787 // FIXME: This is not safe! Other elements could have a TextField rende rer. 1785 // FIXME: This is not safe! Other elements could have a TextField rende rer.
1788 toHTMLInputElement(element)->setValue(string); 1786 toHTMLInputElement(m_renderer->node())->setValue(string);
1789 } else if (renderer->isTextArea()) { 1787 } else if (renderer->isTextArea()) {
1790 // FIXME: This is not safe! Other elements could have a TextArea render er. 1788 // FIXME: This is not safe! Other elements could have a TextArea render er.
1791 static_cast<HTMLTextAreaElement*>(element)->setValue(string); 1789 toHTMLTextAreaElement(m_renderer->node())->setValue(string);
1792 } 1790 }
1793 } 1791 }
1794 1792
1795 void AccessibilityRenderObject::scrollTo(const IntPoint& point) const 1793 void AccessibilityRenderObject::scrollTo(const IntPoint& point) const
1796 { 1794 {
1797 if (!m_renderer || !m_renderer->isBox()) 1795 if (!m_renderer || !m_renderer->isBox())
1798 return; 1796 return;
1799 1797
1800 RenderBox* box = toRenderBox(m_renderer); 1798 RenderBox* box = toRenderBox(m_renderer);
1801 if (!box->canBeScrolledAndHasScrollableArea()) 1799 if (!box->canBeScrolledAndHasScrollableArea())
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 if (label && label->renderer()) { 2511 if (label && label->renderer()) {
2514 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2512 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2515 result.unite(labelRect); 2513 result.unite(labelRect);
2516 } 2514 }
2517 } 2515 }
2518 2516
2519 return result; 2517 return result;
2520 } 2518 }
2521 2519
2522 } // namespace WebCore 2520 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/accessibility/AccessibilityNodeObject.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698