[Webkit-unassigned] [Bug 110120] New: Web Inspector: Text editor exception

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 18 07:51:41 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=110120

           Summary: Web Inspector: Text editor exception
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Inspector
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: vsevik at chromium.org
                CC: keishi at webkit.org, pmuellr at yahoo.com,
                    pfeldman at chromium.org, yurys at chromium.org,
                    apavlov at chromium.org, loislo at chromium.org,
                    vsevik at chromium.org,
                    web-inspector-bugs at googlegroups.com


Uncaught TypeError: Cannot call method 'substring' of undefined TextEditorModel.js:485
WebInspector.TextEditorModel.copyRange TextEditorModel.js:485
WebInspector.TextEditorMainPanel.TokenHighlighter.handleSelectionChange DefaultTextEditor.js:3237
WebInspector.TextEditorMainPanel._handleSelectionChange DefaultTextEditor.js:2750

This happens when UISourceCode content is set to single line text externally.
At this point cursor is shown in the very beginning of the file and window.getSelection returns the following selection:

Selection {type: "Caret", extentOffset: 0, extentNode: div.inner-container text-editor-editable, baseOffset: 0, baseNode: div.inner-container text-editor-editable…}
anchorNode: div.inner-container text-editor-editable
anchorOffset: 0
baseNode: div.inner-container text-editor-editable
baseOffset: 0
extentNode: div.inner-container text-editor-editable
extentOffset: 0
focusNode: div.inner-container text-editor-editable
focusOffset: 0
isCollapsed: true
rangeCount: 1
type: "Caret"
__proto__: Selection

This differs from what window.getSelection() returns when cursor is set to the beginning of the file manually:

Selection {type: "Caret", extentOffset: 0, extentNode: text, baseOffset: 0, baseNode: text…}
anchorNode: text
anchorOffset: 0
baseNode: text
baseOffset: 0
extentNode: text
extentOffset: 0
focusNode: text
focusOffset: 0
isCollapsed: true
rangeCount: 1
type: "Caret"
__proto__: Selection

This is probably the reason of the exception (I saw that the range received in the selectionToPosition method had undefined as start/endLine)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list