Ticket #104 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

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

Changed 7 years ago by gogo

  • version set to trunk
  • severity changed from normal to major
  • milestone set to Version 1.0

Changed 7 years ago by gogo

  • status changed from new to closed
  • resolution set to fixed

applied in changeset:181

Changed 7 years ago by anonymous

  • version changed from trunk to unified_backend
  • component changed from Plugin - Stylist to Plugin_DynamicCSS
  • severity changed from major to blocker
Note: See TracTickets for help on using tickets.