[banner] Fix tabindex issue of hidden links in line-clamp mode.
The links in the banner text hide when window shrinks and ellipsis appears but as their display is visible they can gain focus through tab key. It results in breaking the ellipsis message and scrolling down to show the link text. The following structure of elements used to handle this situation: container > wrapper > link This change adds an observer to check if the ellipsis is shown and hide the wrapper if so, so the <link> can't get focus anymore. The CSS ellipsis is active and applied if the scroll width or height of the element is greater than its client width or height. This is checked every time the size of element changes. The links don't get focus with tab key as their container is hidden when CSS ellipsis active. It behaves good because the links are the last part of the texts, so having overflowed or ellipsis means the links are invisible now and safe to hide their container. The download warning message needed more changes as the link was embedded in the message string, so a wrapper (link-wrapper) added to handle hide. Hiding the link itself leads to removing of ellipsis so a wrapper helps. Bug: 1082539 Change-Id: I13a8e6569da93967963a0f5c919b19e30c0fedca Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2257459 Commit-Queue: Omid Tourzan <oto@chromium.org> Reviewed-by:Alex Danilo <adanilo@chromium.org> Reviewed-by:
Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#781235}
Showing
Please register or sign in to comment