Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions js/views/cfi_navigation_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,17 @@ var CfiNavigationLogic = function(options) {
clientRectList = range.getClientRects();
} else {
clientRectList = $el[0].getClientRects();

// If the element is something like this: <svg:svg ....><svg:image ....></svg:image></svg:svg> 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
Expand Down
2 changes: 1 addition & 1 deletion readium-cfi-js