diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2015-01-23 02:34:29 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-02-10 23:44:01 +0300 |
commit | 0ea342a6a6dce793c1b0f14f051c2573f40f4e44 (patch) | |
tree | a2bb76431095960fb227d932c2a8487bdd7a2fd8 /src/manipulation.js | |
parent | 45ec73f55618cd080867a98b42b9ab80409cab2e (diff) | |
download | jquery-0ea342a6a6dce793c1b0f14f051c2573f40f4e44.tar.gz jquery-0ea342a6a6dce793c1b0f14f051c2573f40f4e44.zip |
Manipulation: simplify html wrappers
Take advantage of html serialization for html wrappers - saves 26 bytes
Plus add additional test for "col" element
Closes gh-2031
Fixes gh-2002
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 2e309f5e7..b11f56074 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -33,9 +33,20 @@ var option: [ 1, "<select multiple='multiple'>", "</select>" ], thead: [ 1, "<table>", "</table>" ], + + // Some of the following wrappers are not fully defined, because + // their parent elements (except for "table" element) could be omitted + // since browser parsers are smart enough to auto-insert them + + // Support: Android 2.3 + // Android browser doesn't auto-insert colgroup col: [ 2, "<table><colgroup>", "</colgroup></table>" ], - tr: [ 2, "<table><tbody>", "</tbody></table>" ], - td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], + + // Auto-insert "tbody" element + tr: [ 2, "<table>", "</table>" ], + + // Auto-insert "tbody" and "tr" elements + td: [ 3, "<table>", "</table>" ], _default: [ 0, "", "" ] }; |