Changeset 139663 in webkit
- Timestamp:
- Jan 14, 2013 2:21:00 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r139660 r139663 1 2013-01-14 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Need to implement ColorWellRole 4 https://bugs.webkit.org/show_bug.cgi?id=106756 5 6 Reviewed by Chris Fleizach. 7 8 Adds a test of accessibility attributes for input type=color. 9 10 * accessibility/color-well.html: Added. 11 * platform/chromium/accessibility/color-well-expected.txt: Added. 12 * platform/mac/accessibility/color-well-expected.txt: Added. 13 1 14 2013-01-14 Stephen Chenney <schenney@chromium.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r139659 r139663 1 2013-01-14 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Need to implement ColorWellRole 4 https://bugs.webkit.org/show_bug.cgi?id=106756 5 6 Reviewed by Chris Fleizach. 7 8 Maps input type=color to the accessible role ColorWellRole. 9 Adds a new accessor to AccessibilityObject to get the color 10 value in a cross-platform way that doesn't require parsing. 11 12 Test: accessibility/color-well.html 13 14 * accessibility/AccessibilityNodeObject.cpp: 15 (WebCore::AccessibilityNodeObject::determineAccessibilityRole): 16 (WebCore::AccessibilityNodeObject::colorValue): 17 (WebCore): 18 * accessibility/AccessibilityNodeObject.h: 19 (AccessibilityNodeObject): 20 * accessibility/AccessibilityObject.h: 21 (WebCore::AccessibilityObject::isColorWell): 22 (AccessibilityObject): 23 (WebCore::AccessibilityObject::colorValue): 24 * accessibility/AccessibilityRenderObject.cpp: 25 (WebCore::AccessibilityRenderObject::stringValue): 26 (WebCore::AccessibilityRenderObject::determineAccessibilityRole): 27 * accessibility/mac/WebAccessibilityObjectWrapper.mm: 28 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 29 * html/HTMLInputElement.cpp: 30 (WebCore): 31 (WebCore::HTMLInputElement::isColorControl): 32 * html/HTMLInputElement.h: 33 (HTMLInputElement): 34 1 35 2013-01-11 Emil A Eklund <eae@chromium.org> 2 36 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r139456 r139663 285 285 if (input->isRangeControl()) 286 286 return SliderRole; 287 288 #if ENABLE(INPUT_TYPE_COLOR) 289 const AtomicString& type = input->getAttribute(typeAttr); 290 if (equalIgnoringCase(type, "color")) 291 return ColorWellRole; 292 #endif 293 287 294 return TextFieldRole; 288 295 } … … 1612 1619 } 1613 1620 1621 void AccessibilityNodeObject::colorValue(int& r, int& g, int& b) const 1622 { 1623 r = 0; 1624 g = 0; 1625 b = 0; 1626 1627 if (!isColorWell()) 1628 return; 1629 1630 if (!node() || !node()->hasTagName(inputTag)) 1631 return; 1632 1633 HTMLInputElement* input = static_cast<HTMLInputElement*>(node()); 1634 const AtomicString& type = input->getAttribute(typeAttr); 1635 if (!equalIgnoringCase(type, "color")) 1636 return; 1637 1638 // HTMLInputElement::value always returns a string parseable by Color(). 1639 Color color(input->value()); 1640 r = color.red(); 1641 g = color.green(); 1642 b = color.blue(); 1643 } 1644 1614 1645 // This function implements the ARIA accessible name as described by the Mozilla 1615 1646 // ARIA Implementer's Guide. -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h
r137962 r139663 124 124 virtual String text() const; 125 125 virtual String stringValue() const; 126 virtual void colorValue(int& r, int& g, int& b) const; 126 127 virtual String ariaLabeledByAttribute() const; 127 128 -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r139456 r139663 430 430 bool isBlockquote() const; 431 431 bool isLandmark() const; 432 bool isColorWell() const { return roleValue() == ColorWellRole; } 432 433 433 434 virtual bool isChecked() const { return false; } … … 561 562 const AtomicString& placeholderValue() const; 562 563 564 // Only if isColorWell() 565 virtual void colorValue(int& r, int& g, int& b) const { r = 0; g = 0; b = 0; } 566 563 567 void setRoleValue(AccessibilityRole role) { m_role = role; } 564 568 virtual AccessibilityRole roleValue() const { return m_role; } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r139250 r139663 2462 2462 if (input->isTextButton()) 2463 2463 return buttonRoleType(); 2464 2465 #if ENABLE(INPUT_TYPE_COLOR) 2466 const AtomicString& type = input->getAttribute(typeAttr); 2467 if (equalIgnoringCase(type, "color")) 2468 return ColorWellRole; 2469 #endif 2464 2470 } 2465 2471 -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
r139456 r139663 2244 2244 if (m_object->isTabItem()) 2245 2245 return [NSNumber numberWithInt:m_object->isSelected()]; 2246 2247 if (m_object->isColorWell()) { 2248 int r, g, b; 2249 m_object->colorValue(r, g, b); 2250 return [NSString stringWithFormat:@"rgb %7.5f %7.5f %7.5f 1", r / 255., g / 255., b / 255.]; 2251 } 2246 2252 2247 2253 return m_object->stringValue(); -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r139064 r139663 1631 1631 } 1632 1632 1633 #if ENABLE(INPUT_TYPE_COLOR) 1634 bool HTMLInputElement::isColorControl() const 1635 { 1636 return m_inputType->isColorControl(); 1637 } 1638 #endif 1639 1633 1640 bool HTMLInputElement::isText() const 1634 1641 { -
trunk/Source/WebCore/html/HTMLInputElement.h
r137565 r139663 98 98 bool isRangeControl() const; 99 99 100 #if ENABLE(INPUT_TYPE_COLOR) 101 bool isColorControl() const; 102 #endif 103 100 104 // FIXME: It's highly likely that any call site calling this function should instead 101 105 // be using a different one. Many input elements behave like text fields, and in addition -
trunk/Source/WebKit/chromium/ChangeLog
r139652 r139663 1 2013-01-14 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Need to implement ColorWellRole 4 https://bugs.webkit.org/show_bug.cgi?id=106756 5 6 Reviewed by Chris Fleizach. 7 8 Adds an accessibility interface to access the value of a 9 color control. 10 11 * public/WebAccessibilityObject.h: 12 (WebAccessibilityObject): 13 * src/WebAccessibilityObject.cpp: 14 (WebKit::WebAccessibilityObject::colorValue): 15 (WebKit): 16 1 17 2013-01-14 Mark Pilgrim <pilgrim@chromium.org> 2 18 -
trunk/Source/WebKit/chromium/public/WebAccessibilityObject.h
r139323 r139663 130 130 WEBKIT_EXPORT bool canvasHasFallbackContent() const; 131 131 WEBKIT_EXPORT WebPoint clickPoint() const; 132 WEBKIT_EXPORT void colorValue(int& r, int& g, int& b) const; 132 133 WEBKIT_EXPORT double estimatedLoadingProgress() const; 133 134 WEBKIT_EXPORT WebString helpText() const; -
trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp
r138260 r139663 499 499 } 500 500 501 void WebAccessibilityObject::colorValue(int& r, int& g, int& b) const 502 { 503 if (isDetached()) 504 return; 505 506 m_private->colorValue(r, g, b); 507 } 508 501 509 double WebAccessibilityObject::estimatedLoadingProgress() const 502 510 { -
trunk/Tools/ChangeLog
r139658 r139663 1 2013-01-14 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Need to implement ColorWellRole 4 https://bugs.webkit.org/show_bug.cgi?id=106756 5 6 Reviewed by Chris Fleizach. 7 8 Returns a string representation of the value of a color 9 when the role is Color Well, to make it easy to write layout 10 tests for color controls. 11 12 * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp: 13 1 14 2013-01-14 Dominic Mazzoni <dmazzoni@google.com> 2 15 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp
r139658 r139663 286 286 string getStringValue(const WebAccessibilityObject& object) 287 287 { 288 string value = object.stringValue().utf8(); 288 string value; 289 if (object.roleValue() == WebAccessibilityRoleColorWell) { 290 int r, g, b; 291 char buffer[100]; 292 object.colorValue(r, g, b); 293 snprintf(buffer, sizeof(buffer), "rgb %7.5f %7.5f %7.5f 1", r / 255., g / 255., b / 255.); 294 value = buffer; 295 } else 296 value = object.stringValue().utf8(); 289 297 return value.insert(0, "AXValue: "); 290 298 }
Note: See TracChangeset
for help on using the changeset viewer.