This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 393799 - Advanced editing commands should respect TextView 'readonly' state
Summary: Advanced editing commands should respect TextView 'readonly' state
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Editor (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-07 13:21 EST by Mark Macdonald CLA
Modified: 2012-12-07 10:32 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2012-11-07 13:21:11 EST
When testing with a TextView that has the 'readonly' == true option set, I found that certain text editing commands still modify the buffer.

1. Create an Editor or TextView that has the 'readonly' option enabled. For example change the embeddedEditor.html example like this (lines 34-40):
> 	var textViewFactory = function() {
>		return new mTextView.TextView({
>			parent: editorDomNode,
>			tabSize: 4,
>			readonly: true // read-only mode
>		});
>	};
2. Open the editor. Basic editing features are disabled (as expected).
3. Press Ctrl+D to delete a line. This actually succeeds and modifies the buffer. (not expected)

IIRC the problematic commands are contributed by editorFeatures.js.
Comment 1 Silenio Quarti CLA 2012-11-08 10:52:25 EST
Simple testcase. Open editor page (edit.html) and replace "edit.html" with "readonly.html" in the URL.