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

Side by Side Diff: Source/web/WebAXObject.cpp

Issue 216343002: Add a test that confirms there's no crash on accessing properties of AccesibilityObject at the init… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 WebAXRole WebAXObject::role() const 696 WebAXRole WebAXObject::role() const
697 { 697 {
698 if (isDetached()) 698 if (isDetached())
699 return blink::WebAXRoleUnknown; 699 return blink::WebAXRoleUnknown;
700 700
701 return static_cast<WebAXRole>(m_private->roleValue()); 701 return static_cast<WebAXRole>(m_private->roleValue());
702 } 702 }
703 703
704 unsigned WebAXObject::selectionEnd() const 704 unsigned WebAXObject::selectionEnd() const
705 { 705 {
706 if (m_private->isTextControl())
dmazzoni 2014/03/28 06:30:32 I'm assuming this fixes the crash, but it doesn't
hajimehoshi 2014/03/28 06:45:08 I agree with you. The cause is that there is an a
707 return 0;
708
706 if (isDetached()) 709 if (isDetached())
707 return 0; 710 return 0;
708 711
709 return m_private->selectedTextRange().start + m_private->selectedTextRange() .length; 712 return m_private->selectedTextRange().start + m_private->selectedTextRange() .length;
710 } 713 }
711 714
712 unsigned WebAXObject::selectionStart() const 715 unsigned WebAXObject::selectionStart() const
713 { 716 {
717 if (m_private->isTextControl())
718 return 0;
719
714 if (isDetached()) 720 if (isDetached())
715 return 0; 721 return 0;
716 722
717 return m_private->selectedTextRange().start; 723 return m_private->selectedTextRange().start;
718 } 724 }
719 725
720 unsigned WebAXObject::selectionEndLineNumber() const 726 unsigned WebAXObject::selectionEndLineNumber() const
721 { 727 {
722 if (isDetached()) 728 if (isDetached())
723 return 0; 729 return 0;
(...skipping 18 matching lines...) Expand all
742 } 748 }
743 749
744 void WebAXObject::setFocused(bool on) const 750 void WebAXObject::setFocused(bool on) const
745 { 751 {
746 if (!isDetached()) 752 if (!isDetached())
747 m_private->setFocused(on); 753 m_private->setFocused(on);
748 } 754 }
749 755
750 void WebAXObject::setSelectedTextRange(int selectionStart, int selectionEnd) con st 756 void WebAXObject::setSelectedTextRange(int selectionStart, int selectionEnd) con st
751 { 757 {
758 if (m_private->isTextControl())
759 return;
760
752 if (isDetached()) 761 if (isDetached())
753 return; 762 return;
754 763
755 m_private->setSelectedTextRange(AXObject::PlainTextRange(selectionStart, sel ectionEnd - selectionStart)); 764 m_private->setSelectedTextRange(AXObject::PlainTextRange(selectionStart, sel ectionEnd - selectionStart));
756 } 765 }
757 766
758 WebString WebAXObject::stringValue() const 767 WebString WebAXObject::stringValue() const
759 { 768 {
760 if (isDetached()) 769 if (isDetached())
761 return WebString(); 770 return WebString();
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 m_private = object; 1164 m_private = object;
1156 return *this; 1165 return *this;
1157 } 1166 }
1158 1167
1159 WebAXObject::operator WTF::PassRefPtr<WebCore::AXObject>() const 1168 WebAXObject::operator WTF::PassRefPtr<WebCore::AXObject>() const
1160 { 1169 {
1161 return m_private.get(); 1170 return m_private.get();
1162 } 1171 }
1163 1172
1164 } // namespace blink 1173 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698