Skip to content

Commit

Permalink
Fix for #US#US issue in inprocess PDF case.
Browse files Browse the repository at this point in the history
Now old '#' is searched and replaced by the new #XXX string.
This is fix for 445184 issue for In process case.

BUG=445184

Review URL: https://codereview.chromium.org/838103002

Cr-Commit-Position: refs/heads/master@{#310496}
  • Loading branch information
deepak.m1 authored and Commit bot committed Jan 8, 2015
1 parent c40f55c commit 55b67c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pdf/instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,13 @@ void Instance::NavigateTo(const std::string& url, bool open_in_new_tab) {
// If |url_copy| starts with '#', then it's for the same URL with a
// different URL fragment.
if (url_copy[0] == '#') {
url_copy = url_ + url_copy;
// if '#' is already present in |url_| then remove old fragment and add
// new |url_copy| fragment.
std::size_t index = url_.find('#');
if (index != std::string::npos)
url_copy = url_.substr(0, index) + url_copy;
else
url_copy = url_ + url_copy;
// Changing the href does not actually do anything when navigating in the
// same tab, so do the actual page scroll here. Then fall through so the
// href gets updated.
Expand Down

0 comments on commit 55b67c0

Please sign in to comment.