Ticket #104 (closed defect: fixed)
Bug in Stylist incorrectly deals with hr styles (solution suggested)
| Reported by: | egk10@… | Owned by: | gogo |
|---|---|---|---|
| Priority: | normal | Milestone: | Version 1.0 |
| Component: | Plugin_DynamicCSS | Version: | unified_backend |
| Severity: | blocker | Keywords: | stylesheet, stylist |
| Cc: |
Description
A piece of 'lazy' code in stylist.js confuses h1, h2, h3, h4 etc. tags with hr (horizaontal rule). This causes a crash if the stylesheet contains a style such as hr.short (e.g. to produce a 75% horizontal rule). The affected code is the following:
~line 122 // If we don't have an ancestor, but it's a div/span/p/hx stle, we can make one
if(( tag == 'div'
tag == 'span' tag == 'p'
(tag.substr(0,1) == 'h' && tag.length == 2) )) the problem is that 'h' && tag.length == 2, which is intended to match h1 h2 h3 etc., but also matches hr. The solution is to replace the above code with:
if(( tag == 'div'
tag == 'span' tag == 'p'
(tag.substr(0,1) == 'h' && tag.length == 2) ) && tag != 'hr' ) Hope this helps.
Change History
Note: See TracTickets for help on using tickets.Download in other formats:
