308 |
{ |
{ |
309 |
if (readonly && !owner.building) |
if (readonly && !owner.building) |
310 |
{ |
{ |
311 |
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, |
312 |
null, this, 0); |
null, this, 0); |
313 |
} |
} |
314 |
for (DomNode ctx = this; ctx != null; ctx = ctx.parent) |
for (DomNode ctx = this; ctx != null; ctx = ctx.parent) |
315 |
{ |
{ |
316 |
if (child == ctx) |
if (child == ctx) |
317 |
{ |
{ |
318 |
throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, |
throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, |
319 |
"can't make ancestor into a child", this, 0); |
"can't make ancestor into a child", |
320 |
|
this, 0); |
321 |
} |
} |
322 |
} |
} |
323 |
|
|
331 |
// new in DOM L2, this case -- patch it up later, in reparent() |
// new in DOM L2, this case -- patch it up later, in reparent() |
332 |
if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) |
if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) |
333 |
{ |
{ |
334 |
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, |
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, |
335 |
null, child, 0); |
null, child, 0); |
336 |
} |
} |
337 |
} |
} |
338 |
|
|
377 |
} |
} |
378 |
if (owner.checkingWellformedness) |
if (owner.checkingWellformedness) |
379 |
{ |
{ |
380 |
throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, |
throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, |
381 |
"can't append " + nodeTypeToString(childNodeType) + |
"can't append " + |
382 |
" to node of type " + nodeTypeToString(nodeType), |
nodeTypeToString(childNodeType) + |
383 |
this, 0); |
" to node of type " + |
384 |
|
nodeTypeToString(nodeType), |
385 |
|
this, 0); |
386 |
} |
} |
387 |
} |
} |
388 |
|
|
581 |
} |
} |
582 |
catch (ClassCastException e) |
catch (ClassCastException e) |
583 |
{ |
{ |
584 |
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, |
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, |
585 |
null, newChild, 0); |
null, newChild, 0); |
586 |
} |
} |
587 |
} |
} |
588 |
|
|
633 |
checkMisc(child); |
checkMisc(child); |
634 |
if (ref == null || ref.parent != this) |
if (ref == null || ref.parent != this) |
635 |
{ |
{ |
636 |
throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); |
throw new DomDOMException(DOMException.NOT_FOUND_ERR, |
637 |
|
null, ref, 0); |
638 |
} |
} |
639 |
if (ref == child) |
if (ref == child) |
640 |
{ |
{ |
641 |
throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, |
throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, |
642 |
"can't insert node before itself", ref, 0); |
"can't insert node before itself", |
643 |
|
ref, 0); |
644 |
} |
} |
645 |
|
|
646 |
if (child.parent != null) |
if (child.parent != null) |
677 |
} |
} |
678 |
catch (ClassCastException e) |
catch (ClassCastException e) |
679 |
{ |
{ |
680 |
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, |
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, |
681 |
null, newChild, 0); |
null, newChild, 0); |
682 |
} |
} |
683 |
} |
} |
684 |
|
|
726 |
} |
} |
727 |
if (ref == null || ref.parent != this) |
if (ref == null || ref.parent != this) |
728 |
{ |
{ |
729 |
throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); |
throw new DomDOMException(DOMException.NOT_FOUND_ERR, |
730 |
|
null, ref, 0); |
731 |
} |
} |
732 |
|
|
733 |
if (reportMutations) |
if (reportMutations) |
790 |
checkMisc(child); |
checkMisc(child); |
791 |
if (ref == null || ref.parent != this) |
if (ref == null || ref.parent != this) |
792 |
{ |
{ |
793 |
throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); |
throw new DomDOMException(DOMException.NOT_FOUND_ERR, |
794 |
|
null, ref, 0); |
795 |
} |
} |
796 |
|
|
797 |
if (reportMutations) |
if (reportMutations) |
844 |
} |
} |
845 |
catch (ClassCastException e) |
catch (ClassCastException e) |
846 |
{ |
{ |
847 |
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, |
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, |
848 |
null, newChild, 0); |
null, newChild, 0); |
849 |
} |
} |
850 |
} |
} |
851 |
|
|
867 |
|
|
868 |
if (ref == null || ref.parent != this) |
if (ref == null || ref.parent != this) |
869 |
{ |
{ |
870 |
throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); |
throw new DomDOMException(DOMException.NOT_FOUND_ERR, |
871 |
|
null, ref, 0); |
872 |
} |
} |
873 |
if (readonly && !owner.building) |
if (readonly && !owner.building) |
874 |
{ |
{ |
875 |
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, |
876 |
null, this, 0); |
null, this, 0); |
877 |
} |
} |
878 |
|
|
879 |
for (DomNode child = first; child != null; child = child.next) |
for (DomNode child = first; child != null; child = child.next) |
917 |
return ref; |
return ref; |
918 |
} |
} |
919 |
} |
} |
920 |
throw new DomEx(DomEx.NOT_FOUND_ERR, |
throw new DomDOMException(DOMException.NOT_FOUND_ERR, |
921 |
"that's no child of mine", refChild, 0); |
"that's no child of mine", refChild, 0); |
922 |
} |
} |
923 |
catch (ClassCastException e) |
catch (ClassCastException e) |
924 |
{ |
{ |
925 |
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, |
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, |
926 |
null, refChild, 0); |
null, refChild, 0); |
927 |
} |
} |
928 |
} |
} |
929 |
|
|
1454 |
|
|
1455 |
// mouse events |
// mouse events |
1456 |
|
|
1457 |
throw new DomEx(DomEx.NOT_SUPPORTED_ERR, |
throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, |
1458 |
eventType, null, 0); |
eventType, null, 0); |
1459 |
} |
} |
1460 |
|
|
1461 |
/** |
/** |