Get rid of match statements in Layout queries.(fixes #2019)
Get rid of match statements in layout queries in script_task
auto merge of #2022 : lpy/servo/issue2019, r=jdm

see #2019