• John Lee's avatar
    WebUI Tab Strip: Update drag image logic · 10e2eac7
    John Lee authored
    This CL aims to make the drag image while dragging tabs and tab groups
    more consistent and more inline to each element's dimensions and DOM
    structure by:
    
    1) Initially basing offsets on the draggable target (the element with
    the draggable attribute) instead of the element. TabGroupElements'
    drag targets are their chips, which will result in different
    calculations than if using the entire TabGroupElement's dimensions
    since tab groups can have many tabs within them.
    
    2) Using percentages instead of exact pixel values as the dimensions
    of the drag image can change before and after dragstart.
    
    3) Taking into consideration any margin or padding that a drag image
    may have by using the dimensions of a drag image's "center" element.
    
    Change-Id: I83c22a220023e6686ebea053a70c61f16c6239f0
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2300988
    Commit-Queue: John Lee <johntlee@chromium.org>
    Reviewed-by: default avatardpapad <dpapad@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#790028}
    10e2eac7
tab_group.js 4.01 KB