Fix toolbar population issue
Fix toolbar population issue

Currently, toolbar items provided by ExpandableContainerWidgets and
ContainerWidgets are prepended to the widget headers. Visually this
looks fine, but it creates a DOM structure that's backwards relative to
the order in which the items are actually displayed.

This change fixes toolbar population so that toolbar
items provided by ExpandableContainerWidgets are appended to the end of
the widget headers, and items provided by ContainerWidgets are still
prepended to maintain the current behavior there. It's necessary to
handle the two cases separately because changing the DOM order in
ContainerWidgets actually does affect the visual appearance, regressing
the Event Listeners sidebar in the Elements panel from [2] to [3].

Example of ExpandableContainerWidget with toolbar buttons: [1]

Originally reviewed at
https://chromium-review.googlesource.com/c/chromium/src/+/1716232

[1] https://gyazo.com/cf52279f299f23752740b4cd522c2689
[2] https://i.imgur.com/qvTS6Nq.png
[3] https://i.imgur.com/2ykdZ3H.png

Bug: 963183
Change-Id: I898e9c05971beefa2badece2bdff01bd29d1a35f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1879588
Commit-Queue: Jack Lynch <d6fb7cfbb8c8618e756350219cb7952a0ad656b7@microsoft.com>
Reviewed-by: Lorne Mitchell <b024a4e2ee56b9b5450225fa7affa8f95408a018@microsoft.com>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend