def parse_def(surface, node):
    """Parse the SVG definitions."""
    for def_type in ('marker', 'gradient', 'pattern', 'path', 'mask', 'filter'
        ):
        if def_type in node.tag.lower() and 'id' in node:
            getattr(surface, '{}s'.format(def_type))[node['id']] = node
