[Sugar-devel] Sugar-web compatibility issues

Gonzalo Odiard godiard at sugarlabs.org
Fri Jun 13 07:59:33 EDT 2014


The beautiful world of multiple almost compatible implementations :)
Thanks for looking at this issues, document and share.

Gonzalo



On Mon, Jun 9, 2014 at 5:11 PM, Lionel Laské <lionel at olpc-france.org> wrote:

>
> Hi all,
>
>
>
> Working on the last version of Sugarizer, I've spent lot of time to better
> handle compatibility issues on different browsers.
>
>
>
> Here two issues that I've detected in sugar-web. I would like to share it
> with you:
>
>
>
> 1) CustomEvent: Like lot of HTML5 features, CustomEvent is only a draft.
> BTW the version without constructor [1] is currently more deployed in
> browsers than the one with a constructor [2]. The sugar-web template use
> the later in two files activity.js [3] and menupalette.js [4]. It's
> possible to convert the call to the version with constructor to the version
> without constructor without changing the way of working of the code. Here
> how I've fixed it in activity.js [5] and here how I've fixed it in
> menupalette.js [6].
>
> No other line had to be changed and with these few changes, more browsers
> (IE, old Android browsers, ...) are compliant with sugar-web. I suggest that
> we should make these changes. I could do a pull request if you want.
>
> Note that the same issue is also in the Paint Web Activity for the color
> palette. Here is my fix [7].
>
>
>
> 2) Quote around CSS URL background image: It seems that the url value for
> the image used as background in the CSS is different between Webkit and
> other browser (specifically Firefox). So the line [8] return a quoted
> string on Firefox which is incorrect (and it broke the icon drawing). I've
> done an ugly work-around [9] to avoid that but maybe there is a better way
> to do that.
>
>
>
> Hope it will inspire you.
>
>
>
> Best regards from France.
>
>
>
> Lionel.
>
>
>
>
>
> [1]
> https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-CustomEvent
>
> [2]
> https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-customevent
>
> [3]
> https://github.com/sugarlabs/sugar-web/blob/master/activity/activity.js#L22
>
> [4]
> https://github.com/sugarlabs/sugar-web/blob/master/graphics/menupalette.js#L11
>
> [5]
> https://github.com/llaske/sugarizer/blob/master/activities/ActivityTemplate/lib/sugar-web/activity/activity.js#L22
>
> [6]
> https://github.com/llaske/sugarizer/blob/master/activities/ActivityTemplate/lib/sugar-web/graphics/menupalette.js#L11
>
> [7]
> https://github.com/llaske/sugarizer/blob/master/activities/Paint.activity/js/colorpalette.js#L9
>
> [8]
> https://github.com/sugarlabs/sugar-web/blob/master/graphics/icon.js#L60
>
> [9]
> https://github.com/llaske/sugarizer/blob/master/activities/ActivityTemplate/lib/sugar-web/graphics/icon.js#L61
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>


-- 
Gonzalo Odiard

SugarLabs - Software for children learning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20140613/b2f6f2a8/attachment-0001.html>


More information about the Sugar-devel mailing list