• manuk's avatar
    [about-omnibox] Performance refactoring of omnibox.js: split refresh method,... · 2985a247
    manuk authored
    [about-omnibox] Performance refactoring of omnibox.js: split refresh method, extract inlined dom elements, and improved html output clearing.
    
    1. Split `refresh` into `refreshAllResults` and `refreshNewResult` for performance reasons as explained in the comments (tldr, refreshing entire output is unnecessary when we only need to add to the output).
    2. Extract variables for inlined expressions to retrieve document elements.
    3. Use `Element.removeChild` instead of `Element.innerHTML = ` to clear output
    
    Change-Id: Ia7085d97537c5f445c950ecb50f35e5880b6124a
    Reviewed-on: https://chromium-review.googlesource.com/1246295
    Commit-Queue: manuk hovanesian <manukh@chromium.org>
    Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#594820}
    2985a247
omnibox.js 18.9 KB