guardian / scribe

DEPRECATED: A rich text editor framework for the web platform
http://guardian.github.io/scribe/
Apache License 2.0
3.51k stars 245 forks source link

Catch unexpected error when calling queryCommandState in Firefox #406

Closed jamespamplin closed 9 years ago

jamespamplin commented 9 years ago

Firefox will consistently throw an error when calling queryCommandState for insertUnorderedList and insertOrderedList commands when there's no selection or a contenteditable hasn't got focus. Error as follows:

[Exception... "Unexpected error"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: debugger eval code :: <TOP_LEVEL> :: line 1"  data: no]

scribe-plugin-toolbar uses this command to determine the state of the list buttons. The failed call would result in the list command buttons still remaining active when scribe loses focus.

This issue has been recurring for a while in Firefox builds, so it makes sense to catch this until they get around to fixing it, see: https://bugzilla.mozilla.org/show_bug.cgi?id=562623

Fixes #208.

Also, added ability to pass an argument to run-tests.sh so you can specify which test specs to run.

rrees commented 9 years ago

That's rough! :+1: