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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user