Instead of allocating new dictionaries for the scope elements, the scope
checks are just unrolled in-place. Now we have 6 almost identical methods
that differ only in the inline-check-method. Not optimal but minimal
memory and performance penalty.
This should reduce memory consumption and increase the performance
while parsing, see issue #10
Do not use the `allObjects` call on the reverse enumerators in the Parser
and the List of Active Formatting Elements to prevent allocating a new
array of the unenumerated objects.
This should reduce memory consumption while parsing, see issue #10
The call self.childNodes always allocates the collection even if a nil
value is acceptable, i.e. hasChildNodes should return true even if the
childNodes Set is nil but should not allocate it yet.
Hence self.childNodes should only be used when appending child nodes.
Do not allocate empty collections for child nodes or attributes when
initializing new HTML Nodes or Elements. These are initialized the first
time they are accessed.
Analogously, the mutable data string of CharacterData is also allocated
with the empty string on first access.
Both CSSCodePoints.h and HTMLTokenizerCharacters.h define the same
symbols.
They are never included by the same compilation unit, but when they are
compiled into the same module, they create a conflict.
Fix this conflict by using `textual header`.
For now these are ignored for faster testing/iterations.
The test fixture should also be replaced with several smaller
and more representative ones, since it is relatively big.
Building and testing the project via Xcode copies the resources into
the testing bundle, which is not the case for SwiftPM. Hence the helper
method, that tries loading the resource from the bundle first. If it is
nil then the resource is loaded from the test module path directly.