OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 function linkifyValue(value) { | 1204 function linkifyValue(value) { |
1205 var rewrittenHref = node.resolveURL(value); | 1205 var rewrittenHref = node.resolveURL(value); |
1206 if (rewrittenHref === null) { | 1206 if (rewrittenHref === null) { |
1207 var span = createElement('span'); | 1207 var span = createElement('span'); |
1208 setValueWithEntities.call(this, span, value); | 1208 setValueWithEntities.call(this, span, value); |
1209 return span; | 1209 return span; |
1210 } | 1210 } |
1211 value = value.replace(closingPunctuationRegex, '$&\u200B'); | 1211 value = value.replace(closingPunctuationRegex, '$&\u200B'); |
1212 if (value.startsWith('data:')) | 1212 if (value.startsWith('data:')) |
1213 value = value.trimMiddle(60); | 1213 value = value.trimMiddle(60); |
1214 var anchor = node.nodeName().toLowerCase() === 'a' ? UI.createExternalLink
(rewrittenHref, value, '', true) : | 1214 return node.nodeName().toLowerCase() === 'a' ? |
1215 Components.Linkifier.
linkifyURL(rewrittenHref, value); | 1215 UI.createExternalLink(rewrittenHref, value, '', true) : |
1216 anchor.preventFollow = true; | 1216 Components.Linkifier.linkifyURL(rewrittenHref, value, '', undefined, u
ndefined, true); |
1217 return anchor; | |
1218 } | 1217 } |
1219 | 1218 |
1220 if (node && (name === 'src' || name === 'href')) { | 1219 if (node && (name === 'src' || name === 'href')) { |
1221 attrValueElement.appendChild(linkifyValue.call(this, value)); | 1220 attrValueElement.appendChild(linkifyValue.call(this, value)); |
1222 } else if ( | 1221 } else if ( |
1223 node && (node.nodeName().toLowerCase() === 'img' || node.nodeName().toLo
werCase() === 'source') && | 1222 node && (node.nodeName().toLowerCase() === 'img' || node.nodeName().toLo
werCase() === 'source') && |
1224 name === 'srcset') { | 1223 name === 'srcset') { |
1225 var sources = value.split(','); | 1224 var sources = value.split(','); |
1226 for (var i = 0; i < sources.length; ++i) { | 1225 for (var i = 0; i < sources.length; ++i) { |
1227 if (i > 0) | 1226 if (i > 0) |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 | 1560 |
1562 // A union of HTML4 and HTML5-Draft elements that explicitly | 1561 // A union of HTML4 and HTML5-Draft elements that explicitly |
1563 // or implicitly (for HTML5) forbid the closing tag. | 1562 // or implicitly (for HTML5) forbid the closing tag. |
1564 Elements.ElementsTreeElement.ForbiddenClosingTagElements = new Set([ | 1563 Elements.ElementsTreeElement.ForbiddenClosingTagElements = new Set([ |
1565 'area', 'base', 'basefont', 'br', 'canvas', 'col', 'command', 'embed',
'frame', 'hr', | 1564 'area', 'base', 'basefont', 'br', 'canvas', 'col', 'command', 'embed',
'frame', 'hr', |
1566 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source',
'track', 'wbr' | 1565 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source',
'track', 'wbr' |
1567 ]); | 1566 ]); |
1568 | 1567 |
1569 // These tags we do not allow editing their tag name. | 1568 // These tags we do not allow editing their tag name. |
1570 Elements.ElementsTreeElement.EditTagBlacklist = new Set(['html', 'head', 'body']
); | 1569 Elements.ElementsTreeElement.EditTagBlacklist = new Set(['html', 'head', 'body']
); |
OLD | NEW |