Closed Bug 267723 Opened 20 years ago Closed 20 years ago

ViewSource doesn't scroll to the selected line when opened from JS Console links; ViewSource->Edit->Go to Line broken as well; works in 1.0PR

Categories

(Toolkit :: View Source, defect)

1.7 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.7.5

People

(Reporter: steffen.wilberg, Assigned: steffen.wilberg)

Details

(Keywords: fixed-aviary1.0, regression)

Attachments

(1 file, 1 obsolete file)

Clicking on a link in the js console opens View Source but don't scroll the the
right line. Go to Line is broken as well.

The js console displays:
Error: ds has no properties
Source File: chrome://global/content/findBar.js
Line: 209

That's the 'var display' line:
  function getSelectionController(ds)
  {
    var display =
ds.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsISelectionDisplay);
    if (!display)
      return null;
    return display.QueryInterface(Components.interfaces.nsISelectionController);
  }
Flags: blocking-aviary1.0?
There's a getSelectionController in both viewSource.js and findBar.js, both
referenced by viewSource.xul. The latter expects the docshell as argument. So we
need to either add
  if (!ds)
    ds = getBrowser().docShell;
to the one in findBar.js or rename one of the functions.
Attached patch rename (obsolete) — Splinter Review
renames getSelectionController to getSelectionControllerFromDS in findBar.js.

The find bar and find-as-you-type still work elsewhere, including highlight.
Assignee: firefox → steffen.wilberg
Status: NEW → ASSIGNED
Comment on attachment 164589 [details] [diff] [review]
rename

This is a regression from 1.0 PR and should be fixed before 1.0.
Attachment #164589 - Flags: review?(firefox)
Attachment #164589 - Flags: approval-aviary?
Attachment #164589 - Attachment is obsolete: true
Attachment #164589 - Flags: review?(firefox)
Attachment #164589 - Flags: approval-aviary?
Attached patch renameSplinter Review
Comment on attachment 164591 [details] [diff] [review]
rename

This is the right patch.
Attachment #164591 - Flags: review?(firefox)
Attachment #164591 - Flags: approval-aviary?
Attachment #164591 - Flags: superreview?(firefox)
Attachment #164591 - Flags: review?(firefox)
Attachment #164591 - Flags: review+
better summary.
Summary: JS Console errors don't scroll the right line in ViewSource, Go to Line broken too → ViewSource doesn't scroll to the selected line when opened from JS Console links; ViewSource->Edit->Go to Line broken as well; works in 1.0PR
Use something like "getSelectionControllerForFindToolbar" or something related
to the actual use, not what it's doing, to make the code more readable and
sr+a=ben@mozilla.org. No need to attach a new patch make that change and land!
Flags: blocking-aviary1.0? → blocking-aviary1.0+
Attachment #164591 - Flags: superreview?(firefox)
Attachment #164591 - Flags: superreview+
Attachment #164591 - Flags: approval-aviary?
Attachment #164591 - Flags: approval-aviary+
Checked in branch with "getSelectionControllerForFindToolbar".
Trunk doesn't have the find toolbar stuff yet.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Keywords: fixed-aviary1.0
Resolution: --- → FIXED
Target Milestone: --- → Firefox1.0
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: