forked from mirrors/gecko-dev
		
	Backed out changeset 469d4a744966 (bug 1305428) for causing ba failures on browser_caching_value.js CLOSED TREE
				
					
				
			This commit is contained in:
		
							parent
							
								
									fbd72b154b
								
							
						
					
					
						commit
						dcd457cb1e
					
				
					 2 changed files with 47 additions and 4 deletions
				
			
		|  | @ -744,8 +744,22 @@ LayoutDeviceIntRect LocalAccessible::Bounds() const { | |||
| void LocalAccessible::SetSelected(bool aSelect) { | ||||
|   if (!HasOwnContent()) return; | ||||
| 
 | ||||
|   if (nsAccUtils::GetSelectableContainer(this, State()) && aSelect) { | ||||
|     TakeFocus(); | ||||
|   LocalAccessible* select = nsAccUtils::GetSelectableContainer(this, State()); | ||||
|   if (select) { | ||||
|     if (select->State() & states::MULTISELECTABLE) { | ||||
|       if (mContent->IsElement() && ARIARoleMap()) { | ||||
|         if (aSelect) { | ||||
|           mContent->AsElement()->SetAttr( | ||||
|               kNameSpaceID_None, nsGkAtoms::aria_selected, u"true"_ns, true); | ||||
|         } else { | ||||
|           mContent->AsElement()->UnsetAttr(kNameSpaceID_None, | ||||
|                                            nsGkAtoms::aria_selected, true); | ||||
|         } | ||||
|       } | ||||
|       return; | ||||
|     } | ||||
| 
 | ||||
|     if (aSelect) TakeFocus(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
|  | @ -1805,7 +1819,27 @@ double LocalAccessible::CurValue() const { | |||
|   return checkValue; | ||||
| } | ||||
| 
 | ||||
| bool LocalAccessible::SetCurValue(double aValue) { return false; } | ||||
| bool LocalAccessible::SetCurValue(double aValue) { | ||||
|   const nsRoleMapEntry* roleMapEntry = ARIARoleMap(); | ||||
|   if (!roleMapEntry || roleMapEntry->valueRule == eNoValue) return false; | ||||
| 
 | ||||
|   const uint32_t kValueCannotChange = states::READONLY | states::UNAVAILABLE; | ||||
|   if (State() & kValueCannotChange) return false; | ||||
| 
 | ||||
|   double checkValue = MinValue(); | ||||
|   if (!std::isnan(checkValue) && aValue < checkValue) return false; | ||||
| 
 | ||||
|   checkValue = MaxValue(); | ||||
|   if (!std::isnan(checkValue) && aValue > checkValue) return false; | ||||
| 
 | ||||
|   nsAutoString strValue; | ||||
|   strValue.AppendFloat(aValue); | ||||
| 
 | ||||
|   if (!mContent->IsElement()) return true; | ||||
| 
 | ||||
|   return NS_SUCCEEDED(mContent->AsElement()->SetAttr( | ||||
|       kNameSpaceID_None, nsGkAtoms::aria_valuenow, strValue, true)); | ||||
| } | ||||
| 
 | ||||
| role LocalAccessible::FindNextValidARIARole( | ||||
|     std::initializer_list<nsStaticAtom*> aRolesToSkip) const { | ||||
|  | @ -3035,7 +3069,15 @@ LocalAccessible* LocalAccessible::CurrentItem() const { | |||
|   return nullptr; | ||||
| } | ||||
| 
 | ||||
| void LocalAccessible::SetCurrentItem(const LocalAccessible* aItem) {} | ||||
| void LocalAccessible::SetCurrentItem(const LocalAccessible* aItem) { | ||||
|   nsAtom* id = aItem->GetContent()->GetID(); | ||||
|   if (id) { | ||||
|     nsAutoString idStr; | ||||
|     id->ToString(idStr); | ||||
|     mContent->AsElement()->SetAttr( | ||||
|         kNameSpaceID_None, nsGkAtoms::aria_activedescendant, idStr, true); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| LocalAccessible* LocalAccessible::ContainerWidget() const { | ||||
|   if (HasARIARole() && mContent->HasID()) { | ||||
|  |  | |||
|  | @ -48,6 +48,7 @@ | |||
|       gQueue.push(new takeFocusInvoker("aria-link")); | ||||
|       gQueue.push(new takeFocusInvoker("aria-link2")); | ||||
|       gQueue.push(new takeFocusInvoker("link")); | ||||
|       gQueue.push(new takeFocusInvoker("item2")); | ||||
|       gQueue.push(new takeFocusInvoker(document)); | ||||
|       gQueue.push(new takeFocusInvoker("lb_item2")); | ||||
|       gQueue.push(new takeFocusInvoker(document)); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Norisz Fay
						Norisz Fay