History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-3391
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P2 P2
Assignee: Frisco Del Rosario
Reporter: Frisco Del Rosario
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

CSS: Selector names cannot include underscore

Created: 04/Jan/07 12:16 PM   Updated: 17/Aug/08 04:54 PM
Component/s: LFC - CSS
Affects Version/s: None
Fix Version/s: 3.4

Time Tracking:
Not Specified

Severity: Critical
Fixed in Change#: 3,494
Runtime: N/A
Fix in hand: False


 Description  « Hide
Found this while porting test/style to lzunit. If the underscore tests ran previously, then it has regressed.

This won't compile:

<canvas debug="true">
<include href="lzunit"/>


<stylesheet>
#under_score {bgcolor : #00FF00;}
</stylesheet>

<view id="under_score" height="100" width="100" bgcolor="$style{'bgcolor'}"/>

<TestSuite>
<TestCase>
<method name="testUnderScore">
assertEquals('0x00FF00', under_score.bgcolor);
</method>
</TestCase>
</TestSuite>

</canvas>


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Benjamin Shine - 04/Jan/07 03:13 PM
This is a known limitation of the css parser we're using.
See test/style/names/main_underscore.lzx

Benjamin Shine - 10/Jan/07 11:54 AM
Tucker has a fix for this, so I'm reopening this bug, so we can track the fix.

P T Withington - 23/Jan/07 02:11 PM
r3494 | ptw | 2007-01-23 17:10:32 -0500 (Tue, 23 Jan 2007) | 27 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/css/CSSHandler.java
   M /openlaszlo/trunk/test/style/names/main_underscore.lzx

Change 20070108-ptw-q by ptw@dueling-banjos.local on 2007-01-08 22:59:33 EST
    in /Users/ptw/OpenLaszlo/trunk/test/style/names

Summary: Process CSS escapes

Bugs Fixed:
LPP-3391 'CSS: Selector names cannot include underscore'

Technical Reviewer: ben (Message-Id: <D914D6E4-A733-4ACA-95A0-1ECB29FD4A7E@laszlosystems.com>)
QA Reviewer: frisco (pending)
Doc Reviewer: n/a

Release Notes:
    CSS parsing now correctly processes escapes. An underscore can be
    included in a selector or identifier by using `\` to escape the
    underscore (additionally, any unicode character can be expressed
    as its hexadecimal value in compliance with the w3c CSS
    specification.

Details:
    CSSHandler: The batik parser accepts escapes according to the CSS
    spec, but returns them as written. In the handlers, escapes need
    to be converted to the equivalent Javascript.

Tests:
    Changing `lzx_bgcolor` to `lzx\_bgcolor` in
    test/style/names/main_underscore.lzx makes the test work.

Piotr Kaminski - 17/Aug/08 04:54 PM
This appears to be broken again in 4.1.1. The sample code given in the description fails to compile.