Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358503

Summary: [formatting] CSS Formatting error - formatter copying the last attribute to end of attributes section.
Product: [WebTools] WTP Source Editing Reporter: Kamil <robaaal>
Component: wst.cssAssignee: wst.css <wst.css-inbox>
Status: RESOLVED WORKSFORME QA Contact: Nick Sandonato <nsand.dev>
Severity: minor    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Kamil CLA 2011-09-21 20:17:28 EDT
Build Identifier: I20110613-1736

Take a look. It is in eclipse text editor, CSS editing. Before formatting:
div.pageContent {
	width: 708px;
	float: left;
	left: 145px;
	left-margin: 0px 0px 0px 0px; retu: 433;
	overflow: hidden;
	margin: 5px;
	margin-top: 20px;
	box-shadow: 0 0 10px 5px black;
	border-radius: 5px;
}
after applying formatting two times (CTRL+SHIFT+F)
div.pageContent {
	width: 708px;
	float: left;
	left: 145px;
	left-margin: 0px 0px 0px 0px;
	retu: 433;
	overflow: hidden; <-- orginal position, after formatting still here
	margin: 5px;
	margin-top: 20px;
	box-shadow: 0 0 10px 5px black;
	border-radius: 5px;
	overflow: hidden; <- Eclipse formatter copies attribute from up here. Dunno why.
}

After some formats your CSS sheet become 20% bigger because of this bug.

Reproducible: Always

Steps to Reproduce:
1. Insert some CSS selectors in one line like this sel1:xx;sel2:xx;sel3:xx;
2. Apply ctrl+shift+F until selectors don't position pretty - every one in one line.
3. Take a look how CSS formatter copy the most right selector to down of attributes section.
4. If bug not appear, try to select our prepared line.
Comment 1 Nick Sandonato CLA 2012-10-17 16:40:43 EDT
This looks like it may have been fixed indirectly in the last year.