From a49bfa16f8af971e24213cf50faf25e31530771a Mon Sep 17 00:00:00 2001 From: Gurzau Raul Date: Fri, 3 Jan 2020 00:41:00 +0200 Subject: [PATCH] Backed out changeset fce0a89353f1 (bug 1606161) for failing at /browser_net_har_copy_all_as_har.js on a CLOSED TREE. --- .../src/components/request-list/RequestListHeader.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/devtools/client/netmonitor/src/components/request-list/RequestListHeader.js b/devtools/client/netmonitor/src/components/request-list/RequestListHeader.js index b705ab9637482..ac5028502138a 100644 --- a/devtools/client/netmonitor/src/components/request-list/RequestListHeader.js +++ b/devtools/client/netmonitor/src/components/request-list/RequestListHeader.js @@ -438,11 +438,19 @@ class RequestListHeader extends Component { */ shouldUpdateWidths() { const visibleColumns = this.getVisibleColumns(); - const columnsData = this.props.columnsData; let totalPercent = 0; visibleColumns.forEach(col => { - totalPercent += columnsData.get(col.name).width; + const name = col.name; + const headerRef = this.refs[`${name}Header`]; + // Get column width from style. + let widthFromStyle = 0; + // In case the column is in visibleColumns but has display:none + // we don't want to count its style.width into totalPercent. + if (headerRef.getBoundingClientRect().width > 0) { + widthFromStyle = headerRef.style.width.slice(0, -1); + } + totalPercent += +widthFromStyle; // + converts it to a number }); // Do not update if total percent is from 99-101% or when it is 0