Both parentRule nor parentStyleSheet are accessible via JS, so custom properties need to be preserved.
Created attachment 75043 [details] proposed patch
Committed <http://trac.webkit.org/changeset/72819>.