Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9532 closed defect (fixed)

Editor: Safari doesn't always enable background color (TextColor Plugin)

Reported by: Jared Jurkiewicz Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.3.2
Component: General Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description

Editor: Safari doesn't always enable background color (TextColor? Plugin)

This was reported by a co-worker of mine and I verified it occurs:


Go to either of these pages:

http://download.dojotoolkit.org/release-1.2.3/dojo-release-1.2.3/dijit/tests/test_Editor.html

http://download.dojotoolkit.org/release-1.3.1/dojo-release-1.3.1/dijit/tests/test_Editor.html

I scrolled down to the editor that has a background color plugin. I highlighted random parts of the text. Sometimes the background color button becomes enabled, sometimes it doesn't (it's supposed to always be enabled if text is highlighted). I can highlight the same text twice and one time it will enable the button and one time it won't. However, it seems that most of the time, selecting text which is all on one line will enable the button, and most of the time selecting multiple lines will not enable the button.


I also determined what causes this from investigation and talking to Liu Cougar. The problem stems from onDisplayChanged not getting called when it should be. Normally onDisplayChanged gets called when a caret shifts or other events occur in the document. In this case, the mouse is beingused to select, and of course the display is getting changed to indicate that ... but WebKit? itself isn't firing the event, so onDisplayChanged isn't getting fired. There is thankfully a very simple fix for this (And Liu Cougar was fine with it).

In dijit/_editor/RichText.js:

Function: onLoad:

Add the following line right after the spot we do a correction for IE:

if(dojo.WebKit?){

this.connect(this.document, "onmouseup", "onDisplayChanged");

}

Liu was okay with me making this tweak, so assigning it to me.

Attachments (1)

WebKit_listener.patch (1.1 KB) - added by Jared Jurkiewicz 10 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 years ago by Jared Jurkiewicz

Note that I saw trhis specifically in Safari 3.2.3 and such, and my co-worker hit it on Safari 3.0.2.

In any event, it's a simple workaround. Patch coming!

Changed 10 years ago by Jared Jurkiewicz

Attachment: WebKit_listener.patch added

comment:2 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [18777]) Applying patch to trunk. \!strict fixes #9532

comment:3 Changed 10 years ago by Jared Jurkiewicz

Milestone: tbd

comment:4 Changed 10 years ago by Jared Jurkiewicz

(In [18780]) Backported minor safari fix for editor. refs #9532

comment:5 Changed 10 years ago by Adam Peller

Milestone: 1.3.2

comment:6 Changed 10 years ago by Jared Jurkiewicz

(In [18783]) Use this.connet/disconect here. \!strict refs #9532

comment:7 Changed 10 years ago by Jared Jurkiewicz

(In [18784]) Remove extranious comment. \!strict refs #9532

comment:8 Changed 10 years ago by Jared Jurkiewicz

(In [18785]) Use this.connect/disconect here. refs #9532

Note: See TracTickets for help on using tickets.