121 Commits

Author SHA1 Message Date
Iskandar Abudiab 85cf588032 Bump version to 4.0.0 2020-07-16 20:35:56 +02:00
Iskandar Abudiab 3760c76d74 Fix new compiler warnings 2019-12-28 16:29:19 +01:00
Iskandar Abudiab 834cda2d86 Update project settings for Xcode 11 2019-12-28 16:28:44 +01:00
iska fa0201f2fc Bump HTMLKit version to 3.1.0 2019-08-20 18:19:31 +02:00
iska 153d48c19c Set iterator and range detach operations to noop
Leave the housekeeping to the NSHashTable itself, which should purge
null-references automatically (not necessarily right away)

Also update tests accordingly: Use `allObjects.count` instead of simply
`count` on the NSHashTable, since `allObjects.count` returns non-null
references.

This should fix #36
2019-08-06 21:26:21 +02:00
iska 98f7c8304f Implement a HTML Serializer
This implements the HTML Fragments Serialization according to:
https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments
2019-08-02 00:11:02 +02:00
iska 12276e91b3 Implement a HTML Tree Visitor
The tree visitor walks the DOM in tree order and calls the provided
node visitor upon entring and leaving a node.
2019-07-31 21:58:07 +02:00
iska 918c59e5ff Bump HTMLKit version to 3.0.0 2019-03-28 22:19:58 +01:00
iska 7cbfdb9c78 Introduce prefix for category methods to prevent collisions
See:
https://github.com/iabudiab/HTMLKit/issues/35
2019-03-26 23:23:08 +01:00
iska 7c2335184e Bump HTMLKit version to 2.1.5 2018-07-16 22:13:21 +02:00
iska 9dd3c70fc3 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
2018-05-10 18:41:54 +02:00
Vladimir Vlasov 7c32b5f219 Fix the issue 28 2018-05-03 19:00:29 +03:00
iska d29a70dfec Bump HTMLKit version to 2.1.4 2018-05-01 20:08:00 +02:00
iska 923e271429 Fix eq, lt & gt selectors for the zero-index case
Fixes #25
2018-04-18 23:51:39 +02:00
iska ec6d03ee57 Bump HTMLKit version to 2.1.3 2018-03-21 22:43:01 +01:00
iska b7bf9d2b04 Use HTMLOrderedDictionary when cloning element's attributes 2018-03-21 22:19:24 +01:00
Iskandar Abudiab a5599c4163 Merge pull request #23 from CRivlaldo/iterator
Fix the issue #22
2018-03-18 21:26:27 +01:00
Vladimir 70c6aee814 Fix the issue 22 2018-03-17 11:33:30 +03:00
Vladimir 7309b97b92 Fix the HTMLElement attributes copying 2018-03-17 10:40:00 +03:00
iska 16ed846e65 Bump HTMLKit version to 2.1.2 2017-11-06 22:04:57 +01:00
iska 2dfdeb22ca Fix HTMLElement attribute value serialization
Fixes #17
2017-11-06 21:58:08 +01:00
iska 135715b606 Fix HTMLText serialization
Fixes #16
2017-11-06 21:55:41 +01:00
iska f8e6a39171 Merge branch 'hotfix/2.1.1' into develop 2017-10-13 23:05:31 +02:00
iska 0921ebad8a Bump HTMLKit version to 2.1.1 2017-10-13 23:04:33 +02:00
iska 84960e71ee Enable warnings for missing function prototypes and fix present error 2017-10-13 22:54:30 +02:00
iska 7b028a2819 Enable warnings for documentation comments and fix present errors 2017-10-13 22:48:16 +02:00
iska 1101556cfe Bump HTMLKit version to 2.1.0 2017-10-12 22:44:39 +02:00
iska 9069923e82 Update handling for ParseErrorTokens in the HTML Parser 2017-10-12 22:25:46 +02:00
iska 4e1959bd81 Fix strict-prototypes blocks declarations throughout codebase 2017-09-23 02:31:48 +02:00
iska f0d9817c68 Restore default modulemap file name
Closes #13
2017-09-23 02:27:35 +02:00
iska 4a41b89ecf Update tokenizer implementation as per spec as of 2017.09.09
- Use new initial states in tests according to:
https://github.com/html5lib/html5lib-tests/pull/101

- Implement tokenization errors introduced in:
https://github.com/whatwg/html/pull/2701
https://github.com/html5lib/html5lib-tests/pull/92
2017-09-10 02:23:31 +02:00
iska d4ff2e3869 Add error-code property for ParseError token
In addition to the detailed reason message parse errors have an
error-code property that is specified in the WHATWG HTML spec.
2017-09-07 22:08:28 +02:00
iska 6dee6c1e74 Update input stream reader error handling
Use newly specified parse errors:
https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
2017-09-07 22:05:02 +02:00
iska bf655c7ea2 Bump HTMLKit version to 2.0.6 2017-05-02 15:49:08 +02:00
iska 644c180f81 Improve memory allocation/consumption in the Stack of Open Elements
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
2017-04-26 21:31:55 +02:00
iska 47ec0867a8 Improve reverseObjectEnumerator usage while parsing HTML
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
2017-04-25 00:12:39 +02:00
iska 1cd1a915d3 Replace NSStringFromSelector calls with constants in HTMLNode
This should reduce allocations during HTML parsing. See Issue #10
2017-04-24 22:58:49 +02:00
iska 8379cee44f Fix lazy allocation of childNodes Set in HTMLNode
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.
2017-04-24 22:36:02 +02:00
iska 76b379448b Bump HTMLKit version to 2.0.5 2017-04-18 23:59:57 +02:00
iska d9670cddf4 Add workaround for Xcode8.3 issue with modulemaps
This should be the fix for #12. However the issue will stay open until
tested with Xcode 8.3.1
2017-04-09 20:58:25 +02:00
iska 30389c5010 Add an autorelease pool in the Tokenizer’s iteration method 2017-04-09 20:54:01 +02:00
iska 14dfc0b854 Replace performSelector with for-loop in HTML Node methods 2017-04-09 20:53:11 +02:00
iska b693a60358 Use lazy allocation for underlying collections in HTML 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.
2017-04-09 20:52:06 +02:00
iska d35e6c4d91 Fix memory leaks in CSS Input Stream
- Release allocated instances when returning nil
- Pass autoreleased instances on valid return value
2017-04-09 20:47:55 +02:00
iska 8d3f24ef8b Bump HTMLKit version to 2.0.4 2017-04-03 22:21:15 +02:00
iska 9651d12fd0 Deprecate for old HTMLRange’s initializers with typo 2017-03-31 17:23:30 +02:00
Martin Waitz 22de41d912 Fix typo Dowcument -> Document 2017-03-31 08:53:11 +02:00
Martin Waitz bbc5467b33 [modulemap] use textual header for character definitions
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`.
2017-03-13 23:11:16 +01:00
iska a7ace9929f Bump HTMLKit version to 2.0.3 2017-03-06 00:30:41 +01:00
Martin Waitz b8f1123b86 Fix compilation for Swift 3.1
Move the `module.modulemap` into `Sources/include` and add an exclude
for `Tests/Fixtures`.
2017-03-03 08:25:14 +01:00