diff --git a/js/views/cfi_navigation_logic.js b/js/views/cfi_navigation_logic.js index 43d9e75a7..5e17ec283 100644 --- a/js/views/cfi_navigation_logic.js +++ b/js/views/cfi_navigation_logic.js @@ -424,6 +424,17 @@ var CfiNavigationLogic = function(options) { clientRectList = range.getClientRects(); } else { clientRectList = $el[0].getClientRects(); + + // If the element is something like this: then the svg:image does not produce client rectangles; so we move to the + // enclosing svg tag and get those rectangles + try { + if (clientRectList.length === 0 && $el[0].ownerSVGElement) { + clientRectList = $($el[0].ownerSVGElement)[0].getClientRects(); + } + } + catch (e) { + // silently swallow up the error; apparently we can't get clientRectList s + } } // all the separate rectangles (for detecting position of the element diff --git a/readium-cfi-js b/readium-cfi-js index 37ca4bc92..74c9eb365 160000 --- a/readium-cfi-js +++ b/readium-cfi-js @@ -1 +1 @@ -Subproject commit 37ca4bc9266c349cfca8f84e43e86ea81bcc5f57 +Subproject commit 74c9eb365460fd28a884a639a4a039d09a931f70