def createElement(self):
        e = DOM.createElement("CANVAS")
        try:
            # This results occasionally in an error:
            # AttributeError: XPCOM component '<unknown>' has no attribute 'MozGetIPCContext'
            self.setCanvasContext(e.MozGetIPCContext(u'2d'))
        except __HOLE__:
            # In which case this seems to work:
            self.setCanvasContext(e.getContext('2d'))
        return e
dataset/ETHPy150Open pyjs/pyjs/pyjswidgets/pyjamas/Canvas/GWTCanvasImplDefault.hulahop.py/GWTCanvasImplDefault.createElement