Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix locationOf for empty hash targets in Webkit #1300

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,7 @@ class Contents {
let id = target.substring(target.indexOf("#")+1);
let el = this.document.getElementById(id);
if(el) {
if (isWebkit) {
// Webkit reports incorrect bounding rects in Columns
let newRange = new Range();
newRange.selectNode(el);
position = newRange.getBoundingClientRect();
} else {
position = el.getBoundingClientRect();
}
position = el.getBoundingClientRect();
}
}

Expand Down