The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla11

Status

()

Core
HTML: Parser
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: hsivonen, Assigned: hsivonen)

Tracking

({regression})

Trunk
mozilla11
regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox10 unaffected)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

6 years ago
STR:
 1) View Source

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

Expected results:
Expected it to say "Source of: [URL]"
(Assignee)

Updated

6 years ago
Blocks: 482921
In this code, mURL is never set.
http://mxr.mozilla.org/mozilla-central/source/parser/html/nsHtml5Highlighter.cpp#122
Depends on: 702448

Updated

5 years ago
Duplicate of this bug: 704506
(Assignee)

Comment 3

5 years ago
Created attachment 576918 [details] [diff] [review]
WIP

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
(Assignee)

Comment 4

5 years ago
Created attachment 577928 [details] [diff] [review]
Add URL to the document title

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-
(Assignee)

Comment 6

5 years ago
Created attachment 577981 [details] [diff] [review]
Add URL to the document title, v2

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.
(Assignee)

Comment 8

5 years ago
Thanks.

https://hg.mozilla.org/integration/mozilla-inbound/rev/38814e0bafb9
Target Milestone: --- → mozilla11
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 → ---
Re-landed: https://hg.mozilla.org/integration/mozilla-inbound/rev/b03e24707280
https://hg.mozilla.org/mozilla-central/rev/b03e24707280
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
(Assignee)

Updated

5 years ago
status-firefox10: --- → affected
(Assignee)

Comment 12

5 years ago
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 13

5 years ago
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-
(Assignee)

Comment 14

5 years ago
Firefox 10 no longer affected due to bug 710175 landing.
status-firefox10: affected → unaffected
You need to log in before you can comment on or make changes to this bug.