Browse files

fix Window.getDocumentRoot() for safary

It looks like existing getDocumentRoot() override for safary does not work any more (tested on Chromium 21).
Replace it with just returning doc().body.
After this Window.getScrollTop() started to work again.
  • Loading branch information...
1 parent 4279d5a commit 6ea2c01993769a5cd906e0a7562af4ef8cc8bf06 @vsevolod-fedorov vsevolod-fedorov committed Jan 16, 2013
Showing with 1 addition and 8 deletions.
  1. +1 −8 library/pyjamas/Window.safari.py
View
9 library/pyjamas/Window.safari.py
@@ -1,9 +1,2 @@
def getDocumentRoot():
- # Safari does not implement $doc.compatMode.
- # Use a CSS test to determine rendering mode.
- JS("""
- var elem = $doc['createElement']('div');
- elem['style']['cssText'] = "width:0px;width:1";
- return parseInt(elem['style']['width']) != 1 ? $doc['documentElement'] :
- $doc['body'];
- """)
+ return doc().body

0 comments on commit 6ea2c01

Please sign in to comment.