Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 448103 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.webtools/web/js-tests/webtools/cssOutlinerTests.js (-10 / +10 lines)
Lines 43-50 Link Here
43
			if(!element.line) {
43
			if(!element.line) {
44
				assert.fail("The outlined element must have a line number");
44
				assert.fail("The outlined element must have a line number");
45
			}
45
			}
46
			if(!element.offset) {
46
			if(element.offset < 0) {
47
				assert.fail("The outlied element must have an offset");
47
				assert.fail("The outlined element must have a valid offset");
48
			}
48
			}
49
			assert.equal(element.label, label, "The label is not the same");
49
			assert.equal(element.label, label, "The label is not the same");
50
			assert.equal(element.length, length, "The length is not the same");
50
			assert.equal(element.length, length, "The length is not the same");
Lines 59-65 Link Here
59
			if(!outline || outline.length < 1) {
59
			if(!outline || outline.length < 1) {
60
				assert.fail("There should be one outline element");
60
				assert.fail("There should be one outline element");
61
			}
61
			}
62
			assertElement(outline[0], ".simple", 6, 1, 1);
62
			assertElement(outline[0], ".simple", 7, 1, 0);
63
		});
63
		});
64
		
64
		
65
		it('test_simpleContent', function() {
65
		it('test_simpleContent', function() {
Lines 69-75 Link Here
69
			if(!outline || outline.length < 1) {
69
			if(!outline || outline.length < 1) {
70
				assert.fail("There should be one outline element");
70
				assert.fail("There should be one outline element");
71
			}
71
			}
72
			assertElement(outline[0], ".simpleContent", 13, 1, 1);
72
			assertElement(outline[0], ".simpleContent", 14, 1, 0);
73
		});
73
		});
74
		
74
		
75
		it('test_simpleWhitespace', function() {
75
		it('test_simpleWhitespace', function() {
Lines 79-85 Link Here
79
			if(!outline || outline.length < 1) {
79
			if(!outline || outline.length < 1) {
80
				assert.fail("There should be one outline element");
80
				assert.fail("There should be one outline element");
81
			}
81
			}
82
			assertElement(outline[0], ".simpleWhitespace", 16, 1, 7);
82
			assertElement(outline[0], ".simpleWhitespace", 17, 1, 6);
83
		});
83
		});
84
		
84
		
85
		it('test_simpleComment', function() {
85
		it('test_simpleComment', function() {
Lines 89-95 Link Here
89
			if(!outline || outline.length < 1) {
89
			if(!outline || outline.length < 1) {
90
				assert.fail("There should be one outline element");
90
				assert.fail("There should be one outline element");
91
			}
91
			}
92
			assertElement(outline[0], ".simpleComment", 13, 4, 1);
92
			assertElement(outline[0], ".simpleComment", 14, 4, 0);
93
		});
93
		});
94
		
94
		
95
		it('test_simpleContentNoSemiColon', function() {
95
		it('test_simpleContentNoSemiColon', function() {
Lines 99-105 Link Here
99
			if(!outline || outline.length < 1) {
99
			if(!outline || outline.length < 1) {
100
				assert.fail("There should be one outline element");
100
				assert.fail("There should be one outline element");
101
			}
101
			}
102
			assertElement(outline[0], ".simpleContentNoSemiColon", 24, 1, 1);
102
			assertElement(outline[0], ".simpleContentNoSemiColon", 25, 1, 0);
103
		});
103
		});
104
		
104
		
105
		it('test_simpleID', function() {
105
		it('test_simpleID', function() {
Lines 109-115 Link Here
109
			if(!outline || outline.length < 1) {
109
			if(!outline || outline.length < 1) {
110
				assert.fail("There should be one outline element");
110
				assert.fail("There should be one outline element");
111
			}
111
			}
112
			assertElement(outline[0], "#simpleID", 8, 1, 1);
112
			assertElement(outline[0], "#simpleID", 9, 1, 0);
113
		});
113
		});
114
		
114
		
115
		it('test_multiNoSymbol', function() {
115
		it('test_multiNoSymbol', function() {
Lines 120-126 Link Here
120
				assert.fail("There should be one outline element");
120
				assert.fail("There should be one outline element");
121
			}
121
			}
122
			// TODO cssLint returns text with three spaces for unknown reason
122
			// TODO cssLint returns text with three spaces for unknown reason
123
			assertElement(outline[0], ".multi   .multi2", 5, 1, 1);
123
			assertElement(outline[0], ".multi   .multi2", 6, 1, 0);
124
		});
124
		});
125
		
125
		
126
		it('test_multiSymbol', function() {
126
		it('test_multiSymbol', function() {
Lines 130-136 Link Here
130
			if(!outline || outline.length < 1) {
130
			if(!outline || outline.length < 1) {
131
				assert.fail("There should be one outline element");
131
				assert.fail("There should be one outline element");
132
			}
132
			}
133
			assertElement(outline[0], ".multiSym, .multi2", 8, 1, 1);
133
			assertElement(outline[0], ".multiSym, .multi2", 9, 1, 0);
134
		});
134
		});
135
/*		
135
/*		
136
		it('test_', function() {
136
		it('test_', function() {
(-)a/bundles/org.eclipse.orion.client.webtools/web/webtools/cssOutliner.js (-4 / +2 lines)
Lines 62-79 Link Here
62
							if (sel.parts && sel.parts.length > 0){
62
							if (sel.parts && sel.parts.length > 0){
63
								var part = sel.parts[0]; // We want to check instanceof SelectorPart, but it is not API
63
								var part = sel.parts[0]; // We want to check instanceof SelectorPart, but it is not API
64
								if (line === null) { line = part.line; }
64
								if (line === null) { line = part.line; }
65
								if (col === null) { col = part.col; }
65
								if (col === null) { col = part.col-1; }
66
								if (length === null){
66
								if (length === null){
67
									length = part.text.length;
67
									length = part.text.length;
68
									if (length > 0){ length--; /*length range is inclusive*/}
69
								}
68
								}
70
							}
69
							}
71
							// If no valid parts found, just use the entire selector text
70
							// If no valid parts found, just use the entire selector text
72
							if (line === null) { line = sel.line; }
71
							if (line === null) { line = sel.line; }
73
							if (col === null) { col = sel.col; }
72
							if (col === null) { col = sel.col-1; }
74
							if (length === null) {
73
							if (length === null) {
75
								length = sel.text.length;
74
								length = sel.text.length;
76
								if (length > 0){ length--; /*length range is inclusive*/}
77
							}
75
							}
78
							selectorText.push(sel.text);
76
							selectorText.push(sel.text);
79
						}
77
						}

Return to bug 448103