test case isn't passing. Trying to find out why.
This commit is contained in:
parent
1618b3d180
commit
9428b69d44
|
@ -44,3 +44,10 @@ false
|
||||||
(html (head) (body (input (@ (id "my-field") (type "text") (value "this is a message")))))
|
(html (head) (body (input (@ (id "my-field") (type "text") (value "this is a message")))))
|
||||||
(html (head) (body (input (@ (id "my-field") (type "text") (value "hello again")))))
|
(html (head) (body (input (@ (id "my-field") (type "text") (value "hello again")))))
|
||||||
"hello again"
|
"hello again"
|
||||||
|
|
||||||
|
"id"
|
||||||
|
"para"
|
||||||
|
|
||||||
|
"remove"
|
||||||
|
(html (head) (body "some text"))
|
||||||
|
"some text"
|
||||||
|
|
|
@ -220,3 +220,32 @@
|
||||||
"my-field")
|
"my-field")
|
||||||
"value"
|
"value"
|
||||||
"hello again"))
|
"hello again"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(newline)
|
||||||
|
"id"
|
||||||
|
(view-id
|
||||||
|
(view-focus (->view (xexp->dom '(html (head) (body (p (@ (id "para")))))))
|
||||||
|
"para"))
|
||||||
|
|
||||||
|
(newline)
|
||||||
|
"remove"
|
||||||
|
(view->xexp
|
||||||
|
(view-remove
|
||||||
|
(view-focus (->view
|
||||||
|
(xexp->dom '(html (head)
|
||||||
|
(body (input (@ (id "my-field")
|
||||||
|
(type "text")
|
||||||
|
(value "this is a message")))
|
||||||
|
"some text"))))
|
||||||
|
"my-field")))
|
||||||
|
(view-text
|
||||||
|
(view-remove
|
||||||
|
(view-focus (->view
|
||||||
|
(xexp->dom '(html (head)
|
||||||
|
(body (input (@ (id "my-field")
|
||||||
|
(type "text")
|
||||||
|
(value "this is a message")))
|
||||||
|
"some text"))))
|
||||||
|
"my-field")))
|
|
@ -1354,20 +1354,27 @@
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var firstLessThan = function(x, y) {
|
||||||
|
return x[0] < y[0];
|
||||||
|
};
|
||||||
|
|
||||||
var domToXexp = function(dom) {
|
var domToXexp = function(dom) {
|
||||||
var child, attrs, name, convertedChildren, i;
|
var child, attrs, name, convertedChildren, i, attributes;
|
||||||
if (dom.nodeType === 1) {
|
if (dom.nodeType === 1) {
|
||||||
|
attributes = [];
|
||||||
attrs = plt.baselib.lists.EMPTY;
|
attrs = plt.baselib.lists.EMPTY;
|
||||||
name = plt.baselib.symbols.makeSymbol(dom.nodeName.toLowerCase());
|
name = plt.baselib.symbols.makeSymbol(dom.nodeName.toLowerCase());
|
||||||
child = dom.firstChild;
|
child = dom.firstChild;
|
||||||
convertedChildren = plt.baselib.lists.EMPTY;
|
convertedChildren = plt.baselib.lists.EMPTY;
|
||||||
|
|
||||||
for (i = 0; i < dom.attributes.length; i++) {
|
for (i = 0; i < dom.attributes.length; i++) {
|
||||||
|
attributes.push([dom.attributes[i].nodeName, dom.attributes[i].nodeValue]);
|
||||||
|
}
|
||||||
|
attributes.sort(firstLessThan);
|
||||||
|
for (i = 0; i < attributes.length; i++) {
|
||||||
attrs = plt.baselib.lists.makePair(
|
attrs = plt.baselib.lists.makePair(
|
||||||
plt.baselib.lists.makeList(plt.baselib.symbols.makeSymbol(dom.attributes[i].nodeName),
|
plt.baselib.lists.makeList(plt.baselib.symbols.makeSymbol(attributes[i][0]),
|
||||||
dom.attributes[i].nodeValue),
|
attributes[i][1]),
|
||||||
attrs);
|
attrs);
|
||||||
attrs = plt.baselib.lists.reverse(attrs);
|
|
||||||
}
|
}
|
||||||
while(child !== null) {
|
while(child !== null) {
|
||||||
if (child.nodeType === 1) {
|
if (child.nodeType === 1) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user