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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXProgressIndicator.cpp

Issue 2805493002: Boolean properties for Accessibility Object Model Phase 1 (Closed)
Patch Set: Back to previous patchset, ready to land Created 3 years, 7 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) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 bool AXProgressIndicator::ComputeAccessibilityIsIgnored( 48 bool AXProgressIndicator::ComputeAccessibilityIsIgnored(
49 IgnoredReasons* ignored_reasons) const { 49 IgnoredReasons* ignored_reasons) const {
50 return AccessibilityIsIgnoredByDefault(ignored_reasons); 50 return AccessibilityIsIgnoredByDefault(ignored_reasons);
51 } 51 }
52 52
53 float AXProgressIndicator::ValueForRange() const { 53 float AXProgressIndicator::ValueForRange() const {
54 if (HasAttribute(aria_valuenowAttr)) 54 if (HasAttribute(aria_valuenowAttr))
55 return GetAttribute(aria_valuenowAttr).ToFloat(); 55 return GetAttribute(aria_valuenowAttr).ToFloat();
56 56
57 if (GetElement()->position() >= 0) 57 if (GetProgressElement()->position() >= 0)
58 return clampTo<float>(GetElement()->value()); 58 return clampTo<float>(GetProgressElement()->value());
59 // Indeterminate progress bar should return 0. 59 // Indeterminate progress bar should return 0.
60 return 0.0f; 60 return 0.0f;
61 } 61 }
62 62
63 float AXProgressIndicator::MaxValueForRange() const { 63 float AXProgressIndicator::MaxValueForRange() const {
64 if (HasAttribute(aria_valuemaxAttr)) 64 if (HasAttribute(aria_valuemaxAttr))
65 return GetAttribute(aria_valuemaxAttr).ToFloat(); 65 return GetAttribute(aria_valuemaxAttr).ToFloat();
66 66
67 return clampTo<float>(GetElement()->max()); 67 return clampTo<float>(GetProgressElement()->max());
68 } 68 }
69 69
70 float AXProgressIndicator::MinValueForRange() const { 70 float AXProgressIndicator::MinValueForRange() const {
71 if (HasAttribute(aria_valueminAttr)) 71 if (HasAttribute(aria_valueminAttr))
72 return GetAttribute(aria_valueminAttr).ToFloat(); 72 return GetAttribute(aria_valueminAttr).ToFloat();
73 73
74 return 0.0f; 74 return 0.0f;
75 } 75 }
76 76
77 HTMLProgressElement* AXProgressIndicator::GetElement() const { 77 HTMLProgressElement* AXProgressIndicator::GetProgressElement() const {
78 return ToLayoutProgress(layout_object_)->ProgressElement(); 78 return ToLayoutProgress(layout_object_)->ProgressElement();
79 } 79 }
80 80
81 } // namespace blink 81 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698