[Sugar-devel] Sugar-web compatibility issues

Lionel Laské lionel at olpc-france.org
Mon Jun 9 16:11:22 EDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20140609/98199296/attachment-0001.html>


More information about the Sugar-devel mailing list