diff --git a/HTMLKit.xcodeproj/project.pbxproj b/HTMLKit.xcodeproj/project.pbxproj index c796657..3f3859e 100644 --- a/HTMLKit.xcodeproj/project.pbxproj +++ b/HTMLKit.xcodeproj/project.pbxproj @@ -64,7 +64,7 @@ 62ECBEFE1C0B69FE00AF847B /* HTMLTemplate.h in Headers */ = {isa = PBXBuildFile; fileRef = 623406DF1ADB04F9004677A3 /* HTMLTemplate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62ECBEFF1C0B69FE00AF847B /* HTMLNodeIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 6247A9411B152F4F00CCF25C /* HTMLNodeIterator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62ECBF001C0B69FF00AF847B /* HTMLTreeWalker.h in Headers */ = {isa = PBXBuildFile; fileRef = 624717BA1B22009200B38302 /* HTMLTreeWalker.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 62ECBF011C0B69FF00AF847B /* HTMLNodeTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 624717161B22333200C11912 /* HTMLNodeTraversal.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 62ECBF011C0B69FF00AF847B /* HTMLNodeTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 624717161B22333200C11912 /* HTMLNodeTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; }; 62ECBF021C0B69FF00AF847B /* HTMLNodeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6247A9461B152F8C00CCF25C /* HTMLNodeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62ECBF031C0B69FF00AF847B /* HTMLKitDOMExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6238C9831AB8D6330006512E /* HTMLKitDOMExceptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62ECBF041C0B69FF00AF847B /* HTMLNamespaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 628B7CE61A080E1000602C87 /* HTMLNamespaces.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -211,7 +211,7 @@ 62ECBFAE1C0B6D3B00AF847B /* HTMLTemplate.h in Headers */ = {isa = PBXBuildFile; fileRef = 623406DF1ADB04F9004677A3 /* HTMLTemplate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62ECBFAF1C0B6D3B00AF847B /* HTMLNodeIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 6247A9411B152F4F00CCF25C /* HTMLNodeIterator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62ECBFB01C0B6D3C00AF847B /* HTMLTreeWalker.h in Headers */ = {isa = PBXBuildFile; fileRef = 624717BA1B22009200B38302 /* HTMLTreeWalker.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 62ECBFB11C0B6D3C00AF847B /* HTMLNodeTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 624717161B22333200C11912 /* HTMLNodeTraversal.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 62ECBFB11C0B6D3C00AF847B /* HTMLNodeTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 624717161B22333200C11912 /* HTMLNodeTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; }; 62ECBFB21C0B6D3C00AF847B /* HTMLNodeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 6247A9461B152F8C00CCF25C /* HTMLNodeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62ECBFB31C0B6D3C00AF847B /* HTMLKitDOMExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6238C9831AB8D6330006512E /* HTMLKitDOMExceptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62ECBFB41C0B6D3D00AF847B /* HTMLNamespaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 628B7CE61A080E1000602C87 /* HTMLNamespaces.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1530,6 +1530,7 @@ 62ECBF601C0B6C7600AF847B /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 62ECBF611C0B6C7600AF847B /* Build configuration list for PBXNativeTarget "HTMLKitTests-iOS" */ = { isa = XCConfigurationList; @@ -1538,6 +1539,7 @@ 62ECBF631C0B6C7600AF847B /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/HTMLKit/CSSNthExpressionParser.h b/HTMLKit/CSSNthExpressionParser.h index e484bab..5323282 100644 --- a/HTMLKit/CSSNthExpressionParser.h +++ b/HTMLKit/CSSNthExpressionParser.h @@ -9,8 +9,12 @@ #import #import "CSSSelectors.h" +NS_ASSUME_NONNULL_BEGIN + @interface CSSNthExpressionParser : NSObject + (CSSNthExpression)parseExpression:(NSString *)expression; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/CSSSelector.h b/HTMLKit/CSSSelector.h index a4f8a58..6c88c6e 100644 --- a/HTMLKit/CSSSelector.h +++ b/HTMLKit/CSSSelector.h @@ -8,6 +8,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + #pragma mark - Attribute Selector Type typedef NS_ENUM(NSUInteger, CSSAttributeSelectorType) @@ -48,3 +50,5 @@ extern NSString * _Nonnull NSStringFromNthExpression(CSSNthExpression expression - (BOOL)acceptElement:(HTMLElement *)element; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/CSSSelectorParser.h b/HTMLKit/CSSSelectorParser.h index 1d55788..3f4fca4 100644 --- a/HTMLKit/CSSSelectorParser.h +++ b/HTMLKit/CSSSelectorParser.h @@ -8,6 +8,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + @class CSSSelector; @interface CSSSelectorParser : NSObject @@ -15,3 +17,5 @@ + (CSSSelector *)parseSelector:(NSString *)string error:(NSError **)error; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLComment.h b/HTMLKit/HTMLComment.h index 100f13c..d26994e 100644 --- a/HTMLKit/HTMLComment.h +++ b/HTMLKit/HTMLComment.h @@ -8,6 +8,8 @@ #import "HTMLNode.h" +NS_ASSUME_NONNULL_BEGIN + @interface HTMLComment : HTMLNode @property (nonatomic, copy) NSString *data; @@ -15,3 +17,5 @@ - (instancetype)initWithData:(NSString *)data; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLComment.m b/HTMLKit/HTMLComment.m index dbe2ac4..fd3dbc8 100644 --- a/HTMLKit/HTMLComment.m +++ b/HTMLKit/HTMLComment.m @@ -12,7 +12,7 @@ - (instancetype)init { - return [self initWithData:nil]; + return [self initWithData:@""]; } - (instancetype)initWithData:(NSString *)data diff --git a/HTMLKit/HTMLDocument.h b/HTMLKit/HTMLDocument.h index f8a0485..16afd65 100644 --- a/HTMLKit/HTMLDocument.h +++ b/HTMLKit/HTMLDocument.h @@ -10,6 +10,8 @@ #import "HTMLDocumentType.h" #import "HTMLQuirksMode.h" +NS_ASSUME_NONNULL_BEGIN + typedef NS_ENUM(short, HTMLDocumentReadyState) { HTMLDocumentLoading, @@ -19,7 +21,7 @@ typedef NS_ENUM(short, HTMLDocumentReadyState) @interface HTMLDocument : HTMLNode -@property (nonatomic, strong) HTMLDocumentType *documentType; +@property (nonatomic, strong, nullable) HTMLDocumentType *documentType; @property (nonatomic, assign) HTMLQuirksMode quirksMode; @@ -27,13 +29,13 @@ typedef NS_ENUM(short, HTMLDocumentReadyState) @property (nonatomic, assign, readonly) HTMLDocumentReadyState readyState; -@property (nonatomic, strong) HTMLElement *rootElement; +@property (nonatomic, strong, nullable) HTMLElement *rootElement; -@property (nonatomic, strong) HTMLElement *documentElement; +@property (nonatomic, strong, nullable) HTMLElement *documentElement; -@property (nonatomic, strong) HTMLElement *head; +@property (nonatomic, strong, nullable) HTMLElement *head; -@property (nonatomic, strong) HTMLElement *body; +@property (nonatomic, strong, nullable) HTMLElement *body; + (instancetype)documentWithString:(NSString *)string; @@ -42,3 +44,5 @@ typedef NS_ENUM(short, HTMLDocumentReadyState) - (HTMLDocument *)associatedInertTemplateDocument; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLDocumentFragment.h b/HTMLKit/HTMLDocumentFragment.h index 270c573..a583023 100644 --- a/HTMLKit/HTMLDocumentFragment.h +++ b/HTMLKit/HTMLDocumentFragment.h @@ -8,8 +8,12 @@ #import "HTMLNode.h" +NS_ASSUME_NONNULL_BEGIN + @interface HTMLDocumentFragment : HTMLNode -- (instancetype)initWithDocument:(HTMLDocument *)document; +- (instancetype)initWithDocument:(nullable HTMLDocument *)document; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLDocumentType.h b/HTMLKit/HTMLDocumentType.h index d872730..c9999a1 100644 --- a/HTMLKit/HTMLDocumentType.h +++ b/HTMLKit/HTMLDocumentType.h @@ -9,6 +9,8 @@ #import "HTMLNode.h" #import "HTMLQuirksMode.h" +NS_ASSUME_NONNULL_BEGIN + @interface HTMLDocumentType : HTMLNode @property (nonatomic, copy, readonly) NSString *publicIdentifier; @@ -16,10 +18,12 @@ @property (nonatomic, copy, readonly) NSString *systemIdentifier; - (instancetype)initWithName:(NSString *)name - publicIdentifier:(NSString *)publicIdentifier - systemIdentifier:(NSString *)systemIdentifier; + publicIdentifier:(nullable NSString *)publicIdentifier + systemIdentifier:(nullable NSString *)systemIdentifier; - (BOOL)isValid; - (HTMLQuirksMode)quirksMode; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLElement.h b/HTMLKit/HTMLElement.h index 6343516..a4c88ec 100644 --- a/HTMLKit/HTMLElement.h +++ b/HTMLKit/HTMLElement.h @@ -10,6 +10,8 @@ #import "HTMLNamespaces.h" #import "HTMLNode.h" +NS_ASSUME_NONNULL_BEGIN + @interface HTMLElement : HTMLNode @property (nonatomic, assign, readonly) HTMLNamespace htmlNamespace; @@ -27,8 +29,10 @@ - (instancetype)initWithTagName:(NSString *)tagName namespace:(HTMLNamespace)htmlNamespace attributes:(NSDictionary *)attributes; - (BOOL)hasAttribute:(NSString *)name; -- (NSString *)objectForKeyedSubscript:(NSString *)name; +- (nullable NSString *)objectForKeyedSubscript:(NSString *)name; - (void)setObject:(NSString *)value forKeyedSubscript:(NSString *)attribute; - (void)removeAttribute:(NSString *)name; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLElement.m b/HTMLKit/HTMLElement.m index 9ebc3ad..5a8861c 100644 --- a/HTMLKit/HTMLElement.m +++ b/HTMLKit/HTMLElement.m @@ -26,12 +26,12 @@ - (instancetype)init { - return [self initWithTagName:nil]; + return [self initWithTagName:@""]; } - (instancetype)initWithTagName:(NSString *)tagName { - return [self initWithTagName:tagName attributes:nil]; + return [self initWithTagName:tagName attributes:@{}]; } - (instancetype)initWithTagName:(NSString *)tagName attributes:(NSDictionary *)attributes diff --git a/HTMLKit/HTMLNode.h b/HTMLKit/HTMLNode.h index e5fac40..5b7c2ec 100644 --- a/HTMLKit/HTMLNode.h +++ b/HTMLKit/HTMLNode.h @@ -9,6 +9,8 @@ #import #import "HTMLNodeIterator.h" +NS_ASSUME_NONNULL_BEGIN + typedef NS_ENUM(short, HTMLNodeType) { HTMLNodeElement = 1, @@ -102,7 +104,7 @@ typedef NS_ENUM(unsigned short, HTMLDocumentPosition) - (void)appendNodes:(NSArray *)nodes; -- (HTMLNode *)insertNode:(HTMLNode *)node beforeChildNode:(HTMLNode *)child; +- (HTMLNode *)insertNode:(HTMLNode *)node beforeChildNode:(nullable HTMLNode *)child; - (HTMLNode *)replaceChildNode:(HTMLNode *)node withNode:(HTMLNode *)replacement; @@ -128,13 +130,18 @@ typedef NS_ENUM(unsigned short, HTMLDocumentPosition) - (HTMLNodeIterator *)nodeIterator; - (HTMLNodeIterator *)nodeIteratorWithShowOptions:(HTMLNodeFilterShowOptions)showOptions - filter:(id)filter; + filter:(nullable id)filter; - (HTMLNodeIterator *)nodeIteratorWithShowOptions:(HTMLNodeFilterShowOptions)showOptions filterBlock:(HTMLNodeFilterValue (^)(HTMLNode *node))filter; -- (HTMLElement *)firstElementMatchingSelector:(CSSSelector *)selector; +- (nullable HTMLElement *)querySelector:(NSString *)selector; +- (NSArray *)querySelectorAll:(NSString *)selector; + +- (nullable HTMLElement *)firstElementMatchingSelector:(CSSSelector *)selector; - (NSArray *)elementsMatchingSelector:(CSSSelector *)selector; - (NSString *)treeDescription; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLNodeFilter.h b/HTMLKit/HTMLNodeFilter.h index 3046762..e90cd86 100644 --- a/HTMLKit/HTMLNodeFilter.h +++ b/HTMLKit/HTMLNodeFilter.h @@ -8,6 +8,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + typedef NS_ENUM(unsigned short, HTMLNodeFilterValue) { HTMLNodeFilterAccept = 1, @@ -54,3 +56,5 @@ typedef NS_OPTIONS(unsigned long, HTMLNodeFilterShowOptions) + (instancetype)filterWithSelector:(CSSSelector *)selector; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLNodeIterator.h b/HTMLKit/HTMLNodeIterator.h index 6dd269e..f8af8a6 100644 --- a/HTMLKit/HTMLNodeIterator.h +++ b/HTMLKit/HTMLNodeIterator.h @@ -9,6 +9,8 @@ #import #import "HTMLNodeFilter.h" +NS_ASSUME_NONNULL_BEGIN + @class HTMLNode; @interface HTMLNodeIterator : NSEnumerator @@ -21,16 +23,18 @@ + (instancetype)iteratorWithNode:(HTMLNode *)node showOptions:(HTMLNodeFilterShowOptions)showOptions - filter:(HTMLNodeFilterValue (^)(HTMLNode *node))filter; + filter:(nullable HTMLNodeFilterValue (^)(HTMLNode *node))filter; - (instancetype)initWithNode:(HTMLNode *)node; - (instancetype)initWithNode:(HTMLNode *)node - filter:(id)filter; + filter:(nullable id)filter; - (instancetype)initWithNode:(HTMLNode *)node showOptions:(HTMLNodeFilterShowOptions)showOptions - filter:(id)filter; + filter:(nullable id)filter; -- (HTMLNode *)nextNode; -- (HTMLNode *)previousNode; +- (nullable HTMLNode *)nextNode; +- (nullable HTMLNode *)previousNode; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLParser.h b/HTMLKit/HTMLParser.h index 5f29bfa..2607919 100644 --- a/HTMLKit/HTMLParser.h +++ b/HTMLKit/HTMLParser.h @@ -9,6 +9,8 @@ #import #import "HTMLElement.h" +NS_ASSUME_NONNULL_BEGIN + @interface HTMLParser : NSObject @property (nonatomic, strong, readonly) NSArray *parseErrors; @@ -20,3 +22,5 @@ - (NSArray *)parseFragmentWithContextElement:(HTMLElement *)contextElement; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLTemplate.h b/HTMLKit/HTMLTemplate.h index 454e903..be97aee 100644 --- a/HTMLKit/HTMLTemplate.h +++ b/HTMLKit/HTMLTemplate.h @@ -9,8 +9,12 @@ #import "HTMLElement.h" #import "HTMLDocumentFragment.h" +NS_ASSUME_NONNULL_BEGIN + @interface HTMLTemplate : HTMLElement @property (nonatomic, strong) HTMLDocumentFragment *content; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLText.h b/HTMLKit/HTMLText.h index fcc6075..283a625 100644 --- a/HTMLKit/HTMLText.h +++ b/HTMLKit/HTMLText.h @@ -8,6 +8,8 @@ #import "HTMLNode.h" +NS_ASSUME_NONNULL_BEGIN + @interface HTMLText : HTMLNode @property (nonatomic, copy) NSMutableString *data; @@ -17,3 +19,5 @@ - (void)appendString:(NSString *)string; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/HTMLTreeWalker.h b/HTMLKit/HTMLTreeWalker.h index fff2328..ac425c6 100644 --- a/HTMLKit/HTMLTreeWalker.h +++ b/HTMLKit/HTMLTreeWalker.h @@ -9,28 +9,32 @@ #import #import "HTMLNodeFilter.h" +NS_ASSUME_NONNULL_BEGIN + @class HTMLNode; @interface HTMLTreeWalker : NSObject @property (nonatomic, strong, readonly) HTMLNode *root; @property (nonatomic, assign, readonly) HTMLNodeFilterShowOptions whatToShow; -@property (nonatomic, strong, readonly) id filter; +@property (nonatomic, strong, readonly, nullable) id filter; @property (nonatomic, strong) HTMLNode *currentNode; - (instancetype)initWithNode:(HTMLNode *)node; - (instancetype)initWithNode:(HTMLNode *)node - filter:(id)filter; + filter:(nullable id)filter; - (instancetype)initWithNode:(HTMLNode *)node showOptions:(HTMLNodeFilterShowOptions)showOptions - filter:(id)filter; + filter:(nullable id)filter; -- (HTMLNode *)parentNode; -- (HTMLNode *)firstChild; -- (HTMLNode *)lastChild; -- (HTMLNode *)previousSibling; -- (HTMLNode *)nextSibling; -- (HTMLNode *)previousNode; -- (HTMLNode *)nextNode; +- (nullable HTMLNode *)parentNode; +- (nullable HTMLNode *)firstChild; +- (nullable HTMLNode *)lastChild; +- (nullable HTMLNode *)previousSibling; +- (nullable HTMLNode *)nextSibling; +- (nullable HTMLNode *)previousNode; +- (nullable HTMLNode *)nextNode; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/NSCharacterSet+HTMLKit.h b/HTMLKit/NSCharacterSet+HTMLKit.h index 59dd2c7..2403c1d 100644 --- a/HTMLKit/NSCharacterSet+HTMLKit.h +++ b/HTMLKit/NSCharacterSet+HTMLKit.h @@ -8,6 +8,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface NSCharacterSet (HTMLKit) + (instancetype)HTMLWhitespaceCharacterSet; @@ -15,3 +17,5 @@ + (instancetype)CSSNthExpressionCharacterSet; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKit/NSString+HTMLKit.h b/HTMLKit/NSString+HTMLKit.h index 52b3de0..0c7b4fe 100644 --- a/HTMLKit/NSString+HTMLKit.h +++ b/HTMLKit/NSString+HTMLKit.h @@ -8,6 +8,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface NSString (HTMLKit) - (BOOL)isEqualToStringIgnoringCase:(NSString *)aString; @@ -17,3 +19,5 @@ - (NSUInteger)leadingHTMLWhitespaceLength; @end + +NS_ASSUME_NONNULL_END diff --git a/HTMLKitTests/CSSTypeSelectorTests.m b/HTMLKitTests/CSSTypeSelectorTests.m index 58b26a8..4f0dde4 100644 --- a/HTMLKitTests/CSSTypeSelectorTests.m +++ b/HTMLKitTests/CSSTypeSelectorTests.m @@ -21,7 +21,6 @@ { CSSSelector *selector = universalSelector(); - XCTAssertEqual([selector acceptElement:[[HTMLElement alloc] initWithTagName:nil]], YES); XCTAssertEqual([selector acceptElement:[[HTMLElement alloc] initWithTagName:@""]], YES); XCTAssertEqual([selector acceptElement:[[HTMLElement alloc] initWithTagName:@"div"]], YES); XCTAssertEqual([selector acceptElement:[[HTMLElement alloc] initWithTagName:@"p"]], YES); @@ -32,7 +31,6 @@ { CSSSelector *selector = typeSelector(@"div"); - XCTAssertEqual([selector acceptElement:[[HTMLElement alloc] initWithTagName:nil]], NO); XCTAssertEqual([selector acceptElement:[[HTMLElement alloc] initWithTagName:@""]], NO); XCTAssertEqual([selector acceptElement:[[HTMLElement alloc] initWithTagName:@"p"]], NO); XCTAssertEqual([selector acceptElement:[[HTMLElement alloc] initWithTagName:@"any other name"]], NO); diff --git a/HTMLKitTests/HTML5LibTreeConstructionTest.m b/HTMLKitTests/HTML5LibTreeConstructionTest.m index 9d0a45c..a10dc22 100644 --- a/HTMLKitTests/HTML5LibTreeConstructionTest.m +++ b/HTMLKitTests/HTML5LibTreeConstructionTest.m @@ -110,7 +110,7 @@ static NSString * const TreeConstruction = @"tree-construction"; fragment = [fragment substringFromIndex:@"svg ".length]; namespace = HTMLNamespaceSVG; } - test.documentFragment = [[HTMLElement alloc] initWithTagName:fragment namespace:namespace attributes:nil]; + test.documentFragment = [[HTMLElement alloc] initWithTagName:fragment namespace:namespace attributes:@{}]; } else if ([match hasPrefix:@"#document\n"]) { NSArray *parts = [[match substringFromIndex:@"#document\n".length] componentsSeparatedByString:@"| "]; NSArray *nodes = [HTML5LibTreeConstructionTest parseDocument:parts]; @@ -244,7 +244,7 @@ NS_INLINE HTMLElement * parseTag(NSString *str) NSString *tagName = parts.count == 2 ? parts[1] : parts[0]; HTMLNamespace namespace = parts.count == 1 ? HTMLNamespaceHTML : ([parts[0] isEqualToString:@"math"] ? HTMLNamespaceMathML : HTMLNamespaceSVG); - HTMLElement *element = [[HTMLElement alloc] initWithTagName:tagName namespace:namespace attributes:nil]; + HTMLElement *element = [[HTMLElement alloc] initWithTagName:tagName namespace:namespace attributes:@{}]; return element; }