This commit is contained in:
Kovid Goyal 2012-01-25 14:34:21 +05:30
parent 507620e12d
commit ceb0638ccd

View File

@ -626,8 +626,16 @@ class CanonicalFragmentIdentifier
return cfi return cfi
cury += delta cury += delta
# TODO: Return the CFI corresponding to the <body> tag # Use a spatial offset on the html element, since we could not find a
null # normal CFI
[x, y] = window_scroll_pos()
de = document.documentElement
rect = de.getBoundingClientRect()
px = (x*100)/rect.width
py = (y*100)/rect.height
cfi = "/2@#{ fstr px }:#{ fstr py }"
return cfi
# }}} # }}}