Menu

#143 Canvas is not implemented

closed
5
2012-10-21
2009-05-04
No

we are using buff.js from http://bluff.jcoglan.com/.

while using webtest to test our portal we get an JavaScript-Error.

JavaScript error loading page https://fachportal.key-work-asp.de/ags_demo/ofbiz/articleProjection/control/EditArticleSizeAllocation?apnDispoDatasetId=205&articleId=ART_10020: TypeError: Cannot find function getContext in object [object]. (https://fachportal.key-work-asp.de/ags_demo/js/bluff/bluff-src.js#2101)


caused by this JavaScript-snippet:


Bluff.Renderer = new JS.Class({
extend: {
WRAPPER_CLASS: 'bluff-wrapper',
TEXT_CLASS: 'bluff-text'
},

font: 'Arial, Helvetica, Verdana, sans-serif',
gravity: 'north',

initialize: function(canvasId) {
this._canvas = document.getElementById(canvasId);
this._ctx = this._canvas.getContext('2d');
},

scale: function(sx, sy) {
this._sx = sx;
this._sy = sy || sx;
},
........


Thanks for your gorgeous work!

Discussion

  • Michael Habbert

    Michael Habbert - 2009-05-04

    related JavaScript Source file.

     
  • Marc Guillemot

    Marc Guillemot - 2009-05-05

    In fact here the problem is the lack of support for Canvas.

     
  • Michael Habbert

    Michael Habbert - 2009-05-06

    Hi Ahmed
    Thanks, but an empty implementation would be fine for now.

     
  • Ahmed Ashour

    Ahmed Ashour - 2009-05-06

    I guess all methods are now implemetned (using naked-eye examination) :-)

    Advise if you still have an issue

     
  • Piotr

    Piotr - 2012-06-03

    Canvas support is still problematic. Apparently the only BrowserVersion that supports it in HtmlUnit 2.9 is old FIREFOX_3_6 that has other issues. In the current version there are also FIREFOX_10 and CHROME_16 but they are marked as experimental. Manually adding BrowserVersionFeatures.CANVAS to INTERNET_EXPLORER doesn't work and it seems that the support is partially enabled by BrowserVersion's applicationName that has to be equal to "Netscape".

    Is there a recommended way to use modern browser features like canvas in the most recent stable version of HtmlUnit (2.9)?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.