Thank you very much. I am not on the slack channel yet but I have requested an invite. Please bear in mind that timezones might be an issue for synchronous communication—I'm in Japan :)
This is some more detailed information.
The bug is in the method InspectorHighlightBase::BuildNodeQuads(), which calculates the location and size of each highlight area.
For the green "padding" highlight, it uses the content+padding rectangle from the layout box. But then, to include the scrollbars inside this highlight, it simply adds their width and height to the highlight's width and height. This works well only when the scrollbars are along the right and bottom edges, but causes some funky behaviour otherwise.
For the blue "content" highlight, it starts with the box's content rectangle and adds the sizes of the scrollbars, with the same problems as above.
The CL that I am working on introduces a method LayoutBox::ComputeScrollbars() which calculates the size of scrollbars (and scrollbar gutters) along the four edges, so fixing the green "padding" highlight to include scrollbars can be done like this:
padding_box = layout_box->PhysicalPaddingBoxRect();
NGPhysicalBoxStrut scrollbars = layout_box->ComputeScrollbars();
padding_box.SetX(padding_box.X() - scrollbars.left);
padding_box.SetY(padding_box.Y() - scrollbars.top);
padding_box.SetWidth(padding_box.Width() + scrollbars.HorizontalSum());
padding_box.SetHeight(padding_box.Height() + scrollbars.VerticalSum());
As for the blue "content" highlight, I am not sure of what would be the ideal behaviour. I am leaning towards using the inner content rect without changes, but there might be use cases that I am missing.