﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
14451	Widget crashes if editable region has a numeric ID	egli	Tomasz Jakut	"CKEditor throws an error if a valid widget has an editable element with a numeric ID (or any ID that needs escaped/serialized).

Underlying cause is `getContextualizedSelector()` in `CKEDITOR.dom.element` not escaping/serializing IDs when converting to a CSS selector, resulting in an invalid query passed to `querySelectorAll()` inside of `CKEDITOR.dom.element.find()`. Something akin to `CSS.escape()` is needed to correctly format the ID.

* W3C specification for valid CSS identifiers: https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
* W3C documentation on escaping/serializing IDs: https://drafts.csswg.org/cssom/#serialize-an-identifier
* MDN article on `CSS.escape()`: https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape


== Steps to reproduce ==

1. Navigate to ""Enhanced Image"" example on http://ckeditor.com/demo#widgets
2. Go into source mode
3. Add a numeric id to the `figcaption` element (say, `id=""100""`)
4. Exit source mode

== Expected result ==
CKEditor successfully returns to WYSIWYG mode; Widget and CKEditor continue to function normally.

== Actual result ==
Everything is terrible. A JavaScript error is thrown. Editing area returns to WYSIWYG, but buttons are not re-enabled. Tons of CKEditor features don't work. Double clicking on widget does not bring up the editor dialog. Image in widget cannot be resized.

== Other details (browser, OS, CKEditor version, installed plugins) ==
Only tested on CKEditor 4.5.7, but `getContextualizedSelector` is unchanged since it was added in 4.3.

Issue occurs in every browser I tested:
* Chrome 48.0.2564.116 (64-bit) on both Mac and Linux
* Safari 9.0.3 (11601.4.4) on OS X 10.11.3
"	Bug	closed	Normal	CKEditor 4.5.10	General	4.4.0	fixed		
