Closed Bug 464222 Opened 16 years ago Closed 10 years ago

Relative links not linkified in "View Selection Source"

Categories

(Core :: DOM: HTML Parser, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: me, Assigned: jkitch)

References

Details

Attachments

(4 files, 1 obsolete file)

Steps to Reproduce:
1. Highlight a relative link on a page.
2. On context menu go to "View Selection Source".

Only absolute links are linkified in selection/DOM source, whereas all links are linkified in normal view source.

Using:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2pre) Gecko/20081110 Minefield/3.1b2pre
Note to would-be implementors, if they aren't named Curtis: See bug 17612 for original implementation of source linking.  :)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → jkitch.bug
Attached patch Part 1: protocol changes (obsolete) — Splinter Review
Stores baseURI within nsIViewSourceChannels for use in non-srcdoc documents.

Nothing terribly exciting.
Attachment #8372993 - Flags: review?(bzbarsky)
This adds a new method to nsIWebNavigation to allow a loadURI variant with an extra argument.  (The existing loadURI is used in too many places to consider changing it).

I've tried to make it clear within the interface comments that the new method will only differ in specific situations (namely view-source: URIs and then only some of the time).  Any other possible behaviour is unimplemented.
Attachment #8372994 - Flags: review?(bzbarsky)
We now check every (view-source) channel for presence of baseURI, before falling back to the old method.  This gives the data URIs of view selection source an awareness 

In principle, non-srcdoc, non-selection channels will also use the channel baseURI rather than the fallback method.  But this requires a deliberate choice to implement the appropriate codepaths to enable ir.
Attachment #8372995 - Flags: review?(hsivonen)
This passes a base URI to a variant of the webnav LoadURI function to allow relative URIs to work in view selection source.
Attachment #8372996 - Flags: review?(dolske)
Comment on attachment 8372993 [details] [diff] [review]
Part 1: protocol changes

> Returns a nullptr when it isn't set or isn't a

s/a nullptr/null/

r=me
Attachment #8372993 - Flags: review?(bzbarsky) → review+
Comment on attachment 8372994 [details] [diff] [review]
Part2: WebNavigation Changes

This seems like it might better go on the settings object bug 965413 will add.  Maybe file a followup to consider moving it there once that bug lands?
Attachment #8372994 - Flags: review?(bzbarsky) → review+
Attachment #8372996 - Flags: review?(dolske) → review+
Blocks: 971432
Attachment #8372995 - Flags: review?(hsivonen) → review+
Attachment #8372993 - Attachment is obsolete: true
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: