Commit 5c1e5fd0 authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

Make accessible scroll position attributes more generic and

add attributes for the min and max scroll position, as the
first step towards implementing accessible scrolling APIs.

BUG=104468
TEST=none
Review URL: http://codereview.chromium.org/8776026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112814 0039d316-1c4b-4281-b951-d872f2087c98
parent 961ceb88
......@@ -133,8 +133,8 @@ gfx::Rect BrowserAccessibility::GetLocalBoundsRect() {
BrowserAccessibility* root = manager_->GetRoot();
int scroll_x = 0;
int scroll_y = 0;
root->GetIntAttribute(WebAccessibility::ATTR_DOC_SCROLLX, &scroll_x);
root->GetIntAttribute(WebAccessibility::ATTR_DOC_SCROLLY, &scroll_y);
root->GetIntAttribute(WebAccessibility::ATTR_SCROLL_X, &scroll_x);
root->GetIntAttribute(WebAccessibility::ATTR_SCROLL_Y, &scroll_y);
bounds.Offset(-scroll_x, -scroll_y);
return bounds;
......@@ -272,4 +272,3 @@ string16 BrowserAccessibility::GetTextRecursive() const {
result += children_[i]->GetTextRecursive();
return result;
}
......@@ -582,11 +582,23 @@ std::string WebAccessibility::DebugString(bool recursive,
++iter) {
std::string value = IntToString(iter->second);
switch (iter->first) {
case ATTR_DOC_SCROLLX:
result += " scrollx=" + value;
case ATTR_SCROLL_X:
result += " scroll_x=" + value;
break;
case ATTR_DOC_SCROLLY:
result += " scrolly=" + value;
case ATTR_SCROLL_X_MIN:
result += " scroll_x_min=" + value;
break;
case ATTR_SCROLL_X_MAX:
result += " scroll_x_max=" + value;
break;
case ATTR_SCROLL_Y:
result += " scroll_y=" + value;
break;
case ATTR_SCROLL_Y_MIN:
result += " scroll_y_min=" + value;
break;
case ATTR_SCROLL_Y_MAX:
result += " scroll_y_max=" + value;
break;
case ATTR_HIERARCHICAL_LEVEL:
result += " level=" + value;
......@@ -924,8 +936,16 @@ void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src,
string_attributes[ATTR_DOC_DOCTYPE] = doctype.name();
const gfx::Size& scroll_offset = document.frame()->scrollOffset();
int_attributes[ATTR_DOC_SCROLLX] = scroll_offset.width();
int_attributes[ATTR_DOC_SCROLLY] = scroll_offset.height();
int_attributes[ATTR_SCROLL_X] = scroll_offset.width();
int_attributes[ATTR_SCROLL_Y] = scroll_offset.height();
const gfx::Size& min_offset = document.frame()->minimumScrollOffset();
int_attributes[ATTR_SCROLL_X_MIN] = min_offset.width();
int_attributes[ATTR_SCROLL_Y_MIN] = min_offset.height();
const gfx::Size& max_offset = document.frame()->maximumScrollOffset();
int_attributes[ATTR_SCROLL_X_MAX] = max_offset.width();
int_attributes[ATTR_SCROLL_Y_MAX] = max_offset.height();
}
if (role == WebAccessibility::ROLE_TABLE) {
......
......@@ -190,9 +190,13 @@ struct WEBKIT_GLUE_EXPORT WebAccessibility {
};
enum IntAttribute {
// Document attributes.
ATTR_DOC_SCROLLX,
ATTR_DOC_SCROLLY,
// Scrollable container attributes.
ATTR_SCROLL_X,
ATTR_SCROLL_X_MIN,
ATTR_SCROLL_X_MAX,
ATTR_SCROLL_Y,
ATTR_SCROLL_Y_MIN,
ATTR_SCROLL_Y_MAX,
// Editable text attributes.
ATTR_TEXT_SEL_START,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment