It can just ask the layer.
Created attachment 233346 [details] patch
Comment on attachment 233346 [details] patch Clearing flags on attachment: 233346 Committed r170139: <http://trac.webkit.org/changeset/170139>
All reviewed patches have been landed. Closing bug.