Changeset 232259 in webkit
- Timestamp:
- May 29, 2018 9:19:09 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r232255 r232259 1 2018-05-29 Nan Wang <n_wang@apple.com> 2 3 AX: setValue on contenteditable should preserve whitespace 4 https://bugs.webkit.org/show_bug.cgi?id=185897 5 6 Reviewed by Ryosuke Niwa. 7 8 * accessibility/mac/AOM-event-accessiblesetvalue-expected.txt: 9 * accessibility/mac/AOM-event-accessiblesetvalue.html: 10 * accessibility/mac/set-value-editable-types-expected.txt: 11 * accessibility/mac/set-value-editable-types.html: 12 1 13 2018-05-29 Antoine Quint <graouts@apple.com> 2 14 -
trunk/LayoutTests/accessibility/mac/AOM-event-accessiblesetvalue-expected.txt
r230890 r232259 14 14 Test Contenteditable. 15 15 contenteditable accessible set value to: contenteditable new value 16 PASS axNode.stringValue is 'AXValue: contenteditable new value' 16 17 17 18 Test Slider. -
trunk/LayoutTests/accessibility/mac/AOM-event-accessiblesetvalue.html
r230890 r232259 64 64 node.onaccessiblesetvalue = function(event) { 65 65 debug("contenteditable accessible set value to: " + event.value); 66 testSlider();67 66 }; 67 accessibilityController.addNotificationListener(function(element, notification) { 68 if (notification == "AXValueChanged") { 69 shouldBe("axNode.stringValue", "'AXValue: contenteditable new value'"); 70 node.blur(); 71 accessibilityController.removeNotificationListener(); 72 testSlider(); 73 } 74 }); 75 node.focus(); 68 76 axNode.setValue("contenteditable new value"); 69 77 } -
trunk/LayoutTests/accessibility/mac/set-value-editable-types-expected.txt
r232120 r232259 10 10 Writable: true 11 11 Value change notification received 12 Updated Value: AXValue: leading and trailing spaces12 Updated Value: AXValue: leading and trailing spaces 13 13 PASS successfullyParsed is true 14 14 -
trunk/LayoutTests/accessibility/mac/set-value-editable-types.html
r232120 r232259 38 38 debug("Writable: " + writable); 39 39 40 document.getElementById(idValue).focus(); 41 40 42 axElement.setValue(" leading and trailing spaces "); 41 43 } -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r232032 r232259 515 515 webkit.org/b/183352 accessibility/ios-simulator/AOM-dismiss-event.html [ Skip ] 516 516 webkit.org/b/184742 accessibility/mac/async-increment-decrement-action.html [ Skip ] 517 webkit.org/b/185897 accessibility/mac/AOM-event-accessiblesetvalue.html [ Skip ] 518 webkit.org/b/185897 accessibility/mac/set-value-editable-types.html [ Skip ] 517 519 518 520 webkit.org/b/182752 accessibility/mac/accessibility-make-first-responder.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r232257 r232259 1 2018-05-29 Nan Wang <n_wang@apple.com> 2 3 AX: setValue on contenteditable should preserve whitespace 4 https://bugs.webkit.org/show_bug.cgi?id=185897 5 6 Reviewed by Ryosuke Niwa. 7 8 We should mimic typing when setting value to a contenteditable from accessibility 9 instead of mutating the DOM by using setInnerText. 10 11 Updated tests to cover this change. 12 13 * accessibility/AccessibilityRenderObject.cpp: 14 (WebCore::AccessibilityRenderObject::setValue): 15 1 16 2018-05-29 Zalan Bujtas <zalan@apple.com> 2 17 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r232229 r232259 1779 1779 downcast<HTMLTextAreaElement>(element).setValue(string); 1780 1780 else if (is<HTMLElement>(element) && contentEditableAttributeIsEnabled(&element)) { 1781 // Set the style to the element so the child Text node won't collapse spaces1782 if (is<RenderElement>(renderer)) {1783 RenderElement& renderElement = downcast<RenderElement>(renderer);1784 auto style = RenderStyle::create();1785 style.inheritFrom(renderElement.style());1786 style.setWhiteSpace(WhiteSpace::Pre);1787 renderElement.setStyleInternal(WTFMove(style));1788 }1789 downcast<HTMLElement>(element).setInnerText(string);1781 // We should use the editor's insertText to mimic typing into the contenteditable field. 1782 // Also only do this when the field is in editing mode. 1783 if (Frame* frame = renderer.document().frame()) { 1784 Editor& editor = frame->editor(); 1785 if (element.shouldUseInputMethod()) { 1786 editor.clearText(); 1787 editor.insertText(string, nullptr); 1788 } 1789 } 1790 1790 } 1791 1791 }
Note: See TracChangeset
for help on using the changeset viewer.