Remove foreign attributes adjustment

Fixes #30

Foreign attributes were handled incorrectly because attribute names
were implemented as pure strings without namespace prefix. This change
keeps the attributes as strings and eliminates any handling in regards
to namespaces.

Spec note about attributes:
"If designed today they would just have a name and value."

https://dom.spec.whatwg.org/#attr
This commit is contained in:
iska
2018-05-10 18:41:54 +02:00
parent fe2a441171
commit 9dd3c70fc3
3 changed files with 3 additions and 31 deletions
@@ -9,6 +9,7 @@
#import "HTML5LibTreeConstructionTest.h"
#import <XCTest/XCTest.h>
#import "HTMLDOM.h"
#import "HTMLDocumentType.h"
#import "HTMLElement.h"
#import "HTMLText.h"
@@ -289,6 +290,8 @@ NS_INLINE NSArray * parseAttribute(NSString *str)
NSRange range = [str rangeOfString:@"=" options:0];
NSString *key = [str substringToIndex:range.location];
key = [key stringByReplacingOccurrencesOfString:@" " withString:@":"];
NSString *value = [str substringFromIndex:range.location + 2];
value = [value substringToIndex:value.length - 1];