From: John Resig Date: Mon, 7 Sep 2009 20:55:36 +0000 (+0000) Subject: Broke the logic for .clean() wrap out into a separate, static, data structure. Also... X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=520f1a26845252dd6d7fd5f3b5bb7779ba91eb2c Broke the logic for .clean() wrap out into a separate, static, data structure. Also improved the performance of .html() looking for the case where .innerHTML can be used without problems. Also tweaked some cases where cleanData() was used, no need to use jQuery selectors in these cases. --- diff --git a/Makefile b/Makefile index c236120..95e3769 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,12 @@ PLUG_DIR = ../plugins BASE_FILES = ${SRC_DIR}/core.js\ ${SRC_DIR}/data.js\ + ${SRC_DIR}/event.js\ + ${SRC_DIR}/support.js\ ${SRC_DIR}/selector.js\ ${SRC_DIR}/traversing.js\ ${SRC_DIR}/attributes.js\ ${SRC_DIR}/manipulation.js\ - ${SRC_DIR}/event.js\ - ${SRC_DIR}/support.js\ ${SRC_DIR}/css.js\ ${SRC_DIR}/ajax.js\ ${SRC_DIR}/fx.js\ diff --git a/build.xml b/build.xml index 095c52e..d0ab83c 100644 --- a/build.xml +++ b/build.xml @@ -54,12 +54,12 @@ + + - - diff --git a/src/manipulation.js b/src/manipulation.js index 30ba5ab..95e2f7a 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -2,14 +2,32 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rleadingWhitespace = /^\s+/, rxhtmlTag = /(<(\w+)[^>]*?)\/>/g, rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i, - rinsideTable = /^<(thead|tbody|tfoot|colg|cap)/, + rtagName = /<(\w+)/, rtbody = /"; + }, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + _default: [ 0, "", "" ] }; +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and ')); + jQuery("#main").html(valueObj('')); - jQuery("#main").html(valueObj('foo
')); + jQuery("#main").html(valueObj('foo
')); // it was decided that waiting to execute ALL scripts makes sense since nested ones have to wait anyway so this test case is changed, see #1959 jQuery("#main").html(valueObj("