mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Don't render <meta>/<link>/<style> tags in GeneratedContentNode
There is no good reason why we'd render these tags, and their presence causes Chrome to crash while cutting across them. Bug: 50043 Change-Id: I611e3907cf20fa27dbef89ea941d0b787a44ba4f
This commit is contained in:
parent
cd5ee730ab
commit
41a4b3fb51
|
@ -87,11 +87,19 @@ ve.ce.GeneratedContentNode.prototype.onGeneratedContentNodeUpdate = function ()
|
|||
* @emits rerender
|
||||
*/
|
||||
ve.ce.GeneratedContentNode.prototype.render = function ( domElements ) {
|
||||
var doc = this.getElementDocument();
|
||||
var $rendering, doc = this.getElementDocument();
|
||||
if ( this.live ) {
|
||||
this.emit( 'teardown' );
|
||||
}
|
||||
this.$.empty().append( ve.copyDomElements( domElements, doc ) );
|
||||
// Filter out link, meta and style tags for bug 50043
|
||||
// .not( 'link, meta, style' ) doesn't work because it drops text nodes
|
||||
$rendering = $( ve.copyDomElements( domElements, doc ) ).filter( function () {
|
||||
var name = this.nodeName && this.nodeName.toLowerCase();
|
||||
return name !== 'link' && name !== 'meta' && name !== 'style';
|
||||
} );
|
||||
// Also remove link, meta and style tags nested inside other tags
|
||||
$rendering.find( 'link, meta, style' ).remove();
|
||||
this.$.empty().append( $rendering );
|
||||
if ( this.live ) {
|
||||
this.emit( 'setup' );
|
||||
this.emit( 'rerender' );
|
||||
|
|
Loading…
Reference in a new issue