Closed Bug 1327714 Opened 6 years ago Closed 4 years ago

Debugger randomly sets scroll position to newly loaded sources

Categories

(DevTools :: Debugger, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: arni2033, Unassigned)

References

()

Details

>>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160526082509
There're 3 scenarios to explain all the strangeness in debugger's behavior.
In Scenario_1, if step says "select source X", it means that you must NOT select other sources
in the process. If you have mistaken, you should start again to reproduce.
Use tooltip (that appears in "Sources" tab when you hover mouse over source) as a hint.


Scenario_1:
1. Open url [1] in a new tab
   Open debugger, open "events" tab (bug 1211514)
   Click on the page
2. Select source that starts with "onwheel", scroll it down so that 1st visible line was line 20
3. Select source that starts with "onkeydown", scroll it down so that 1st visible line was line 40
4. Select source that starts with "onwheel". Select source that starts with "onkeydown".

AR:
 In Step 2 when I select source "onwheel", it's scrolled to line 1
 In Step 3 when I select source "onkeydown", it's scrolled to line 20
 In Step 4 I see that debugger is able to remember scroll position in different sources
 
 Apparently, debugger scrolls newly loaded sources to the same line as the last selected source

ER:
 Debugger should scroll newly loaded unknown sources to line 1, as I haven't even touched it



Scenario_2:  (further experiments)
1. Open url [1]
   Open debugger, open "events" tab (bug 1211514)
   Click on the page
2. Select source that starts with "onwheel", scroll it so that 1st visible line was line 20
3. Select source that starts with "onkeydown", scroll it so that 1st visible line was line 40
4. Select source that starts with "onwheel"
5. Select source that starts with "<script>"
6. Reload the page, click on the page
7. Select source that starts with "onkeydown"

AR:
 After Step 6 1st visible line is line 1
 After Step 7 1st visible line is line 20, just like in source "onwheel" (Step 2)

 What means that debugger saves scroll position in the last _scrollable_ source. Quite random. I don't
 expect any developer to rely on such ambiguous behavior. It's impossible to develop such intuition.

ER:  Either X or Y
 X) On reload, debugger should restore scroll position in each script it remembers
 Y) On reload, debugger shouldn't restore scroll position in known scripts


Note:
 I think this mechanism was made to restore scroll position in selected script on page reload. You can
 check that with url [2]. And also you can select source "onwheel" in Scenario_2 -> Step 7.
 But this mechanism only brings more strangeness and should either be removed or fixed.


> [1] data::,<script>onclick=function(){U="=function(){};";for(i=0;i++<999;U+="%250A");d=document;F=function(t){S=d.createElement("script");S.src="data:,on"+t+U+"console.log(3)";d.head.appendChild(S)};F("click");F("wheel");F("keydown")}</script>
> [2] data::,<script>U="=function(){};";for(i=0;i++<999;U+="%250A");d=document;F=function(t){S=d.createElement("script");S.src="data:,on"+t+U+"console.log(3)";d.head.appendChild(S)};F("click");F("wheel");F("keydown")</script>
No longer blocks: 1277113
Component: Untriaged → Developer Tools: Canvas Debugger
Component: Developer Tools: Canvas Debugger → Developer Tools: Debugger
Product: Firefox → DevTools

only affects the old debugger.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.