| Summary: | [formatting] CSS formatter breaks the style tag when it looks like it contains JSP EL | ||
|---|---|---|---|
| Product: | [WebTools] WTP Source Editing | Reporter: | Radu Toader <radu_m_toader> |
| Component: | jst.jsp | Assignee: | Nick Sandonato <nsand.dev> |
| Status: | REOPENED --- | QA Contact: | Nick Sandonato <nsand.dev> |
| Severity: | normal | ||
| Priority: | P3 | CC: | radu_m_toader, rizwan.raza987, thatnitind |
| Version: | unspecified | ||
| Target Milestone: | 3.6.2 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
Any update on this formatter Issue ? (In reply to comment #1) > Any update on this formatter Issue ? Other than a diagnosis, not really. The JSP formatter delegates to the CSS formatter for the <style> region. Because braces of syntactic meaning in CSS, these stray ones are being mis-interpreted by the parser. We might be able to have the CSS formatter skip over these areas, but I don't think it will be quite as simple as that since these stray braces do seem to wreak havoc on the model. Can you tell me wich class is responsible for css formatting in eclipse SDK, or how do I find the right project ?
it is obvios that :
height is a property and everything after that until ";" must be on the same line.
it doesn't matter if it has "{" , "}"
and by the way
in front of "{" there is a "$" and this will never be a selector from my side.
I would like to wrote that code to format correctly css, just tell me where can I find it, and then I will mail you the solution.
(In reply to comment #3) > Can you tell me wich class is responsible for css formatting in eclipse SDK, or > how do I find the right project ? > it is obvios that : > height is a property and everything after that until ";" must be on the same > line. > > it doesn't matter if it has "{" , "}" > and by the way > in front of "{" there is a "$" and this will never be a selector from my side. > > I would like to wrote that code to format correctly css, just tell me where can > I find it, and then I will mail you the solution. Hi Radu, The CSS formatters are in package org.eclipse.wst.css.core.internal.formatter, where I believe the particular formatter is StyleDeclItemFormatter. You can get the source from :pserver:anonymous@dev.eclipse.org:/cvsroot/webtools, just checkout org.eclipse.wst.css.core under HEAD. I've found it. Thanks I'll reply when I will have a relevant solution Pushed the fix to master. http://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/commit/?id=fd2d57b95e32e0560ea662e7f72a7f51dce949db Reopening. Fix for this breaks the Web Page Editor due to the JSPedCSSTokenizer not handling the example in bug 425940 comment 2. Same thing happened with me.
Before, I write CSS in my own and valid Format
@-webkit-keyframes sk-bounce {
0%, 100% {
-webkit-transform: scale(0.0)
}
50% {
-webkit-transform: scale(1.0)
}
}
@keyframes sk-bounce {
0%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
}
50% {
transform: scale(1.0);
-webkit-transform:scale(1.0);
}
}
After Format (Pressing Ctrl+Shift+F)
@
-webkit-keyframes sk-bounce { 0%, 100% {
-webkit-transform: scale(0.0)
}
50%
{
-webkit-transform
:
scale
(1
.0
)
}
}
@
keyframes sk-bounce { 0%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
}
50%
{
transform
:
scale
(1
.0
);
-webkit-transform
:
scale
(1
.0
);
}
}
The CSS and Animation are also not working due to above format.
|
Build Identifier: 20110916-0149 <style> #containment { height: ${bannerVO.realHeight}px; width: ${bannerVO.realWidth}px; background: #${bannerVO.bgColor}; border-color: #${bannerVO.borderColor}; border-width: ${bannerVO.borderWidth}; border-style: solid; position: relative; background-repeat: no-repeat; border-radius:${bannerVO.borderRadius}px; -moz-border-radius:${bannerVO.borderRadius}px; -webkit-border-radius: ${bannerVO.borderRadius}px; } </style> after format <style> #containment { height: ${bannerVO.realHeight } px ; width : ${ bannerVO .realWidth } px ; background : #${ bannerVO .bgColor } ; border-color : #${ bannerVO .borderColor } ; border-width : ${ bannerVO .borderWidth } ; border-style: solid ; position: relative ; background-repeat: no-repeat ; border-radius: ${bannerVO .borderRadius } px ; -moz-border-radius: ${bannerVO .borderRadius } px ; -webkit-border-radius : ${ bannerVO .borderRadius } px ; } </style> Reproducible: Always Steps to Reproduce: 1. write code 2. format