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

Bug 363744

Summary: Spaces are missing when using the span RUIWidget
Product: z_Archived Reporter: broy2
Component: EDTAssignee: Yun Feng Ma <mayunf>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: hjiyong, margolis, mayunf, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screen shot none

Description broy2 CLA 2011-11-14 15:32:45 EST
Created attachment 206986 [details]
Screen shot

Preview of the following in the RUI editor of EDT and RBD gives different results.

handler MyHandler3 type RUIHandler{initialUI =[myDiv]}
   myDiv Div{children = [mySpan01, mySpan02, mySpan03]};
   mySpan01 Span{text = "mix blue ", color = "blue"};
   mySpan02 Span{text = " and red ", color = "red"};
   mySpan03 Span{text = " to see purple", color = "purple"};
end

RBD:  mix blue and red to see purple
EDT:  mix blueand redto see purple

Screen shot of both attached in doc.
Comment 1 Brian Svihovec CLA 2011-11-15 09:21:05 EST
What browser are you using in the VE for EDT?  If you launch the RBD preview in an external browser, and then open the page in the same browser that is being used in EDT, are the results the same?  I am guessing that RBD is using XULRunner (FireFox) and EDT is using either IE or WebKit.
Comment 2 broy2 CLA 2011-11-15 10:58:52 EST
In RBD, I see the spaces in both Firefox and IE.
In EDT, I don't see the spaces in either browser.
Comment 3 Brian Svihovec CLA 2011-11-17 12:07:43 EST
Xiao Bin, assuming there are no other P1 widget defects, I would like for us to determine why the spaces are missing.  I ran a quick test in RBD 8, and it looks like the CSS styling isn't being applied correctly, but in EDT it is being applied.  It seems that the lack of styling in RBD lets the spaces remain.  

If this is the case, then EDT is working 'more correct' than RBD because it is applying the styling, and we probably need to make a CSS change for padding SPANs in EDT, which we would do after .7.
Comment 4 Xiao Bin Chen CLA 2011-11-18 00:25:48 EST
I have tested in RBD8012, and talked with jiyong, seems like this is a defect in RBD8012. And it's correctly in EDT(It works according to the css we defined). So maybe we need to fix RBD defect not EDT. If we want "space" we could change the CSS.
Comment 5 Ben Margolis CLA 2011-11-18 08:40:10 EST
(In reply to comment #4)
> Maybe we need to fix RBD defect not EDT. If we want "space" we
> could change the CSS.

The RBD outcome seemed more straightforward for application use.  I also suggest making the behavior closer to the RBD behavior, whether now or after .7.

On looking at an HTML spec, I came to believe that RBD worked as it did because multiple spaces concatenated together left one space.  In any case, we need a to state a rule for how the EGL Span widget treats spaces.
Comment 6 Brian Svihovec CLA 2011-11-18 16:04:00 EST
Setting to future.  I think we should add more CSS styling directives to EDT so that it behaves like RBD, but I don't think we should do this now.
Comment 7 Yun Feng Ma CLA 2011-12-14 02:45:18 EST
Hi Brian,

For this issue, just like what said in comment 3: EDT is working as expected, but RBD failed to apply the css. I just looked into why RBD failed to load claro.css, the reason is that the widget Div and Span don't has cssFile property defined in RBD and if a handler only contains Div or Span, the handler will not load claro.css file. Most widgets in RBD contains cssFile property defined, except below: Div, Span, HTML, HyperLink, Image, List, ListMulti, RadioGroup, Shadow, TextLabel, Tree. If the handler contains a widget which has cssFile to "css/com.ibm.egl.rui_2.0.0.css" in RBD, the behavior of Span is same between RBD and EDT. 

I believe a real RUI application will contain at least a widget which has cssFile to "css/com.ibm.egl.rui_2.0.0.css" in RBD, then maybe a customer is using the behavior of Span we saw in EDT, and we should not break it.

Let me know you thoughts. Thanks a lot.
Comment 8 Brian Svihovec CLA 2011-12-14 15:49:29 EST
I am ok with leaving things as they are for both RBD and EDT.  

In EDT, and RBD when the proper CSS file is applied, is there a way to get the spans to appear with spaces between them?
Comment 9 Yun Feng Ma CLA 2011-12-14 20:53:13 EST
Hi Brian,

Yes, user's css setting can overwrite the default setting for Span widget. Here is a sample for RBD:

   myDiv Div{children = [mySpan01, mySpan02, mySpan03]};
   mySpan01 Span{text = "mix blue ", color = "blue", class = "abc"};
   mySpan02 Span{text = " and red ", color = "red", class = "abc"};
   mySpan03 Span{text = " to see purple", color = "purple", class = "abc"};

with below css:
.abc {
   display: inline-block;
}

Mark this bug as invalid, as RBD has issue and EDT works fine. Thanks.
Comment 10 Lisa Lasher CLA 2012-01-13 13:57:49 EST
closing defect