Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#662 closed defect (fixed)

RichText.js can throw error if lastChild is a text node

Reported by: andyhot@… Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

See http://svn.dojotoolkit.org/dojo/trunk/src/widget/RichText.js line 376.

if (tmpContent.firstChild && tmpContent.firstChild.style) {
    tmpContent.firstChild.style.marginTop = 
        this._firstChildContributingMargin+"px";
    tmpContent.lastChild.style.marginBottom = 
        this._lastChildContributingMargin+"px";			
}

There's a check for firstStyle supporting the style attribute, but there's no similar check for the lastChild.

Without this fix, RichText? cannot edit html content (i.e. stored in a DB) which ends in a text node, so '<b>Hello</b> World' breaks, while

'<p><b>Hello</b> World</p>' works.

Attachments (1)

RichText.patch (553 bytes) - added by andyhot@… 13 years ago.
Fix for this issue

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by andyhot@…

Attachment: RichText.patch added

Fix for this issue

comment:1 Changed 13 years ago by alex

Resolution: fixed
Status: newclosed

looks to have been already fixed, but [3912] should seal the deal.

comment:2 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.