[General] Safari 4 Crashing: A Patch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[General] Safari 4 Crashing: A Patch

Philip Weaver
The crash is related to the value returned from String.fromCharCode(173). In
Lively and in a simple html file: console.log prints nothing visible for the
character and window.alert prints a character. This displayed character
resembles a minus symbol. I haven't found an ascii table yet which indicates
what this is supposed to represent.

Tracked this down via computeExtents[Config.fontMetricsFromHTML] in
Text.js. I attempted to do some detections on the text node and try/catch
but was unsuccessful. Have not reported anything to Apple - feel free.

String.fromCharCode = String.fromCharCode.wrap(function(proceed, charCode) {
var result = proceed(charCode);
if (charCode == 173) {
 result = '-';
}
return result;
});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090409/98ae99db/attachment.html 


Reply | Threaded
Open this post in threaded view
|

[General] Safari 4 Crashing: A Patch

Philip Weaver
Actually it might be more cautious to just add special case in
computeExtents (html). But I'm sure you all can figure out what's best.
Phil

On Thu, Apr 9, 2009@6:00 AM, Philip Weaver <[hidden email]> wrote:

>
> The crash is related to the value returned from String.fromCharCode(173).
> In Lively and in a simple html file: console.log prints nothing visible for
> the character and window.alert prints a character. This displayed character
> resembles a minus symbol. I haven't found an ascii table yet which indicates
> what this is supposed to represent.
>
> Tracked this down via computeExtents[Config.fontMetricsFromHTML] in
> Text.js. I attempted to do some detections on the text node and try/catch
> but was unsuccessful. Have not reported anything to Apple - feel free.
>
> String.fromCharCode = String.fromCharCode.wrap(function(proceed, charCode)
> {
> var result = proceed(charCode);
> if (charCode == 173) {
>  result = '-';
> }
> return result;
> });
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090409/e1fa56b4/attachment.html