The negotiation goes something like this:

Widget: “Hey parent, what are my constraints?”

Parent: “You must be from 80 to 300 pixels wide,
   and 30 to 85 tall.”

Widget: “Hmmm, since I want to have 5 pixels of padding,
   then my children can have at most 290 pixels of width
   and 75 pixels of height.”

Widget: “Hey first child, You must be from 0 to 290
   pixels wide, and 0 to 75 tall.”

First child: “OK, then I wish to be 290 pixels wide,
   and 20 pixels tall.”

Widget: “Hmmm, since I want to put my second child below the
   first one, this leaves only 55 pixels of height for
   my second child.”