Permalink
Browse files

Move outerHTML/innerHTML properties from HTMLElement to Element.

This is where they belong according to http://domparsing.spec.whatwg.org/
  • Loading branch information...
1 parent 9910ba8 commit fb4a932df00a87bf5adfda06c34246b1abd80dbf @cscott cscott committed Apr 2, 2013
Showing with 19 additions and 13 deletions.
  1. +19 −0 lib/Element.js
  2. +0 −13 lib/htmlelts.js
View
@@ -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
@@ -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 fb4a932

Please sign in to comment.