New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 659040 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Regression



Sign in to add a comment

View Frame Source for iframe of a file:// URL shows main frame's filename

Reported by jm.acun...@gmail.com, Oct 25 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36

Steps to reproduce the problem:
- Writes in the Chrome address bar:
data: text/html <iframe src='https://abc.xyz'></iframe>

- Right 'View Frame Source code'
- Title tab: view-source:https://abc.xyz
- Ok

Now we do the same from a file on the local machine:

- Right 'View Frame Source code'
- Title tab: Local file name (although it shows the favicon correctly)

What is the expected behavior?
Title tab: view-source:Domain Name

What went wrong?
Title tab: Local file name

Did this work before? N/A 

Chrome version: 54.0.2840.71  Channel: stable
OS Version: 6.3
Flash Version: Shockwave Flash 23.0 r0
 
bug_chrome.png
126 KB View Download
Labels: Needs-Bisect
Cc: sureshkumari@chromium.org
Labels: Needs-Feedback OS-Linux OS-Mac
Tested the issue  on windows-7, Mac-10.11.4 and linux ubuntu 14.04 using chrome stable version 54.0.2840.71 and latest canary 56.0.2899.0 with below steps
1. opened chrome
2.Navigated to the page https://abc.xyz
3.Clicked on View page source and observed that "view-source:https://abc.xyz/" in the address bar
4.Same behaviour observed in Firefox too with the above steps.

Could you please  let us know your expected behaviour and if possible provide the screenshot to triage the issue better.

Thanks.
Hello,
I sorry not having explained clearly.

The static html page in local machine contains an iframe whose src is https://abc.xyz

The error occurs when you click on the iframe and click view source code iframe

<html>
<body>
<iframe src="https://abc.xyz"></iframe>
</body>
</html>

Comment 4 by rsesek@chromium.org, Oct 26 2016

Labels: -OS-Linux -OS-Mac
 sureshkumari: Please stop adding OS-Linux and OS-Mac when you test on those OSes. The labels are for where the bug *reproduces*.
Demostration (video):
ice_video_20161027-144421.webm
9.1 MB View Download
Tested the issue on windows-7 using chrome stable version 54.0.2840.71 with below steps
1.Opened chrome
2.Created abcd.html file using the code provided in comment#3
<html>
<body>
<iframe src="https://abc.xyz"></iframe>
</body>
</html>

3.opened abcd.html in chrome browser and clicked on view source, observed abcd.html as Title of the page.
4.opened a new tab and navigated to the following url 
"data: text/html; charset=utf-8, <iframe src="https://abc.xyz.com"> width="1000" height="900"</iframe>" 
5. clicked on page source, observed iframe url as title of the page.
   
In step-5, are you expecting title of a page should be "View source : https://abc.xyz"??

please check the attached screecast for reference and let us know anything missed here to reproduce the issue.

Thanks.
659040.mp4
600 KB View Download
For me the error occurs when a local page, you visualize the frame source with src = https://abc.xyz.com:

- the title of the tab is abcd.html (wrong)

Mozilla Firefox correctly shows the title of the tab:

- the title of the tab is https://abc.xyz/ (correct)

Labels: -Type-Bug -Pri-2 -Needs-Feedback -Needs-Bisect hasbisect-per-revision M-54 Pri-1 Type-Bug-Regression
Owner: afakhry@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce the issue on windows-7 using chrome stable version 54.0.2840.87 and canary 56.0.2910.0

This is regression issue broken in M54.Please find the bisect information as below

Narrow Bisect::
===============
Good :54.0.2795.0 --   (build revision 405182)
Bad:: 54.0.2797.0 --   (build revision 405656)

ChangeLog: 
================
https://chromium.googlesource.com/chromium/src/+log/54c7739244a8870372e88f991579e6ad42872d6a..6f0c1ec23bc1eabe221fccdb4b28b1d96273a705


Possible suspect
==================

6f0c1ec23bc1eabe221fccdb4b28b1d96273a705	

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

afakhry@ could you please look into this issue if it is related to your change,else please help us in finding the appropriate owner for this issue.

Thanks,

Cc: creis@chromium.org
Status: Started (was: Assigned)
creis@ This regression was caused by this line [https://cs.chromium.org/chromium/src/chrome/browser/ui/browser_commands.cc?type=cs&q=ViewSource&sq=package:chromium&l=1212] being changed from:

  // Do not restore title, derive it from the url.	 
  last_committed_entry->SetTitle(base::string16());	 

to:

  // Do not restore title, derive it from the url.
  view_source_contents->UpdateTitleForEntry(last_committed_entry,
                                            base::string16());


WebContentsImpl::UpdateTitleForEntry() does never set an empty title on the NavigationEntry, instead gets the file name from the URL [https://cs.chromium.org/chromium/src/content/browser/web_contents/web_contents_impl.cc?type=cs&q=WebContentsImpl::UpdateTitleForEntry&sq=package:chromium&l=3871].

I think I will revert back this line if that's ok with you. This doesn't affect the task manager showing the correct title.

Comment 10 by creis@chromium.org, Nov 14 2016

Components: UI>Browser>Navigation Blink>ViewSource
Summary: View Frame Source for iframe of a file:// URL shows main frame's filename (was: Wrong title page format View Source Code)
Updating the summary, assuming I understand the bug correctly.

I see the bug you're describing, but I'm hesitant to fix it by reverting that line.  Won't that break notifications in all view source cases?  Even if the task manger does the right thing for some other reason, it seems like the wrong thing to do.

Should we be handling this case differently because we're basically loading a subframe in the cloned main frame's entry?  There may be more bugs hiding here.
Cc: pbomm...@chromium.org gov...@chromium.org
Labels: -M-54 M-55 ReleaseBlock-Stable
M54 is already in Stable now, may be we could take the fix for M55.Lopping to folks who are involved.
A friendly reminder that M55 Stable is launch is coming soon! Your bug is labelled as Stable ReleaseBlock, pls make sure to land the fix and get it merged into the release branch ASAP so it gets enough baking time in Beta (before Stable promotion). Thank you!

Also due to Thanksgiving holidays in US, please make sure fix is ready and merged to M55 latest by 5:00 PM PT Friday, 11/18/16 (sooner the better).
Re#9: creis@, I dug into it more today. The reason it used to work before was that we cleared the title of the nav_entry which also cleared that |cached_display_title_|. WebContentsImpl::GetTitle() will be called several times returning the wrong (unexpected) title, until we receive a message that we did Navigate, which sets the URL of the nav_entry and clears the |cached_display_title_| again:

|#2 0x2b8f44714a17 content::NavigationEntryImpl::SetURL()
|#3 0x2b8f447061e5 content::NavigationControllerImpl::RendererDidNavigateToNewPage()
|#4 0x2b8f44704fec content::NavigationControllerImpl::RendererDidNavigate()
|#5 0x2b8f44732d15 content::NavigatorImpl::DidNavigate()
|#6 0x2b8f4473d567 content::RenderFrameHostImpl::OnDidCommitProvisionalLoad()
|#7 0x2b8f4473a798 content::RenderFrameHostImpl::OnMessageReceived()
|#8 0x2b8f44c5fd12 content::RenderProcessHostImpl::OnMessageReceived()
|#9 0x2b8f42fd5178 IPC::ChannelProxy::Context::OnDispatchMessage() 

After that, WebContentsImpl::GetTitle() returns the expected title by calling NavigationEntryImpl::GetTitleForDisplay() which extracts the title from the virtual_url which we set earlier in ViewSource() to be:

"view-source:https://abc.xyz"

---->

After my change, by calling WebContentsImpl::UpdateTitleForEntry() we actually set the |title_| member of the nav_entry, which always has the priority, and hence we don't get the title from the virtual_url.

The fix I'm proposing is to clear the nav_entry's URL when we set its virtual URL. This way, WebContentsImpl::UpdateTitleForEntry() won't hit this condition: [https://cs.chromium.org/chromium/src/content/browser/web_contents/web_contents_impl.cc?type=cs&q=WebContentsImpl::UpdateTitleForEntry&sq=package:chromium&l=3884] and the title will be actually cleared. The correct URL will be updated when we receive the message.

Like this: https://codereview.chromium.org/2501083004

What do you think?



Comment 14 by creis@chromium.org, Nov 17 2016

Thanks for looking into it, and sorry I missed the bug comment.  I left some comments on the review, and we can continue the discussion there.  (I'm not sure if that approach is safe, but maybe we can find something.)

Comment 15 by creis@chromium.org, Nov 18 2016

Labels: -M-55 M-56
Given the timing (M55 reaching stable soon), relatively low severity (i.e., cosmetic issue in a rare case, already exists on stable), and uncertainty around how to fix, I think it's ok for this to target M56 instead.

That said, let's try to resolve the questions on the CL and find a way forward, so we can get the fix merged into the M56 branch early in the beta.
Still we are able to reproduce the issue on Windows 7 with Chrome Stable version-54.0.2840.99  & latest Canary version-57.0.2931.0.

afakhry@ Please take a look into this issue.

Thank you.
Thanks for rechecking. I already have and the fix CL is still under review.
Project Member

Comment 18 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4d116bd4f43359ce057a60c82c2188c93d49a638

commit 4d116bd4f43359ce057a60c82c2188c93d49a638
Author: afakhry <afakhry@chromium.org>
Date: Tue Nov 29 17:25:25 2016

Fix View Frame Source for iframe of a file:// URL shows main frame's filename

View Frame Source for iframe of a file:// URL used to show the main frame's
filename instead of the expected title derived from the iframe's page URL in
the form of "view-source:url". This CL fixes this and adds a browser test.

BUG= 659040 
TEST=browser_tests --gtest_filter=ChromeNavigationBrowserTest.TestViewFrameSource

Review-Url: https://codereview.chromium.org/2501083004
Cr-Commit-Position: refs/heads/master@{#435021}

[modify] https://crrev.com/4d116bd4f43359ce057a60c82c2188c93d49a638/chrome/browser/chrome_navigation_browsertest.cc
[modify] https://crrev.com/4d116bd4f43359ce057a60c82c2188c93d49a638/chrome/browser/ui/browser_commands.cc
[modify] https://crrev.com/4d116bd4f43359ce057a60c82c2188c93d49a638/testing/buildbot/filters/site-per-process.browser_tests.filter

Labels: Merge-Request-56

Comment 20 by dimu@chromium.org, Nov 30 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Project Member

Comment 21 by bugdroid1@chromium.org, Dec 1 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e13c83eaae5c04aecfb3a7b75921be2b20b07a67

commit e13c83eaae5c04aecfb3a7b75921be2b20b07a67
Author: Ahmed Fakhry <afakhry@google.com>
Date: Thu Dec 01 02:10:48 2016

[Merge to M56] Fix View Frame Source for iframe of a file:// URL shows main frame's filename

View Frame Source for iframe of a file:// URL used to show the main frame's
filename instead of the expected title derived from the iframe's page URL in
the form of "view-source:url". This CL fixes this and adds a browser test.

TBR=creis@chromium.org,sky@chromium.org
BUG= 659040 
TEST=browser_tests --gtest_filter=ChromeNavigationBrowserTest.TestViewFrameSource

Review-Url: https://codereview.chromium.org/2501083004
Cr-Commit-Position: refs/heads/master@{#435021}
(cherry picked from commit 4d116bd4f43359ce057a60c82c2188c93d49a638)

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

Cr-Commit-Position: refs/branch-heads/2924@{#232}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/e13c83eaae5c04aecfb3a7b75921be2b20b07a67/chrome/browser/chrome_navigation_browsertest.cc
[modify] https://crrev.com/e13c83eaae5c04aecfb3a7b75921be2b20b07a67/chrome/browser/ui/browser_commands.cc
[modify] https://crrev.com/e13c83eaae5c04aecfb3a7b75921be2b20b07a67/testing/buildbot/filters/site-per-process.browser_tests.filter

Status: Fixed (was: Started)
Labels: Needs-Feedback
Tested on windows 7 & 10 using chrome dev M56 #56.0.2924.14 and issue is still reproduced.
The view frame source page title is still displayed wrong when compared with other browsers.

Attached screenshot for reference.

@afakhry--Could you please look into this.

Thanks!
659040.PNG
172 KB View Download
Status: Assigned (was: Fixed)
Assigning to the owner for updates.
What is wrong with the title in the screenshot? This is the expected title!

view-source:<iframe-url>
Status: Fixed (was: Assigned)
Agreed-- that's expected behavior, and it matches what was described as expected in the bug report.  hodda@: What were you expecting to see?
Cc: hdodda@chromium.org
(Sorry, I meant hdodda@ in comment 26)
Labels: -Needs-Feedback TE-Verified-M56 TE-Verified-56.0.2924.14
Thanks for the update , as per the comment #25 &#26 adding TE-Verified Labels.


Sign in to add a comment