Skip to content
Browse files

Merge pull request #21 from cscott/move-outerHTML

Move outerHTML/innerHTML properties from HTMLElement to Element.
  • Loading branch information...
2 parents 9910ba8 + fb4a932 commit 0b3eb5f79bc9424b2b09e6af158cf0c6983dbedb @fgnass committed
Showing with 19 additions and 13 deletions.
  1. +19 −0 lib/Element.js
  2. +0 −13 lib/htmlelts.js
View
19 lib/Element.js
@@ -64,6 +64,25 @@ Element.prototype = Object.create(Node.prototype, {
}
}
},
+ innerHTML: {
+ get: function() {
+ return this.serialize();
+ },
+ set: utils.nyi
+ },
+ outerHTML: {
+ get: function() {
+ // "the attribute must return the result of running the HTML fragment
+ // serialization algorithm on a fictional node whose only child is
+ // the context object"
+ var fictional = {
+ childNodes: [ this ],
+ nodeType: 0
+ };
+ return this.serialize.call(fictional);
+ },
+ set: utils.nyi
+ },
children: { get: function() {
if (!this._children) {
View
13 lib/htmlelts.js
@@ -112,19 +112,6 @@ var HTMLElement = exports.HTMLElement = define({
Element.call(this, doc, localName, NAMESPACE.HTML, prefix);
},
props: {
- outerHTML: {
- get: function() {
- // "the attribute must return the result of running the HTML fragment
- // serialization algorithm on a fictional node whose only child is
- // the context object"
- var fictional = {
- childNodes: [ this ],
- nodeType: 0
- };
- return this.serialize.call(fictional);
- },
- set: utils.nyi
- },
innerHTML: {
get: function() {
return this.serialize();

0 comments on commit 0b3eb5f

Please sign in to comment.
Something went wrong with that request. Please try again.