/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
// Look for the element by id. We accept any kind of element here.\r
element = document.getElementById( elementOrIdOrName );\r
\r
+ // Elements that should go into head are unacceptable (#6791).\r
+ if ( element && element.tagName.toLowerCase() in {style:1,script:1,base:1,link:1,meta:1,title:1} )\r
+ element = null;\r
+\r
// If not found, look for elements by name. In this case we accept only\r
// textareas.\r
if ( !element )\r