how does it work when gathering high quality items in regards to the order of operations on % checks?

for example: lets say the % chance in the gathering window to gather normal quality items is 80% and then the % chance to gather a high quality item is 15%

does the game roll the 80% chance to gather the item first and if you pass that roll check do you THEN have to pass another roll check of the 15% to see if you get a high quality item?

or does the game first roll the 15% chance to get the high quality item and if you fail that roll does it THEN roll the 80% chance to see if you get a normal quality version of the item? this way would make the most sense because it preserves the correct % chances shown in the gathering window this way.

or does it work another way?

sorry if this question has been asked before. if it has could you kindly link to me the thread with the answer or the official information provided by the devs. thanks.