Related: fdo#81147 check if colorlist is valid

Change-Id: Ifd48526974b7fcb10872d53d42e26add3fe878d1
Resolves: fdo#81147 fix mismatching drawlayer and docshell colorlists

a bit of mis-merge + a bit of underlying crashiness

regression from 378dc6ef20ffd0e657d78dbf6646d48059be4045

Change-Id: Id0f7b6b6f13e1ec70dc900c21d2d020a44cf6081