
|
If you were logged in you would be able to see more operations.
|
|
|
OpenLaszlo
Created: 19/Oct/06 03:03 PM
Updated: 03/Jan/07 02:22 PM
|
|
| Component/s: |
LFC - CSS
|
| Affects Version/s: |
3.4
|
| Fix Version/s: |
3.4
|
|
| Severity: |
Major
|
| Fixed in Change#: |
3,247
|
| Runtime: |
N/A
|
| Fix in hand: |
False
|
|
The following application shows that stylesheet declarations that assign colors by "name" , "rgb(x,x,x)", or "#hexcolor" don't work.
<canvas width="860" debug="true">
<stylesheet>
#vName {
bgcolorName : "blue";
}
#tName {
fgcolorName : "blue";
}
#vRGB {
bgcolorRGB : "#0000FF";
}
#tRGB {
fgcolorRGB : "#0000FF";
}
#vHex {
bgcolorHex : "0x0000FF";
}
#tHex {
fgcolorHex : "0x0000FF";
}
#vParens {
bgcolorParens : "rgb(0,0,255)";
}
#tParens {
fgcolorParens : "rgb(0,0,255)";
}
</stylesheet>
<wrappinglayout axis="x" spacing="10"/>
<view id="vName" height="100" width="100" bgcolor="$style{'bgcolorName'}"/>
<text id="tName" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="$style{'fgcolorName'}">Blue1</text>
<view id="vRGB" height="100" width="100" bgcolor="$style{'bgcolorRGB'}"/>
<text id="tRGB" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="$style{'fgcolorRGB'}">Blue2</text>
<view id="vHex" height="100" width="100" bgcolor="$style{'bgcolorHex'}"/>
<text id="tHex" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="$style{'fgcolorHex'}">Blue3</text>
<view id="vParens" height="100" width="100" bgcolor="$style{'bgcolorParens'}"/>
<text id="tParens" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="$style{'fgcolorParens'}">Blue4</text>
<view id="explicitVName" height="100" width="100" bgcolor="blue"/>
<text id="explicitTName" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="blue">Blue5</text>
<view id="explicitVRGB" height="100" width="100" bgcolor="#0000FF"/>
<text id="explicitTRGB" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="#0000FF">Blue6</text>
<view id="explicitVHex" height="100" width="100" bgcolor="0x0000FF"/>
<text id="explicitTHex" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="0x0000FF">Blue7</text>
<view id="explicitVParens" height="100" width="100" bgcolor="rgb(0,0,255)"/>
<text id="explicitTParens" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="rgb(0,0,255)">Blue8</text>
<script>
Debug.write("1=styled by blue");
Debug.write("2=styled by #0000FF");
Debug.write("3=styled by 0x0000FF");
Debug.write("4=styled by rgb(0,0,255)");
Debug.write("5=explicitly named blue");
Debug.write("6=explicitly colored #0000FF");
Debug.write("7=explicitly colored 0x0000FF");
Debug.write("8=explicitly colored rgb(0,0,255)");
</script>
<!--Blue1, Blue2, and Blue4 should be blue views, but show black-->
</canvas>
|
|
Description
|
The following application shows that stylesheet declarations that assign colors by "name" , "rgb(x,x,x)", or "#hexcolor" don't work.
<canvas width="860" debug="true">
<stylesheet>
#vName {
bgcolorName : "blue";
}
#tName {
fgcolorName : "blue";
}
#vRGB {
bgcolorRGB : "#0000FF";
}
#tRGB {
fgcolorRGB : "#0000FF";
}
#vHex {
bgcolorHex : "0x0000FF";
}
#tHex {
fgcolorHex : "0x0000FF";
}
#vParens {
bgcolorParens : "rgb(0,0,255)";
}
#tParens {
fgcolorParens : "rgb(0,0,255)";
}
</stylesheet>
<wrappinglayout axis="x" spacing="10"/>
<view id="vName" height="100" width="100" bgcolor="$style{'bgcolorName'}"/>
<text id="tName" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="$style{'fgcolorName'}">Blue1</text>
<view id="vRGB" height="100" width="100" bgcolor="$style{'bgcolorRGB'}"/>
<text id="tRGB" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="$style{'fgcolorRGB'}">Blue2</text>
<view id="vHex" height="100" width="100" bgcolor="$style{'bgcolorHex'}"/>
<text id="tHex" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="$style{'fgcolorHex'}">Blue3</text>
<view id="vParens" height="100" width="100" bgcolor="$style{'bgcolorParens'}"/>
<text id="tParens" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="$style{'fgcolorParens'}">Blue4</text>
<view id="explicitVName" height="100" width="100" bgcolor="blue"/>
<text id="explicitTName" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="blue">Blue5</text>
<view id="explicitVRGB" height="100" width="100" bgcolor="#0000FF"/>
<text id="explicitTRGB" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="#0000FF">Blue6</text>
<view id="explicitVHex" height="100" width="100" bgcolor="0x0000FF"/>
<text id="explicitTHex" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="0x0000FF">Blue7</text>
<view id="explicitVParens" height="100" width="100" bgcolor="rgb(0,0,255)"/>
<text id="explicitTParens" font="verdana,sans-serif" fontsize="30" fontstyle="bold" height="40" fgcolor="rgb(0,0,255)">Blue8</text>
<script>
Debug.write("1=styled by blue");
Debug.write("2=styled by #0000FF");
Debug.write("3=styled by 0x0000FF");
Debug.write("4=styled by rgb(0,0,255)");
Debug.write("5=explicitly named blue");
Debug.write("6=explicitly colored #0000FF");
Debug.write("7=explicitly colored 0x0000FF");
Debug.write("8=explicitly colored rgb(0,0,255)");
</script>
<!--Blue1, Blue2, and Blue4 should be blue views, but show black-->
</canvas> |
Show » |
|
If styled by rgb(x,x,x) or #xxxxxx, the views turn out black (.bgcolor==NaN). If no stylesheet selector is fired, no view appears (.bgcolor==null).
<canvas debug="true">
<include href="lzunit"/>
<stylesheet>
#skyBlue {
bgcolor : "0x00BFFF";
}
#stormGreen {
bgcolor : "rgb(0,64,0)";
}
#cometRed {
bgcolor : "#FF0000";
}
</stylesheet>
<simplelayout axis="x" spacing="10"/>
<!--Returns a proper integer as bgcolor-->
<view id="skyBlue" height="50" width="50" bgcolor="$style{'bgcolor'}"/>
<!--Background color is NaN because $style doesn't support rgb(x,x,x) yet-->
<view id="stormGreen" height="50" width="50" bgcolor="$style{'bgcolor'}"/>
<!--Background color is NaN because $style doesn't support #xxx yet-->
<view id="cometRed" height="50" width="50" bgcolor="$style{'bgcolor'}"/>
<!--Background color is null because selector doesn't fire-->
<view id="nothingThere" height="50" width="50" bgcolor="$style{'bgcolor'}"/>
<TestSuite>
<TestCase>
<method name="testLPP2954b">
assertEquals(Math.round(skyBlue.bgcolor), skyBlue.bgcolor, true);
assertEquals(isNaN(stormGreen.bgcolor), true);
assertEquals(isNaN(cometRed.bgcolor), true);
assertEquals(nothingThere.bgcolor, null, true);
</method>
</TestCase>
</TestSuite>
</canvas>
<!-- Copyright 2001-2006 Laszlo Systems, Inc. -->