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

Side by Side Diff: Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 742353004: Implement computedRole and computedName (behind a flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move interfaces on to Element Created 6 years 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) 2014, Google Inc. All rights reserved. 2 * Copyright (C) 2014, 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 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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 if (targetAXObject && !targetAXObject->children().isEmpty()) 1067 if (targetAXObject && !targetAXObject->children().isEmpty())
1068 targetAXObject = targetAXObject->children()[0].get(); 1068 targetAXObject = targetAXObject->children()[0].get();
1069 postPlatformNotification(targetAXObject, AXScrollPositionChanged); 1069 postPlatformNotification(targetAXObject, AXScrollPositionChanged);
1070 } 1070 }
1071 1071
1072 void AXObjectCacheImpl::handleScrollPositionChanged(RenderObject* renderObject) 1072 void AXObjectCacheImpl::handleScrollPositionChanged(RenderObject* renderObject)
1073 { 1073 {
1074 postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged) ; 1074 postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged) ;
1075 } 1075 }
1076 1076
1077 const AtomicString& AXObjectCacheImpl::computedRoleForNode(Node* node)
1078 {
1079 AXObject* obj = getOrCreate(node);
1080 if (!obj)
1081 return AXObject::roleName(UnknownRole);
1082 return AXObject::roleName(obj->roleValue());
1083 }
1084
1085 String AXObjectCacheImpl::computedNameForNode(Node* node)
1086 {
1087 AXObject* obj = getOrCreate(node);
1088 if (!obj)
1089 return "";
1090
1091 return obj->title();
1092 }
1093
1077 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect) 1094 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect)
1078 { 1095 {
1079 AXObject* obj = getOrCreate(element); 1096 AXObject* obj = getOrCreate(element);
1080 if (!obj) 1097 if (!obj)
1081 return; 1098 return;
1082 1099
1083 obj->setElementRect(rect); 1100 obj->setElementRect(rect);
1084 } 1101 }
1085 1102
1086 } // namespace blink 1103 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698