| <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> |
| <html> |
| <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> |
| <meta charset="utf-8"> |
| |
| <head> |
| <script src="../../../resources/ui-helper.js"></script> |
| <script src="../../../resources/js-test.js"></script> |
| <style> |
| body { |
| margin: 0; |
| } |
| |
| #container { |
| font-size: 16px; |
| width: 310px; |
| } |
| </style> |
| <script> |
| jsTestIsAsync = true; |
| |
| addEventListener("load", async () => { |
| description("When selecting multi-column content and others, the highlight boxes should not be coalesced."); |
| |
| var container = document.getElementById("container"); |
| await UIHelper.longPressElement(container); |
| await UIHelper.waitForSelectionToAppear(); |
| getSelection().selectAllChildren(container); |
| await UIHelper.waitForSelectionToAppear(); |
| selectionRects = await UIHelper.getUISelectionViewRects(); |
| |
| if (selectionRects.length != 5) { |
| testFailed(`The value of selectionRects.length should be 5, but got ${selectionRects.length}`); |
| finishJSTest(); |
| return; |
| } |
| testPassed(`selectionRects.length is ${selectionRects.length}`); |
| |
| shouldBe("selectionRects[0].width", "150"); |
| shouldBe("selectionRects[1].width", "150"); |
| shouldBe("selectionRects[2].width", "150"); |
| shouldBe("selectionRects[3].width", "310"); |
| |
| lastMultiColumnLineBottom = selectionRects[2].top + selectionRects[2].height; |
| outsideContentLineTop = selectionRects[3].top; |
| shouldBeGreaterThan("outsideContentLineTop", "lastMultiColumnLineBottom"); |
| |
| finishJSTest(); |
| }); |
| </script> |
| </head> |
| |
| <body> |
| <div id="container"> |
| <div style="column-count: 2; column-gap: 10px;">Lorem ipsum dolor sit amet, consectetur adipiscing |
| elit.Morbi mauris ex, finibus quis aliquam ac, interdum facilisis ligula.</div> |
| <p id="outside">The selected content out of the multi-column element.</p> |
| </div> |
| </body> |
| </html> |