зеркало из https://github.com/mozilla/pjs.git
Bug 382296 reduce compile warnings with gcc in a11y module
r=surkov.alexander
This commit is contained in:
Родитель
11bf083391
Коммит
3249bb853a
|
@ -285,9 +285,11 @@ getCharacterExtentsCB(AtkText *aText, gint aOffset,
|
|||
PRInt32 extY = 0, extX = 0;
|
||||
PRInt32 extWidth = 0, extHeight = 0;
|
||||
|
||||
PRUint32 geckoCoordType = (aCoords == ATK_XY_SCREEN) ?
|
||||
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
|
||||
nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
|
||||
PRUint32 geckoCoordType;
|
||||
if (aCoords == ATK_XY_SCREEN)
|
||||
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
|
||||
else
|
||||
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
|
||||
|
||||
nsresult rv = accText->GetCharacterExtents(aOffset, &extX, &extY,
|
||||
&extWidth, &extHeight,
|
||||
|
@ -317,9 +319,11 @@ getRangeExtentsCB(AtkText *aText, gint aStartOffset, gint aEndOffset,
|
|||
PRInt32 extY = 0, extX = 0;
|
||||
PRInt32 extWidth = 0, extHeight = 0;
|
||||
|
||||
PRUint32 geckoCoordType = (aCoords == ATK_XY_SCREEN) ?
|
||||
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
|
||||
nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
|
||||
PRUint32 geckoCoordType;
|
||||
if (aCoords == ATK_XY_SCREEN)
|
||||
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
|
||||
else
|
||||
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
|
||||
|
||||
nsresult rv = accText->GetRangeExtents(aStartOffset, aEndOffset,
|
||||
&extX, &extY,
|
||||
|
@ -363,9 +367,11 @@ getOffsetAtPointCB(AtkText *aText,
|
|||
NS_ENSURE_TRUE(accText, -1);
|
||||
|
||||
PRInt32 offset = 0;
|
||||
PRUint32 geckoCoordType = (aCoords == ATK_XY_SCREEN) ?
|
||||
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
|
||||
nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
|
||||
PRUint32 geckoCoordType;
|
||||
if (aCoords == ATK_XY_SCREEN)
|
||||
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
|
||||
else
|
||||
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
|
||||
|
||||
accText->GetOffsetAtPoint(aX, aY, geckoCoordType, &offset);
|
||||
return NS_STATIC_CAST(gint, offset);
|
||||
|
|
|
@ -1065,9 +1065,12 @@ nsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
const nsStyleXUL *xulStyle = frame->GetStyleXUL();
|
||||
if (xulStyle) {
|
||||
// In XUL all boxes are either vertical or horizontal
|
||||
*aExtraState |= (xulStyle->mBoxOrient == NS_STYLE_BOX_ORIENT_VERTICAL) ?
|
||||
nsIAccessibleStates::EXT_STATE_VERTICAL :
|
||||
nsIAccessibleStates::EXT_STATE_HORIZONTAL;
|
||||
if (xulStyle->mBoxOrient == NS_STYLE_BOX_ORIENT_VERTICAL) {
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_VERTICAL;
|
||||
}
|
||||
else {
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_HORIZONTAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1076,8 +1079,12 @@ nsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
mRoleMapEntry->role == nsIAccessibleRole::ROLE_PASSWORD_TEXT)) {
|
||||
PRBool isEqual =
|
||||
NS_LITERAL_CSTRING("textarea").Equals(mRoleMapEntry->roleString);
|
||||
*aExtraState = isEqual? nsIAccessibleStates::EXT_STATE_MULTI_LINE :
|
||||
nsIAccessibleStates::EXT_STATE_SINGLE_LINE;
|
||||
if (isEqual) {
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_MULTI_LINE;
|
||||
}
|
||||
else {
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_SINGLE_LINE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(state & nsIAccessibleStates::STATE_UNAVAILABLE)) { // If not disabled
|
||||
|
|
|
@ -56,8 +56,8 @@
|
|||
NS_IMPL_ISUPPORTS_INHERITED2(nsCaretAccessible, nsLeafAccessible, nsIAccessibleCaret, nsISelectionListener)
|
||||
|
||||
nsCaretAccessible::nsCaretAccessible(nsIDOMNode* aDocumentNode, nsIWeakReference* aShell, nsRootAccessible *aRootAccessible):
|
||||
nsLeafAccessible(aDocumentNode, aShell), mLastCaretOffset(-1), mLastNodeWithCaret(nsnull),
|
||||
mCurrentControl(nsnull), mRootAccessible(aRootAccessible)
|
||||
nsLeafAccessible(aDocumentNode, aShell), mCurrentControl(nsnull), mLastNodeWithCaret(nsnull),
|
||||
mLastCaretOffset(-1), mRootAccessible(aRootAccessible)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -452,8 +452,12 @@ nsHTMLTextFieldAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
|
||||
nsCOMPtr<nsIDOMHTMLInputElement> htmlInput(do_QueryInterface(mDOMNode));
|
||||
// Is it an <input> or a <textarea> ?
|
||||
*aExtraState |= htmlInput ? nsIAccessibleStates::EXT_STATE_SINGLE_LINE :
|
||||
nsIAccessibleStates::EXT_STATE_MULTI_LINE;
|
||||
if (htmlInput) {
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_SINGLE_LINE;
|
||||
}
|
||||
else {
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_MULTI_LINE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> bindingContent = content->GetBindingParent();
|
||||
if (bindingContent &&
|
||||
|
|
|
@ -84,6 +84,7 @@ nsHTMLImageAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
// STATE_ANIMATED if this is an animated image.
|
||||
|
||||
nsresult rv = nsLinkableAccessible::GetState(aState, aExtraState);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIImageLoadingContent> content(do_QueryInterface(mDOMNode));
|
||||
nsCOMPtr<imgIRequest> imageRequest;
|
||||
|
|
|
@ -806,9 +806,13 @@ void nsHTMLSelectOptionAccessible::SelectionChangedIfOption(nsIContent *aPossibl
|
|||
privateMultiSelect->FireToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
|
||||
multiSelect, nsnull);
|
||||
PRUint32 state = State(optionAccessible);
|
||||
PRUint32 eventType = (state & nsIAccessibleStates::STATE_SELECTED) ?
|
||||
PRUint32(nsIAccessibleEvent::EVENT_SELECTION_ADD) :
|
||||
PRUint32(nsIAccessibleEvent::EVENT_SELECTION_REMOVE);
|
||||
PRUint32 eventType;
|
||||
if (state & nsIAccessibleStates::STATE_SELECTED) {
|
||||
eventType = nsIAccessibleEvent::EVENT_SELECTION_ADD;
|
||||
}
|
||||
else {
|
||||
eventType = nsIAccessibleEvent::EVENT_SELECTION_REMOVE;
|
||||
}
|
||||
privateMultiSelect->FireToolkitEvent(eventType, optionAccessible, nsnull);
|
||||
}
|
||||
|
||||
|
|
|
@ -802,8 +802,12 @@ nsXULTextFieldAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
PRBool isMultiLine = content->HasAttr(kNameSpaceID_None,
|
||||
nsAccessibilityAtoms::multiline);
|
||||
|
||||
*aExtraState |= (isMultiLine ? nsIAccessibleStates::EXT_STATE_MULTI_LINE :
|
||||
nsIAccessibleStates::EXT_STATE_SINGLE_LINE);
|
||||
if (isMultiLine) {
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_MULTI_LINE;
|
||||
}
|
||||
else {
|
||||
*aExtraState |= nsIAccessibleStates::EXT_STATE_SINGLE_LINE;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -292,8 +292,12 @@ nsXULMenuitemAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
|
|||
*aState |= nsIAccessibleStates::STATE_HASPOPUP;
|
||||
PRBool isOpen;
|
||||
element->HasAttribute(NS_LITERAL_STRING("open"), &isOpen);
|
||||
*aState |= isOpen ? nsIAccessibleStates::STATE_EXPANDED :
|
||||
nsIAccessibleStates::STATE_COLLAPSED;
|
||||
if (isOpen) {
|
||||
*aState |= nsIAccessibleStates::STATE_EXPANDED;
|
||||
}
|
||||
else {
|
||||
*aState |= nsIAccessibleStates::STATE_COLLAPSED;
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoString menuItemType;
|
||||
|
|
Загрузка…
Ссылка в новой задаче