• dpapad's avatar
    WebUI: Make CrElementsActionMenuTest.All pass in Polymer 2. · fccfd62a
    dpapad authored
    The semantics of document.activeElement and someElement.shadowRoot.activeElement
    seem to have changed between Shadow DOM v0 and v1.
    
    In V1 the following is possible:
    someElement.shadowRoot.activeElement is null AND document.activeElement points to a child
    belonging to |someElement|.
    
    which does not seem to be the case for Shadow DOM v0.
    
    Always recursing from document.activeElement seems more robust and works for both cases.
    
    Bug: 875470
    Change-Id: I53044c23bcfcfa85264b5154e635e44c05ce0f6f
    Reviewed-on: https://chromium-review.googlesource.com/1208454Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
    Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#589049}
    fccfd62a
util.js 16 KB