Changeset 227983 in webkit
- Timestamp:
- Feb 1, 2018 3:11:13 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r227979 r227983 1 2018-02-01 Ryosuke Niwa <rniwa@webkit.org> 2 3 Some test cases in accessibility/mac/selection-notification-focus-change.html fail 4 https://bugs.webkit.org/show_bug.cgi?id=182212 5 <rdar://problem/36937147> 6 7 Reviewed by Antti Koivisto and Wenson Hsieh. 8 9 Updated and rebaselined the tests. 10 11 * accessibility/ios-simulator/header-elements.html: Force the layout after each call to element.focus 12 now that element.focus no longer updates the layout synchronously. Ordinarily, this will happen next time 13 the layout is updated for paint, by JS API, etc... but we have to force the accessibility tree to be 14 up-to-date for testing purposes. 15 * accessibility/ios-simulator/table-cell-for-row-col.html: Ditto. 16 * accessibility/mac/selection-notification-focus-change-expected.txt: Now all the test cases are passing. 17 * accessibility/mac/table-with-row-col-of-headers.html: Force the layout after each call to element.focus. 18 * accessibility/mac/table-with-zebra-rows.html: Ditto. 19 * accessibility/scroll-to-global-point-main-window.html: Ditto. 20 * accessibility/scroll-to-make-visible-with-subfocus.html: Ditto. 21 * editing/input/caret-at-the-edge-of-input.html: Wait for the focused element to reveal itself by a timer. 22 * fast/forms/input-text-scroll-left-on-blur.html: Ditto. 23 * fast/forms/textarea-no-scroll-on-blur.html: Ditto. 24 * fast/forms/textarea-scrolled-type.html: Ditto. 25 * platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt: Rebaselined. We now 26 get one less AXTextSelectionChangedFocus notification because selection updates are now coalesced as expected. 27 1 28 2018-02-01 Antoine Quint <graouts@apple.com> 2 29 -
trunk/LayoutTests/accessibility/ios-simulator/header-elements.html
r187904 r227983 26 26 27 27 document.getElementById("button").focus(); 28 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 28 29 var button = accessibilityController.focusedElement; 29 30 30 31 document.getElementById("header").focus(); 32 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 31 33 var header = accessibilityController.focusedElement; 32 34 shouldBeTrue("button.headerElementAtIndex(0).isEqual(header)"); -
trunk/LayoutTests/accessibility/ios-simulator/table-cell-for-row-col.html
r187904 r227983 26 26 27 27 document.getElementById("cell2").focus(); 28 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 28 29 var cell2 = accessibilityController.focusedElement; 29 30 30 31 document.getElementById("header").focus(); 32 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 31 33 var header = accessibilityController.focusedElement; 32 34 … … 34 36 35 37 document.getElementById("cell5").focus(); 38 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 36 39 var cell6 = accessibilityController.focusedElement; 37 40 shouldBeTrue("header.cellForColumnAndRow(1, 2).isEqual(cell6)"); -
trunk/LayoutTests/accessibility/mac/selection-notification-focus-change-expected.txt
r227713 r227983 19 19 Received AXFocusChanged 20 20 Received AXSelectedTextChanged 21 FAIL userInfo["AXTextSelectionChangedFocus"] should be true (of type boolean). Was undefined (of type undefined). 21 PASS userInfo["AXTextSelectionChangedFocus"] is true 22 22 Received AXSelectedTextChanged 23 23 PASS userInfo["AXTextSelectionChangedFocus"] is true -
trunk/LayoutTests/accessibility/mac/table-with-row-col-of-headers.html
r187799 r227983 59 59 60 60 if (window.accessibilityController) { 61 document.getElementById("table1").focus(); 62 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 63 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXTable'"); 61 64 62 document.getElementById("table1").focus(); 63 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXTable'"); 65 document.getElementById("table2").focus(); 66 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 67 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXTable'"); 64 68 65 document.getElementById("table2").focus(); 66 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXTable'"); 69 document.getElementById("table3").focus(); 70 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 71 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXGroup'"); 67 72 68 document.getElementById("table3").focus(); 69 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXGroup'"); 70 71 document.getElementById("table4").focus(); 72 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXGroup'"); 73 document.getElementById("table4").focus(); 74 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 75 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXGroup'"); 73 76 } 74 77 -
trunk/LayoutTests/accessibility/mac/table-with-zebra-rows.html
r187799 r227983 25 25 26 26 if (window.accessibilityController) { 27 28 document.getElementById("table1").focus();29 27 document.getElementById("table1").focus(); 28 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 29 shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXTable'"); 30 30 } 31 31 -
trunk/LayoutTests/accessibility/scroll-to-global-point-main-window.html
r189149 r227983 26 26 if (window.accessibilityController) { 27 27 target.focus(); 28 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 28 29 var targetAccessibleObject = accessibilityController.focusedElement; 29 30 } -
trunk/LayoutTests/accessibility/scroll-to-make-visible-with-subfocus.html
r189149 r227983 21 21 if (window.accessibilityController) { 22 22 target.focus(); 23 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); 23 24 targetAccessibleObject = accessibilityController.focusedElement; 24 25 } -
trunk/LayoutTests/editing/input/caret-at-the-edge-of-input.html
r103073 r227983 7 7 <script> 8 8 9 if (window.testRunner) 10 testRunner.waitUntilDone(); 11 9 12 var inputEdit = document.getElementById("input-edit"); 10 13 inputEdit.focus(); 11 var inputEditContent = inputEdit.value; 12 inputEdit.setSelectionRange(0, 0); 13 if (window.eventSender) { 14 for (var i = 0; i < inputEdit.size * 1.2; ++i) 15 eventSender.keyDown(inputEditContent[i]); 16 } 14 setTimeout(() => { 15 var inputEditContent = inputEdit.value; 16 inputEdit.setSelectionRange(0, 0); 17 18 if (window.eventSender) { 19 for (var i = 0; i < inputEdit.size * 1.2; ++i) 20 eventSender.keyDown(inputEditContent[i]); 21 testRunner.notifyDone(); 22 } 23 }, 0); 17 24 18 25 </script> -
trunk/LayoutTests/fast/forms/input-text-scroll-left-on-blur.html
r13666 r227983 4 4 <p>Tests scrolling back to the beginning when a text field blurs. The first field should be scrolled to the left, the second and third scrolled to the right.</p> 5 5 <script> 6 var a = document.getElementById("a"); 7 a.focus(); 8 a.setSelectionRange(66, 66); 9 if (window.eventSender) { 10 eventSender.keyDown("l"); 6 if (window.testRunner) 7 testRunner.waitUntilDone(); 8 9 function wait(seconds) 10 { 11 return new Promise((resolve) => setTimeout(resolve, seconds)) 11 12 } 12 var b = document.getElementById("b"); 13 b.focus(); 14 b.setSelectionRange(66, 66); 15 if (window.eventSender) { 16 eventSender.keyDown("l"); 13 14 async function runTest() 15 { 16 if (!window.eventSender) { 17 document.body.innerHTML += 'This test requires eventSender.keyDown'; 18 return; 19 } 20 21 var a = document.getElementById("a"); 22 a.focus(); 23 await wait(0); 24 a.setSelectionRange(66, 66); 25 if (window.eventSender) 26 eventSender.keyDown("l"); 27 28 var b = document.getElementById("b"); 29 b.focus(); 30 await wait(0); 31 b.setSelectionRange(66, 66); 32 if (window.eventSender) 33 eventSender.keyDown("l"); 34 35 var c = document.getElementById("c"); 36 c.focus(); 37 await wait(0); 38 c.setSelectionRange(66, 66); 39 if (window.eventSender) 40 eventSender.keyDown("l"); 41 42 if (window.testRunner) 43 testRunner.notifyDone(); 17 44 } 18 var c = document.getElementById("c"); 19 c.focus(); 20 c.setSelectionRange(66, 66); 21 if (window.eventSender) { 22 eventSender.keyDown("l"); 23 } 45 46 window.onload = runTest; 47 24 48 </script> -
trunk/LayoutTests/fast/forms/textarea-no-scroll-on-blur.html
r121008 r227983 2 2 <head> 3 3 <script> 4 function test() { 5 if (window.testRunner) 4 function wait(seconds) { 5 return new Promise((resolve) => setTimeout(resolve, 0), seconds); 6 } 7 8 async function test() { 9 if (window.testRunner) { 6 10 testRunner.dumpAsText(); 11 testRunner.waitUntilDone(); 12 } 7 13 8 14 var ta = document.getElementById('ta'); … … 11 17 ta.focus(); 12 18 ta.setSelectionRange(ta.value.length, ta.value.length); 19 await wait(0); 13 20 ta.blur(); 14 21 22 await wait(0); 15 23 ta.focus(); 24 await wait(0); 16 25 ta.blur(); 17 if (ta.scrollTop != 0) 18 document.getElementById('res').innerHTML = "Test Passed"; 26 await wait(0); 27 28 document.getElementById('res').innerHTML = ta.scrollTop != 0 ? "Test Passed" : "Test Failed"; 29 30 if (window.testRunner) 31 testRunner.notifyDone(); 19 32 } 20 33 </script> … … 30 43 5 31 44 </textarea> 32 <div id="res"> Test Failed</div>45 <div id="res"></div> 33 46 </body> 34 47 </html> -
trunk/LayoutTests/fast/forms/textarea-scrolled-type.html
r18341 r227983 3 3 <script src=../../editing/editing.js language="JavaScript" type="text/JavaScript" ></script> 4 4 <script> 5 function test()5 function wait(seconds) 6 6 { 7 return new Promise((resolve) => setTimeout(resolve, 0), seconds); 8 } 9 10 async function test() 11 { 12 if (window.testRunner) 13 testRunner.waitUntilDone(); 14 7 15 var res = document.getElementById('res'); 8 16 var ta = document.getElementById('ta'); … … 10 18 // Send caret to bottom of textarea 11 19 ta.focus(); 20 await wait(0); 12 21 ta.setSelectionRange(ta.value.length, ta.value.length); 22 await wait(0); 13 23 ta.blur(); 24 await wait(0); 14 25 15 26 ta.focus(); 27 await wait(0); 16 28 ta.setSelectionRange(44, 44); 17 29 typeCharacterCommand(' '); … … 21 33 typeCharacterCommand('s'); 22 34 35 if (window.testRunner) 36 testRunner.notifyDone(); 23 37 } 24 38 </script> -
trunk/LayoutTests/platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt
r227713 r227983 19 19 Received AXFocusChanged 20 20 Received AXSelectedTextChanged 21 FAIL userInfo["AXTextSelectionChangedFocus"] should be true (of type boolean). Was undefined (of type undefined). 22 Received AXSelectedTextChanged 23 FAIL userInfo["AXTextSelectionChangedFocus"] should be true (of type boolean). Was undefined (of type undefined). 21 PASS userInfo["AXTextSelectionChangedFocus"] is true 24 22 PASS successfullyParsed is true 25 23 -
trunk/Source/WebCore/ChangeLog
r227980 r227983 1 2018-02-01 Ryosuke Niwa <rniwa@webkit.org> 2 3 Some test cases in accessibility/mac/selection-notification-focus-change.html fail 4 https://bugs.webkit.org/show_bug.cgi?id=182212 5 <rdar://problem/36937147> 6 7 Reviewed by Antti Koivisto and Wenson Hsieh. 8 9 The failure was caused by the async update of the selection appearance not preserving selection reveal intent. 10 Fixed the bug by storing the intent in a member variable and using it later. 11 12 * dom/Element.cpp: 13 (WebCore::Element::focus): Removed an unnecessary synchronous layout update. 14 * editing/FrameSelection.cpp: 15 (WebCore::FrameSelection::setNeedsSelectionUpdate): Use the default intent to preserve the old behavior. 16 (WebCore::FrameSelection::respondToNodeModification): Ditto. 17 (WebCore::FrameSelection::setSelection): Save the selection reveal intent. 18 (WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): Use the saved intent. 19 * editing/FrameSelection.h: 20 * page/FocusController.cpp: 21 (WebCore::FocusController::advanceFocusDirectionally): Always update the layout before invoking 22 nodeRectInAbsoluteCoordinates. 23 1 24 2018-02-01 Zalan Bujtas <zalan@apple.com> 2 25 -
trunk/Source/WebCore/dom/Element.cpp
r227714 r227983 2424 2424 } 2425 2425 2426 // Setting the focused node above might have invalidated the layout due to scripts.2427 document().updateLayoutIgnorePendingStylesheets();2428 2429 2426 SelectionRevealMode revealMode = SelectionRevealMode::Reveal; 2430 2427 #if PLATFORM(IOS) -
trunk/Source/WebCore/editing/FrameSelection.cpp
r227092 r227983 375 375 m_alwaysAlignCursorOnScrollWhenRevealingSelection = align == AlignCursorOnScrollAlways; 376 376 377 m_selectionRevealIntent = intent; 377 378 m_pendingSelectionUpdate = true; 378 379 … … 403 404 void FrameSelection::setNeedsSelectionUpdate() 404 405 { 406 m_selectionRevealIntent = AXTextStateChangeIntent(); 405 407 m_pendingSelectionUpdate = true; 406 408 if (RenderView* view = m_frame->contentRenderer()) … … 527 529 528 530 // Trigger a selection update so the selection will be set again. 531 m_selectionRevealIntent = AXTextStateChangeIntent(); 529 532 m_pendingSelectionUpdate = true; 530 533 renderView->frameView().scheduleSelectionUpdate(); … … 2448 2451 2449 2452 setCaretRectNeedsUpdate(); 2450 updateAndRevealSelection( AXTextStateChangeIntent());2453 updateAndRevealSelection(m_selectionRevealIntent); 2451 2454 updateDataDetectorsForSelection(); 2452 2455 } -
trunk/Source/WebCore/editing/FrameSelection.h
r227092 r227983 348 348 349 349 SelectionRevealMode m_selectionRevealMode { SelectionRevealMode::DoNotReveal }; 350 AXTextStateChangeIntent m_selectionRevealIntent; 350 351 351 352 bool m_caretInsidePositionFixed : 1; -
trunk/Source/WebCore/page/FocusController.cpp
r224320 r227983 1082 1082 Node* container = focusedDocument; 1083 1083 1084 if (is<Document>(*container)) 1085 downcast<Document>(*container).updateLayoutIgnorePendingStylesheets(); 1084 focusedDocument->updateLayoutIgnorePendingStylesheets(); 1086 1085 1087 1086 // Figure out the starting rect. … … 1104 1103 do { 1105 1104 consumed = advanceFocusDirectionallyInContainer(container, startingRect, direction, event); 1105 focusedDocument->updateLayoutIgnorePendingStylesheets(); 1106 1106 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore border */); 1107 1107 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direction, container); 1108 if (is<Document>(container))1109 downcast<Document>(*container).updateLayoutIgnorePendingStylesheets();1110 1108 } while (!consumed && container); 1111 1109
Note: See TracChangeset
for help on using the changeset viewer.