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

Key: LPP-1164
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P3 P3
Assignee: Frisco Del Rosario
Reporter: Benjamin Shine
Votes: 0
Watchers: 0
Operations

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

css: applying styles to named nodes, order matters

Created: 02/Dec/05 02:48 PM   Updated: 27/Dec/06 02:47 PM
Component/s: LFC - CSS
Affects Version/s: 3.2 (Sage)
Fix Version/s: 3.4

Time Tracking:
Not Specified

Severity: Minor
Runtime: N/A
Flags: Emerald


 Description  « Hide
The order of declarations of css rules in a single css file matters in a way that it shouldn't. Consider these two rules
/* rule A */
stylishbutton[name="settings"] {
fontsize: 12;
}
/* rule B */
stylishbutton {
fontsize: 10;
}

If the css file has these rules in the order A, B, then all stylishbuttons not named "settings" are fontsize 10; only stylishbuttons named settings are fontsize 12.

However, if the order of the rules in the css file is B, A, then all stylishbuttons have fontsize 12.

The order of these two rules should not matter; rule A is more specific than rule B.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Benjamin Shine - 06/Sep/06 09:09 PM
We need to check whether this behavior is still present.

Sarah Allen - 20/Dec/06 01:01 PM
Frisco volunteers to investigate whether this is still a bug.

Frisco Del Rosario - 27/Dec/06 12:35 PM
<canvas debug="true">
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>

<stylesheet>

stylishbutton {
fontsize : 10;
}

stylishbutton [name='settings'] {
fontsize : 12;
}

</stylesheet>

<class name="stylishbutton" extends="button" fontsize="$style{'fontsize'}"/>

<stylishbutton name="settings" text="Should be 12"/>

<TestSuite>
<TestCase>
<method name="testLPP1164">
assertEquals('12', canvas.settings.fontsize);
</method>
</TestCase>
</TestSuite>

</canvas>

Benjamin Shine - 27/Dec/06 01:52 PM
That test case does not indicate an error. The test case is wrong.
The test case with a space
stylishbutton [name='settings']
is different from the original test:
stylishbutton[name="settings"]

The space makes a different selector.
person[name="george"] selects people whose name is george, but
person [name="george"] selects views named george who are a child of a person.