Add implementation for HTML Character Data methods

The data property is longer exposed as a mutable string. Instead all
manipulations must be performed via the provided API in order to ensure
correct updates for the Document’s attached ranges.

See:
https://dom.spec.whatwg.org/#characterdata
This commit is contained in:
iska
2016-11-27 20:18:12 +01:00
parent ef672e1dbb
commit 6be1bd702f
7 changed files with 112 additions and 8 deletions
+2 -2
View File
@@ -451,10 +451,10 @@
if (adjustedInsertionLocation.nodeType != HTMLNodeDocument) {
if (child != nil && child.previousSibling.nodeType == HTMLNodeText) {
HTMLText *textNode = (HTMLText *)child.previousSibling;
[textNode.data appendString:data];
[textNode appendData:data];
} else if (adjustedInsertionLocation.lastChild.nodeType == HTMLNodeText) {
HTMLText *textNode = (HTMLText *)adjustedInsertionLocation.lastChild;
[textNode.data appendString:data];
[textNode appendData:data];
} else {
HTMLText *text = [[HTMLText alloc] initWithData:data];
[adjustedInsertionLocation insertNode:text beforeChildNode:child];