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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 if (rewrittenHref === null) { | 1269 if (rewrittenHref === null) { |
1270 var span = createElement('span'); | 1270 var span = createElement('span'); |
1271 setValueWithEntities.call(this, span, value); | 1271 setValueWithEntities.call(this, span, value); |
1272 return span; | 1272 return span; |
1273 } | 1273 } |
1274 value = value.replace(closingPunctuationRegex, '$&\u200B'); | 1274 value = value.replace(closingPunctuationRegex, '$&\u200B'); |
1275 if (value.startsWith('data:')) | 1275 if (value.startsWith('data:')) |
1276 value = value.trimMiddle(60); | 1276 value = value.trimMiddle(60); |
1277 var link = node.nodeName().toLowerCase() === 'a' ? | 1277 var link = node.nodeName().toLowerCase() === 'a' ? |
1278 UI.createExternalLink(rewrittenHref, value, '', true) : | 1278 UI.createExternalLink(rewrittenHref, value, '', true) : |
1279 Components.Linkifier.linkifyURL(rewrittenHref, value, '', undefined, u
ndefined, true); | 1279 Components.Linkifier.linkifyURL(rewrittenHref, {text: value, preventCl
ick: true}); |
1280 link[Elements.ElementsTreeElement.HrefSymbol] = rewrittenHref; | 1280 link[Elements.ElementsTreeElement.HrefSymbol] = rewrittenHref; |
1281 return link; | 1281 return link; |
1282 } | 1282 } |
1283 | 1283 |
1284 var nodeName = node ? node.nodeName().toLowerCase() : ''; | 1284 var nodeName = node ? node.nodeName().toLowerCase() : ''; |
1285 if (nodeName && (name === 'src' || name === 'href')) | 1285 if (nodeName && (name === 'src' || name === 'href')) |
1286 attrValueElement.appendChild(linkifyValue.call(this, value)); | 1286 attrValueElement.appendChild(linkifyValue.call(this, value)); |
1287 else if ((nodeName === 'img' || nodeName === 'source') && name === 'srcset') | 1287 else if ((nodeName === 'img' || nodeName === 'source') && name === 'srcset') |
1288 attrValueElement.appendChild(linkifySrcset.call(this, value)); | 1288 attrValueElement.appendChild(linkifySrcset.call(this, value)); |
1289 else | 1289 else |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 Elements.ElementsTreeElement.ForbiddenClosingTagElements = new Set([ | 1661 Elements.ElementsTreeElement.ForbiddenClosingTagElements = new Set([ |
1662 'area', 'base', 'basefont', 'br', 'canvas', 'col', 'command', 'embed',
'frame', 'hr', | 1662 'area', 'base', 'basefont', 'br', 'canvas', 'col', 'command', 'embed',
'frame', 'hr', |
1663 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source',
'track', 'wbr' | 1663 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source',
'track', 'wbr' |
1664 ]); | 1664 ]); |
1665 | 1665 |
1666 // These tags we do not allow editing their tag name. | 1666 // These tags we do not allow editing their tag name. |
1667 Elements.ElementsTreeElement.EditTagBlacklist = new Set(['html', 'head', 'body']
); | 1667 Elements.ElementsTreeElement.EditTagBlacklist = new Set(['html', 'head', 'body']
); |
1668 | 1668 |
1669 /** @typedef {{cancel: function(), commit: function(), resize: function(), edito
r:!UI.TextEditor}} */ | 1669 /** @typedef {{cancel: function(), commit: function(), resize: function(), edito
r:!UI.TextEditor}} */ |
1670 Elements.MultilineEditorController; | 1670 Elements.MultilineEditorController; |
OLD | NEW |