I feel bad though duplicating stuff. How about a method on browser that takes as a parameter the element? Then this would call it with the element, and from SDL we would call it with the canvas element.