Bugzilla – Bug 17760
createPattern(canvas, null) now throws rather than 'repeat'
Last modified: 2012-08-20 23:33:12 UTC
For compatibility and interoperability it would seem far safer to not throw an exception when createPattern(canvas, null) is used. In the below list of browsers that treat this as a 'repeat' e.g. createPattern(canvas, 'repeat').
The previous version of the spec had a normative statement that matched the majority of browsers. The latest version of the spec changed this normative statement.
'If the empty string or null is specified, repeat must be assumed. If an unrecognized value is given, then the user agent must raise a SYNTAX_ERR exception'
Current working draft has changed to
'If the empty string is specified, repeat must be assumed. If an unrecognized value is given, then the user agent must raise a SYNTAX_ERR exception.'
Treats null as 'repeat'
Internet Explorer 9
Opera 12 does indeed raise an exception when passed 'null'
Nightly also throws.
This bug was cloned to create bug 17891 as part of operation convergence.
Filter on [Idon'tcareaboutHTMLWGbugspam].
This was a result of an update to the IDL, see:
I'm unsure if this was an intended change. Pinged the writer of the patch.
(In reply to comment #4)
> This was a result of an update to the IDL, see:
> I'm unsure if this was an intended change. Pinged the writer of the patch.
Cameron McCormack says that this was an accidental change.
This should be reverted to the previous behavior.
(Please note that the WHATWG spec will not be taking this change, as it does not lead towards interop and is a technically worse state for the spec to be in.)