Changeset 229801 in webkit
- Timestamp:
- Mar 21, 2018 2:46:12 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r229782 r229801 1 2018-03-21 Frederic Wang <fwang@igalia.com> 2 3 [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com 4 https://bugs.webkit.org/show_bug.cgi?id=183658 5 6 Reviewed by Tim Horton. 7 8 Improve the test added in r224284, so that we test when a result is revealed at 9 the center of the overflow node. 10 11 * platform/ios/fast/scrolling/find-text-in-overflow-node.html: Put some content after 12 'match 4' so that the overflow node can scroll and make the text appear at the center. 13 Perform more accurate testing of the scrollTop of the overflow node. 14 * platform/ios/fast/scrolling/find-text-in-overflow-node-expected.txt: Update expectation. 15 1 16 2018-03-20 Zalan Bujtas <zalan@apple.com> 2 17 -
trunk/LayoutTests/platform/ios/fast/scrolling/find-text-in-overflow-node-expected.txt
r224284 r229801 1 Use iOS Find UI to search for the text "match". The following overflow node should scroll to show the fourth result .1 Use iOS Find UI to search for the text "match". The following overflow node should scroll to show the fourth result at its center. 2 2 3 3 match 2 … … 7 7 match 4 8 8 9 10 9 PASS Initial position of overflow node 11 10 PASS Position of overflow node after the three first results -
trunk/LayoutTests/platform/ios/fast/scrolling/find-text-in-overflow-node.html
r224284 r229801 8 8 <script type="text/javascript"> 9 9 setup({ "explicit_done": true }); 10 function height(id) { 11 return document.getElementById(id).getBoundingClientRect().height; 12 } 10 13 function run() { 11 14 if (!window.testRunner || !testRunner.runUIScript) … … 30 33 `, afterMatch4.step_func_done(function() { 31 34 assert_greater_than(node.scrollTop, 0); 35 var expectedScrollTop = height("divBefore") + height("match4") / 2 - height("scrollable") / 2; 36 assert_approx_equals(node.scrollTop, expectedScrollTop, 2); 32 37 })); 33 38 })); … … 48 53 </head> 49 54 <body onload="run()"> 50 <p>Use iOS Find UI to search for the text "match". The following overflow node should scroll to show the fourth result .</p>55 <p>Use iOS Find UI to search for the text "match". The following overflow node should scroll to show the fourth result at its center.</p> 51 56 <p>match 2</p> 52 57 <p>match 3</p> 53 58 <div id="scrollable"> 54 <div style="height: 200px; background: linear-gradient(135deg, blue, cyan);"></div> 55 <p>match 4</p> 59 <div id="divBefore" style="height: 300px; background: linear-gradient(135deg, blue, cyan);"></div> 60 <div id="match4">match 4</div> 61 <div style="height: 300px; background: linear-gradient(135deg, blue, cyan);"></div> 56 62 </div> 57 63 </body> -
trunk/Source/WebKit/ChangeLog
r229799 r229801 1 2018-03-21 Frederic Wang <fwang@igalia.com> 2 3 [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com 4 https://bugs.webkit.org/show_bug.cgi?id=183658 5 6 Reviewed by Tim Horton. 7 8 On Mobile, many sites have overlay headers or footers that may overlap with the highlighted 9 text inside a scrollable overflow node. To workaround that issue, this commit changes the 10 behavior so that the text is revealed at the center of the overflow node. 11 12 * WebProcess/WebPage/ios/FindControllerIOS.mm: 13 (WebKit::FindController::didFindString): Use alignCenterAlways instead of alignToEdgeIfNeeded. 14 1 15 2018-03-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 16 -
trunk/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm
r224284 r229801 161 161 // Scrolling the main frame is handled by the SmartMagnificationController class but we still 162 162 // need to consider overflow nodes and subframes here. 163 frame.selection().revealSelection(SelectionRevealMode::RevealUpToMainFrame, ScrollAlignment::alignToEdgeIfNeeded, WebCore::DoNotRevealExtent); 163 // On Mobile, many sites have overlay headers or footers that may overlap with the highlighted 164 // text, so we reveal the text at the center of the viewport. See https://webkit.org/b/183658 165 frame.selection().revealSelection(SelectionRevealMode::RevealUpToMainFrame, ScrollAlignment::alignCenterAlways, WebCore::DoNotRevealExtent); 164 166 } 165 167
Note: See TracChangeset
for help on using the changeset viewer.