Fixed ForeignObject with virtual related fields.

This change has a significant positive effect on the number of test
failures and errors, bringing it down from these counts:
FAILED (failures=32, errors=37, skipped=416, expected failures=11)
to these:
FAILED (failures=11, errors=15, skipped=416, expected failures=11)