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

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

Issue 1269263003: The start and end arguments should be unsigned long in setSelectionRange() function Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 if (!layout) 1947 if (!layout)
1948 return AXRange(); 1948 return AXRange();
1949 1949
1950 AXObject* axObject = axObjectCache().getOrCreate(layout); 1950 AXObject* axObject = axObjectCache().getOrCreate(layout);
1951 if (!axObject || !axObject->isAXLayoutObject()) 1951 if (!axObject || !axObject->isAXLayoutObject())
1952 return AXRange(); 1952 return AXRange();
1953 1953
1954 HTMLTextFormControlElement* textControl = toLayoutTextControl( 1954 HTMLTextFormControlElement* textControl = toLayoutTextControl(
1955 layout)->textFormControlElement(); 1955 layout)->textFormControlElement();
1956 ASSERT(textControl); 1956 ASSERT(textControl);
1957 int start = textControl->selectionStart(); 1957 unsigned start = textControl->selectionStart();
1958 int end = textControl->selectionEnd(); 1958 unsigned end = textControl->selectionEnd();
1959 return AXRange(axObject, start, axObject, end); 1959 return AXRange(axObject, start, axObject, end);
1960 } 1960 }
1961 1961
1962 int AXLayoutObject::indexForVisiblePosition(const VisiblePosition& position) con st 1962 int AXLayoutObject::indexForVisiblePosition(const VisiblePosition& position) con st
1963 { 1963 {
1964 if (layoutObject() && layoutObject()->isTextControl()) { 1964 if (layoutObject() && layoutObject()->isTextControl()) {
1965 HTMLTextFormControlElement* textControl = toLayoutTextControl( 1965 HTMLTextFormControlElement* textControl = toLayoutTextControl(
1966 layoutObject())->textFormControlElement(); 1966 layoutObject())->textFormControlElement();
1967 return textControl->indexForVisiblePosition(position); 1967 return textControl->indexForVisiblePosition(position);
1968 } 1968 }
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2631 if (label && label->layoutObject()) { 2631 if (label && label->layoutObject()) {
2632 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct(); 2632 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct();
2633 result.unite(labelRect); 2633 result.unite(labelRect);
2634 } 2634 }
2635 } 2635 }
2636 2636
2637 return result; 2637 return result;
2638 } 2638 }
2639 2639
2640 } // namespace blink 2640 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextFormControlElementTest.cpp ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698