Skip to content

Commit

Permalink
Added in support for injecting area elements into map elements. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Dec 7, 2009
1 parent fbc73d4 commit 2092789
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/manipulation.js
Expand Up @@ -17,6 +17,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
tr: [ 2, "<table><tbody>", "</tbody></table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
area: [ 1, "<map>", "</map>" ],
_default: [ 0, "", "" ] _default: [ 0, "", "" ]
}; };


Expand Down
6 changes: 5 additions & 1 deletion test/unit/manipulation.js
Expand Up @@ -659,7 +659,7 @@ test("val(Function)", function() {
}) })


var testHtml = function(valueObj) { var testHtml = function(valueObj) {
expect(20); expect(22);


jQuery.scriptorder = 0; jQuery.scriptorder = 0;


Expand Down Expand Up @@ -693,6 +693,10 @@ var testHtml = function(valueObj) {
equals( $div2.html("x" + insert).html(), "x" + insert, "Verify escaped insertion." ); equals( $div2.html("x" + insert).html(), "x" + insert, "Verify escaped insertion." );
equals( $div2.html(" " + insert).html(), " " + insert, "Verify escaped insertion." ); equals( $div2.html(" " + insert).html(), " " + insert, "Verify escaped insertion." );


var map = jQuery("<map/>").html(valueObj("<area id='map01' shape='rect' coords='50,50,150,150' href='http://www.jquery.com/' alt='jQuery'>"));

equals( map[0].childNodes.length, 1, "The area was inserted." );
equals( map[0].firstChild.nodeName.toLowerCase(), "area", "The area was inserted." );


reset(); reset();


Expand Down

0 comments on commit 2092789

Please sign in to comment.