Closed Bug 699356 Opened 13 years ago Closed 13 years ago

"Source of: [URL]" does not appear in the title bar with HTML5 parser-based View Source

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla11
Tracking Status
firefox10 --- unaffected

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

STR:
 1) View Source

Actual results:
The title bar doesn't say "Source of: [URL]"

Expected results:
Expected it to say "Source of: [URL]"
Depends on: 702448
Attached patch WIP (obsolete) — Splinter Review
The mochitest fails. It sees the right title element but not the right window title. However, visual inspection shows that the window title looks right.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Attached patch Add URL to the document title (obsolete) — Splinter Review
See bug 702448 comment 11 about the mochitest todo that this patch leaves in place.
Attachment #576918 - Attachment is obsolete: true
Attachment #577928 - Flags: review?(bugs)
Comment on attachment 577928 [details] [diff] [review]
Add URL to the document title

>+nsHtml5StreamParser::SetURL(nsIURI* aURL)
>+{
>+  if (aURL) {
>+    nsCOMPtr<nsIURI> temp;
>+    bool isViewSource;
>+    aURL->SchemeIs("view-source", &isViewSource);
>+    if (isViewSource) {
>+      nsCOMPtr<nsINestedURI> nested = do_QueryInterface(aURL);
>+      NS_ASSERTION(nested, "URI with scheme view-source didn't QI to nested!");
Useless assertion. There will be crash anyway pointing to the right place.


>+      nested->GetInnerURI(getter_AddRefs(temp));
>+    } else {
>+      temp = aURL;
>+    }
>+    bool isData;
>+    temp->SchemeIs("data", &isData);
>+    if (isData) {
>+      // Avoid showing potentially huge data: URLs
>+      mURL.AssignLiteral("data:\xE2\x80\xA6");
Please explain what \xE2\x80\xA6 means


>+    /**
>+     * Sets the URL for View Source title. If aURL is a view-source: URL,
>+     * takes the inner URL.
>+     */
>+    void SetURL(nsIURI* aURL);
...
>     /**
>+     * The URL of the document being parsed.
>+     */
>+    nsCString                     mURL;
>+

This is kind of strange. SetURL sets the URL for View Source, but
mURL is about document... some inconsistency here.
Also, since data: url handling is special, mURL is wrong.
Maybe mURLforViewSourceTitle; or something like that, and
rename also SetURL
Attachment #577928 - Flags: review?(bugs) → review-
Is it OK to do the same s/aURL/aTitle/ substitution in the already-reviewed bug 703965, too?
Attachment #577928 - Attachment is obsolete: true
Attachment #577981 - Flags: review?(bugs)
Attachment #577981 - Flags: review?(bugs) → review+
(In reply to Henri Sivonen (:hsivonen) from comment #6)
> Is it OK to do the same s/aURL/aTitle/ substitution in the already-reviewed
> bug 703965, too?

Should be ok.
Backed out on inbound (along with two other bugs from the same push) because of test failures:
https://hg.mozilla.org/integration/mozilla-inbound/rev/20a24dd3f56b
Target Milestone: mozilla11 → ---
https://hg.mozilla.org/mozilla-central/rev/b03e24707280
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
Comment on attachment 577981 [details] [diff] [review]
Add URL to the document title, v2

(This comment has been posted on all the bugs mentioned in this comment, except bug 710142, so that the release drivers see it regardless of the order in which they process approval requests.)

The new View Source implementation landed before Firefox 10 moved to Aurora. Afterwards, a bunch of regressions were identified. Many of the regression fixes didn't land before Firefox 10 moved to Aurora but they have now been fixed on trunk except for bug 710142.

To avoid shipping with regressions, we either need to land all the regression fixes on Aurora for Firefox 10 (followed by a fix for bug 710142 in Beta if it doesn't make it before Dec 20th) or switch back to the old View Source implementation on Aurora. The new View Source implementation provides much better diagnostics for Web developers than the old View Source implementation.

So I'd like to ask the release drivers to either approve bug 535530, bug 699356, bug 699365, bug 700034, bug 700361, bug 703965, bug 704667 and bug 705473 plus bug 695640, which is a non-regression tweak, or to approve bug 710175 for reverting to the old View Source implementation for Firefox 10.
Attachment #577981 - Flags: approval-mozilla-aurora?
Comment on attachment 577981 [details] [diff] [review]
Add URL to the document title, v2

[triage comment]
We decided to back out the new view source parser (bug 710175) rather than take this fixup for Firefox 10.

Denying for Aurora.
Attachment #577981 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Firefox 10 no longer affected due to bug 710175 landing.
You need to log in before you can comment on or make changes to this bug.