aboutsummaryrefslogtreecommitdiff
path: root/sources/core/htmlparser
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2017-12-04 17:54:04 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2017-12-04 17:54:04 +0100
commit317f8f8f0651488f226b5280a8f036c7c135c639 (patch)
tree97bd4889ab2822a00d4b0f0d5cde38b59f9f41de /sources/core/htmlparser
parent1096cdefb1c9a3f3c4ca6807e272da6c92e5ed9c (diff)
downloadpiedsjaloux-ckeditor-component-317f8f8f0651488f226b5280a8f036c7c135c639.tar.gz
piedsjaloux-ckeditor-component-317f8f8f0651488f226b5280a8f036c7c135c639.tar.zst
piedsjaloux-ckeditor-component-317f8f8f0651488f226b5280a8f036c7c135c639.zip
Add oembed4.7.3
Diffstat (limited to 'sources/core/htmlparser')
-rw-r--r--sources/core/htmlparser/basicwriter.js4
-rw-r--r--sources/core/htmlparser/cdata.js2
-rw-r--r--sources/core/htmlparser/comment.js2
-rw-r--r--sources/core/htmlparser/element.js44
-rw-r--r--sources/core/htmlparser/filter.js2
-rw-r--r--sources/core/htmlparser/fragment.js16
-rw-r--r--sources/core/htmlparser/node.js2
-rw-r--r--sources/core/htmlparser/text.js2
8 files changed, 53 insertions, 21 deletions
diff --git a/sources/core/htmlparser/basicwriter.js b/sources/core/htmlparser/basicwriter.js
index 62a97ef..61447f0 100644
--- a/sources/core/htmlparser/basicwriter.js
+++ b/sources/core/htmlparser/basicwriter.js
@@ -1,5 +1,5 @@
1/** 1/**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license 3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */ 4 */
5 5
@@ -67,7 +67,7 @@ CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass( {
67 * @param {String} attValue The attribute value. 67 * @param {String} attValue The attribute value.
68 */ 68 */
69 attribute: function( attName, attValue ) { 69 attribute: function( attName, attValue ) {
70 // Browsers don't always escape special character in attribute values. (#4683, #4719). 70 // Browsers don't always escape special character in attribute values. (http://dev.ckeditor.com/ticket/4683, http://dev.ckeditor.com/ticket/4719).
71 if ( typeof attValue == 'string' ) 71 if ( typeof attValue == 'string' )
72 attValue = CKEDITOR.tools.htmlEncodeAttr( attValue ); 72 attValue = CKEDITOR.tools.htmlEncodeAttr( attValue );
73 73
diff --git a/sources/core/htmlparser/cdata.js b/sources/core/htmlparser/cdata.js
index 4ece2b7..be8c5cf 100644
--- a/sources/core/htmlparser/cdata.js
+++ b/sources/core/htmlparser/cdata.js
@@ -1,5 +1,5 @@
1/** 1/**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license 3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */ 4 */
5 5
diff --git a/sources/core/htmlparser/comment.js b/sources/core/htmlparser/comment.js
index 171c62e..14a38f3 100644
--- a/sources/core/htmlparser/comment.js
+++ b/sources/core/htmlparser/comment.js
@@ -1,5 +1,5 @@
1/** 1/**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license 3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */ 4 */
5 5
diff --git a/sources/core/htmlparser/element.js b/sources/core/htmlparser/element.js
index 3654322..224d3e6 100644
--- a/sources/core/htmlparser/element.js
+++ b/sources/core/htmlparser/element.js
@@ -1,5 +1,5 @@
1/** 1/**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license 3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */ 4 */
5 5
@@ -35,7 +35,7 @@ CKEDITOR.htmlParser.element = function( name, attributes ) {
35 */ 35 */
36 this.children = []; 36 this.children = [];
37 37
38 // Reveal the real semantic of our internal custom tag name (#6639), 38 // Reveal the real semantic of our internal custom tag name (http://dev.ckeditor.com/ticket/6639),
39 // when resolving whether it's block like. 39 // when resolving whether it's block like.
40 var realName = name || '', 40 var realName = name || '',
41 prefixed = realName.match( /^cke:(.*)/ ); 41 prefixed = realName.match( /^cke:(.*)/ );
@@ -56,7 +56,7 @@ CKEDITOR.htmlParser.element = function( name, attributes ) {
56}; 56};
57 57
58/** 58/**
59 * Object presentation of CSS style declaration text. 59 * Object presentation of the CSS style declaration text.
60 * 60 *
61 * @class 61 * @class
62 * @constructor Creates a `cssStyle` class instance. 62 * @constructor Creates a `cssStyle` class instance.
@@ -419,7 +419,7 @@ CKEDITOR.htmlParser.cssStyle = function() {
419 * 419 *
420 * @since 4.3 420 * @since 4.3
421 * @param {Number} index Index at which the element will be split &mdash; `0` means the beginning, 421 * @param {Number} index Index at which the element will be split &mdash; `0` means the beginning,
422 * `1` after first child node, etc. 422 * `1` after the first child node, etc.
423 * @returns {CKEDITOR.htmlParser.element} The new element following this one. 423 * @returns {CKEDITOR.htmlParser.element} The new element following this one.
424 */ 424 */
425 split: function( index ) { 425 split: function( index ) {
@@ -443,6 +443,38 @@ CKEDITOR.htmlParser.cssStyle = function() {
443 }, 443 },
444 444
445 /** 445 /**
446 * Searches through the current node children to find nodes matching the `criteria`.
447 *
448 * @param {String/Function} criteria Tag name or evaluator function.
449 * @param {Boolean} [recursive=false]
450 * @returns {CKEDITOR.htmlParser.node[]}
451 */
452 find: function( criteria, recursive ) {
453 if ( recursive === undefined ) {
454 recursive = false;
455 }
456
457 var ret = [],
458 i;
459
460 for ( i = 0; i < this.children.length; i++ ) {
461 var curChild = this.children[ i ];
462
463 if ( typeof criteria == 'function' && criteria( curChild ) ) {
464 ret.push( curChild );
465 } else if ( typeof criteria == 'string' && curChild.name === criteria ) {
466 ret.push( curChild );
467 }
468
469 if ( recursive && curChild.find ) {
470 ret = ret.concat( curChild.find( criteria, recursive ) );
471 }
472 }
473
474 return ret;
475 },
476
477 /**
446 * Adds a class name to the list of classes. 478 * Adds a class name to the list of classes.
447 * 479 *
448 * @since 4.4 480 * @since 4.4
@@ -511,8 +543,8 @@ CKEDITOR.htmlParser.cssStyle = function() {
511 543
512 if ( !ctx.nonEditable && this.attributes.contenteditable == 'false' ) 544 if ( !ctx.nonEditable && this.attributes.contenteditable == 'false' )
513 changes.push( 'nonEditable', true ); 545 changes.push( 'nonEditable', true );
514 // A context to be given nestedEditable must be nonEditable first (by inheritance) (#11372, #11698). 546 // A context to be given nestedEditable must be nonEditable first (by inheritance) (http://dev.ckeditor.com/ticket/11372, http://dev.ckeditor.com/ticket/11698).
515 // Special case: #11504 - filter starts on <body contenteditable=true>, 547 // Special case: http://dev.ckeditor.com/ticket/11504 - filter starts on <body contenteditable=true>,
516 // so ctx.nonEditable has not been yet set to true. 548 // so ctx.nonEditable has not been yet set to true.
517 else if ( ctx.nonEditable && !ctx.nestedEditable && this.attributes.contenteditable == 'true' ) 549 else if ( ctx.nonEditable && !ctx.nestedEditable && this.attributes.contenteditable == 'true' )
518 changes.push( 'nestedEditable', true ); 550 changes.push( 'nestedEditable', true );
diff --git a/sources/core/htmlparser/filter.js b/sources/core/htmlparser/filter.js
index 72767b5..db6b91c 100644
--- a/sources/core/htmlparser/filter.js
+++ b/sources/core/htmlparser/filter.js
@@ -1,5 +1,5 @@
1/** 1/**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license 3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */ 4 */
5 5
diff --git a/sources/core/htmlparser/fragment.js b/sources/core/htmlparser/fragment.js
index c062986..7ef915c 100644
--- a/sources/core/htmlparser/fragment.js
+++ b/sources/core/htmlparser/fragment.js
@@ -1,5 +1,5 @@
1/** 1/**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license 3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */ 4 */
5 5
@@ -61,7 +61,7 @@ CKEDITOR.htmlParser.fragment = function() {
61 if ( node.attributes[ 'data-cke-survive' ] ) 61 if ( node.attributes[ 'data-cke-survive' ] )
62 return false; 62 return false;
63 63
64 // Empty link is to be removed when empty but not anchor. (#7894) 64 // Empty link is to be removed when empty but not anchor. (http://dev.ckeditor.com/ticket/7894)
65 return node.name == 'a' && node.attributes.href || CKEDITOR.dtd.$removeEmpty[ node.name ]; 65 return node.name == 'a' && node.attributes.href || CKEDITOR.dtd.$removeEmpty[ node.name ];
66 } 66 }
67 67
@@ -130,7 +130,7 @@ CKEDITOR.htmlParser.fragment = function() {
130 i--; 130 i--;
131 } else { 131 } else {
132 // Some element of the same type cannot be nested, flat them, 132 // Some element of the same type cannot be nested, flat them,
133 // e.g. <a href="#">foo<a href="#">bar</a></a>. (#7894) 133 // e.g. <a href="#">foo<a href="#">bar</a></a>. (http://dev.ckeditor.com/ticket/7894)
134 if ( pendingName == currentNode.name ) 134 if ( pendingName == currentNode.name )
135 addElement( currentNode, currentNode.parent, 1 ), i--; 135 addElement( currentNode, currentNode.parent, 1 ), i--;
136 } 136 }
@@ -143,7 +143,7 @@ CKEDITOR.htmlParser.fragment = function() {
143 addElement( pendingBRs.shift(), currentNode ); 143 addElement( pendingBRs.shift(), currentNode );
144 } 144 }
145 145
146 // Rtrim empty spaces on block end boundary. (#3585) 146 // Rtrim empty spaces on block end boundary. (http://dev.ckeditor.com/ticket/3585)
147 function removeTailWhitespace( element ) { 147 function removeTailWhitespace( element ) {
148 if ( element._.isBlockLike && element.name != 'pre' && element.name != 'textarea' ) { 148 if ( element._.isBlockLike && element.name != 'pre' && element.name != 'textarea' ) {
149 149
@@ -275,10 +275,10 @@ CKEDITOR.htmlParser.fragment = function() {
275 // If the element cannot be child of the current element. 275 // If the element cannot be child of the current element.
276 if ( !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] ) { 276 if ( !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] ) {
277 // Current node doesn't have a close tag, time for a close 277 // Current node doesn't have a close tag, time for a close
278 // as this element isn't fit in. (#7497) 278 // as this element isn't fit in. (http://dev.ckeditor.com/ticket/7497)
279 if ( currentNode.isOptionalClose ) 279 if ( currentNode.isOptionalClose )
280 parser.onTagClose( currentName ); 280 parser.onTagClose( currentName );
281 // Fixing malformed nested lists by moving it into a previous list item. (#3828) 281 // Fixing malformed nested lists by moving it into a previous list item. (http://dev.ckeditor.com/ticket/3828)
282 else if ( tagName in listBlocks && currentName in listBlocks ) { 282 else if ( tagName in listBlocks && currentName in listBlocks ) {
283 var children = currentNode.children, 283 var children = currentNode.children,
284 lastChild = children[ children.length - 1 ]; 284 lastChild = children[ children.length - 1 ];
@@ -291,7 +291,7 @@ CKEDITOR.htmlParser.fragment = function() {
291 currentNode = lastChild; 291 currentNode = lastChild;
292 } 292 }
293 // Establish new list root for orphan list items, but NOT to create 293 // Establish new list root for orphan list items, but NOT to create
294 // new list for the following ones, fix them instead. (#6975) 294 // new list for the following ones, fix them instead. (http://dev.ckeditor.com/ticket/6975)
295 // <dl><dt>foo<dd>bar</dl> 295 // <dl><dt>foo<dd>bar</dl>
296 // <ul><li>foo<li>bar</ul> 296 // <ul><li>foo<li>bar</ul>
297 else if ( tagName in CKEDITOR.dtd.$listItem && 297 else if ( tagName in CKEDITOR.dtd.$listItem &&
@@ -409,7 +409,7 @@ CKEDITOR.htmlParser.fragment = function() {
409 var currentName = currentNode.name, 409 var currentName = currentNode.name,
410 currentDtd = currentName ? ( CKEDITOR.dtd[ currentName ] || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) ) : rootDtd; 410 currentDtd = currentName ? ( CKEDITOR.dtd[ currentName ] || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) ) : rootDtd;
411 411
412 // Fix orphan text in list/table. (#8540) (#8870) 412 // Fix orphan text in list/table. (http://dev.ckeditor.com/ticket/8540) (http://dev.ckeditor.com/ticket/8870)
413 if ( !inTextarea && !currentDtd[ '#' ] && currentName in nonBreakingBlocks ) { 413 if ( !inTextarea && !currentDtd[ '#' ] && currentName in nonBreakingBlocks ) {
414 parser.onTagOpen( structureFixes[ currentName ] || '' ); 414 parser.onTagOpen( structureFixes[ currentName ] || '' );
415 parser.onText( text ); 415 parser.onText( text );
diff --git a/sources/core/htmlparser/node.js b/sources/core/htmlparser/node.js
index 0f1b307..b38c8a8 100644
--- a/sources/core/htmlparser/node.js
+++ b/sources/core/htmlparser/node.js
@@ -1,5 +1,5 @@
1/** 1/**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license 3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */ 4 */
5 5
diff --git a/sources/core/htmlparser/text.js b/sources/core/htmlparser/text.js
index 07cb865..190e85a 100644
--- a/sources/core/htmlparser/text.js
+++ b/sources/core/htmlparser/text.js
@@ -1,5 +1,5 @@
1/** 1/**
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. 2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license 3 * For licensing, see LICENSE.md or http://ckeditor.com/license
4 */ 4 */
5 5