Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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 (3)

comment:1 Changed 12 years ago by gogo

  • Milestone set to Version 1.0
  • Severity changed from normal to major
  • Version set to trunk

comment:2 Changed 12 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

applied in changeset:181

comment:3 Changed 12 years ago by anonymous

  • Component changed from Plugin - Stylist to Plugin_DynamicCSS
  • Severity changed from major to blocker
  • Version changed from trunk to unified_backend
Note: See TracTickets for help on using tickets.