Compare commits
132 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d756fc4298 | |||
| 7c2335184e | |||
| 0c6084ba73 | |||
| 5201860073 | |||
| cf21b88eb1 | |||
| 7617fceff1 | |||
| 9dd3c70fc3 | |||
| fe2a441171 | |||
| 7c32b5f219 | |||
| bf0d8560b0 | |||
| ebc6f7a097 | |||
| d29a70dfec | |||
| b8f56ca97d | |||
| 0f954d5d56 | |||
| ac5089d69b | |||
| c9c36397e0 | |||
| 923e271429 | |||
| 8546168324 | |||
| da765169fa | |||
| ec6d03ee57 | |||
| 7944549bd7 | |||
| bb6a97984b | |||
| 0aff9cf787 | |||
| b7bf9d2b04 | |||
| 12af838fa2 | |||
| 14b8b5390f | |||
| a5599c4163 | |||
| c0ac25645d | |||
| fa431550d7 | |||
| 70c6aee814 | |||
| 7309b97b92 | |||
| 7ffb8e5ca0 | |||
| 682b19c242 | |||
| 16ed846e65 | |||
| 820b3ef091 | |||
| fb7ea25b1f | |||
| 5302c16600 | |||
| 2dfdeb22ca | |||
| 135715b606 | |||
| f8e6a39171 | |||
| 20cf2dc4d0 | |||
| 0921ebad8a | |||
| c63e2cb8fd | |||
| 3deeb0138f | |||
| b358a08f30 | |||
| 84960e71ee | |||
| 7b028a2819 | |||
| 5aa77eac9b | |||
| c1cd1c0831 | |||
| 1101556cfe | |||
| 839a724432 | |||
| 300705cb63 | |||
| 1963c010f9 | |||
| 89ef6bc101 | |||
| 9069923e82 | |||
| c16c647394 | |||
| 27b8eaac67 | |||
| 956c46ec45 | |||
| cb7e5d519d | |||
| 4e1959bd81 | |||
| f0d9817c68 | |||
| fee2d14ffc | |||
| 4291840a53 | |||
| 4b7c260738 | |||
| 4a41b89ecf | |||
| d4ff2e3869 | |||
| 6dee6c1e74 | |||
| 20ebd8c603 | |||
| c002299247 | |||
| bb6d7ccc67 | |||
| bf655c7ea2 | |||
| 6cd03b4eed | |||
| cc0734e470 | |||
| eca6098361 | |||
| 2cd5098d8a | |||
| 514d23f7a0 | |||
| 2446da3a6d | |||
| 644c180f81 | |||
| 47ec0867a8 | |||
| 1cd1a915d3 | |||
| 8379cee44f | |||
| 4094f51458 | |||
| 57c931aece | |||
| 76b379448b | |||
| 49bdfa018e | |||
| 746ef2ea3b | |||
| 653f6cdf7e | |||
| d9670cddf4 | |||
| 30389c5010 | |||
| 14dfc0b854 | |||
| b693a60358 | |||
| d35e6c4d91 | |||
| c353512a65 | |||
| aaee85909b | |||
| 8d3f24ef8b | |||
| b652935739 | |||
| 601c83a51f | |||
| 774ac35bbb | |||
| 9651d12fd0 | |||
| 0899a4013d | |||
| 22de41d912 | |||
| 2f47e733bd | |||
| 36f5df015a | |||
| bbc5467b33 | |||
| 7ef19f5e20 | |||
| a102f5cd7d | |||
| 7a40e8bafd | |||
| 40b057b569 | |||
| a7ace9929f | |||
| 32b674f786 | |||
| e9e3f04136 | |||
| 44f1bc6946 | |||
| ef36e674a4 | |||
| b8f1123b86 | |||
| 17a2e375e0 | |||
| b5470a61c3 | |||
| fb60759492 | |||
| f21cbf2a5e | |||
| 50c48e589a | |||
| bb9987636b | |||
| 60b086f72e | |||
| f1fd0f3ef6 | |||
| 5bb7122d7e | |||
| 356709a096 | |||
| 963a2b9c09 | |||
| 9926179a62 | |||
| cb9886cbf7 | |||
| 717f62a5f1 | |||
| f5476e0c4c | |||
| b9099a26ed | |||
| b57e27137a | |||
| 17961b94a4 |
@@ -0,0 +1,5 @@
|
||||
codecov:
|
||||
branch: develop
|
||||
|
||||
ignore:
|
||||
- "Tests/"
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
module: HTMLKit
|
||||
module_version: 2.0.0
|
||||
module_version: 2.1.5
|
||||
author: Iskandar Abudiab
|
||||
author_url: https://twitter.com/iabudiab
|
||||
github_url: https://github.com/iabudiab/HTMLKit
|
||||
|
||||
+18
-18
@@ -1,5 +1,5 @@
|
||||
language: objective-c
|
||||
osx_image: xcode8.2
|
||||
osx_image: xcode9
|
||||
|
||||
branches:
|
||||
except:
|
||||
@@ -17,29 +17,29 @@ env:
|
||||
- MACOS_FRAMEWORK_SCHEME=HTMLKit-macOS
|
||||
- WATCHOS_FRAMEWORK_SCHEME="HTMLKit-watchOS"
|
||||
- TVOS_FRAMEWORK_SCHEME="HTMLKit-tvOS"
|
||||
- IOS_SDK=iphonesimulator10.2
|
||||
- MACOS_SDK=macosx10.12
|
||||
- WATCHOS_SDK=watchsimulator3.1
|
||||
- TVOS_SDK=appletvsimulator10.1
|
||||
- IOS_SDK=iphonesimulator11.0
|
||||
- MACOS_SDK=macosx10.13
|
||||
- WATCHOS_SDK=watchsimulator4.0
|
||||
- TVOS_SDK=appletvsimulator11.0
|
||||
matrix:
|
||||
- DESTINATION="arch=x86_64" SIMULATOR="" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"
|
||||
- DESTINATION="OS=9.0,name=iPhone 6" SIMULATOR="iPhone 6 (9.0)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
|
||||
- DESTINATION="OS=9.1,name=iPhone 6 Plus" SIMULATOR="iPhone 6 Plus (9.1)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
|
||||
- DESTINATION="OS=9.2,name=iPhone 6S" SIMULATOR="iPhone 6S (9.2)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
|
||||
- DESTINATION="OS=9.3,name=iPhone 6S Plus" SIMULATOR="iPhone 6S Plus (9.3)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
|
||||
- DESTINATION="OS=10.1,name=iPhone 7 Plus" SIMULATOR="iPhone 7 Plus (10.1)" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
|
||||
- DESTINATION="OS=2.2,name=Apple Watch - 42mm" SIMULATOR="Apple Watch - 42mm (2.2)" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK"
|
||||
- DESTINATION="OS=3.1,name=Apple Watch Series 2 - 42mm" SIMULATOR="Apple Watch Series 2 - 42mm (3.1)" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK"
|
||||
- DESTINATION="OS=9.0,name=Apple TV 1080p" SIMULATOR="Apple TV 1080p (9.2)" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK"
|
||||
- DESTINATION="OS=10.0,name=Apple TV 1080p" SIMULATOR="Apple TV 1080p (10.0)" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK"
|
||||
- DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"
|
||||
- DESTINATION="OS=9.3,name=iPhone 6s Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
|
||||
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
|
||||
- DESTINATION="OS=11.0,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
|
||||
- DESTINATION="OS=3.2,name=Apple Watch Series 2 - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK"
|
||||
- DESTINATION="OS=4.0,name=Apple Watch Series 3 - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK"
|
||||
- DESTINATION="OS=10.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK"
|
||||
- DESTINATION="OS=11.0,name=Apple TV 4K" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK"
|
||||
|
||||
script:
|
||||
- set -o pipefail
|
||||
- xcodebuild -version
|
||||
- xcodebuild -showsdks
|
||||
- SIMULATOR_ID=$(xcrun instruments -s devices | grep -io "$SIMULATOR \[.*\]" | grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$/\1/")
|
||||
- open -b com.apple.iphonesimulator --args -CurrentDeviceUDID $SIMULATOR_ID
|
||||
- travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO clean build | xcpretty -c
|
||||
- if [ "$SDK" != "$WATCHOS_SDK" ]; then
|
||||
travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c;
|
||||
travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES test | xcpretty -c;
|
||||
fi
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
|
||||
+143
@@ -1,5 +1,148 @@
|
||||
# Change Log
|
||||
|
||||
## [2.1.5](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.5)
|
||||
|
||||
Released on 2018.07.16
|
||||
|
||||
### Fixes
|
||||
|
||||
- Parser would handle foreign attributes incorrectly (issue #30)
|
||||
|
||||
|
||||
## [2.1.4](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.4)
|
||||
|
||||
Released on 2018.05.01
|
||||
|
||||
### Fixes
|
||||
|
||||
- `gt(n)`, `lt(n)` and `eq(n)` selectors would select wrong elements for the zero-index (issue #25)
|
||||
|
||||
|
||||
## [2.1.3](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.3)
|
||||
|
||||
Released on 2018.03.21
|
||||
|
||||
### Fixes
|
||||
|
||||
- `HTMLElement` clone would return an immutable dictionary for attributes (issue #20)
|
||||
- Fixed by @CRivlaldo in PR #24
|
||||
- `HTMLNodeFilterBlock` would behave differently on simulator and device (issue #22)
|
||||
- Fixed by @CRivlaldo in PR #23
|
||||
|
||||
|
||||
## [2.1.2](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.2)
|
||||
|
||||
Released on 2017.11.6
|
||||
|
||||
### Fixes
|
||||
|
||||
- `HTMLText` serialization (issue #16)
|
||||
- `HTMLElement` attribute value serialization (issue #17)
|
||||
|
||||
|
||||
## [2.1.1](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.1)
|
||||
|
||||
Released on 2017.10.13
|
||||
|
||||
### Hotfix
|
||||
|
||||
- Fixed documentation comments
|
||||
- Should fix CocoaDocs generation and percentage
|
||||
|
||||
|
||||
## [2.1.0](https://github.com/iabudiab/HTMLKit/releases/tag/2.1.0)
|
||||
|
||||
Released on 2017.10.12
|
||||
|
||||
### Added
|
||||
|
||||
- Standarized tokenizer error codes:
|
||||
- [whatwg/html#2701](https://github.com/whatwg/html/pull/2701)
|
||||
- [html5lib/html5lib-tests#92](https://github.com/html5lib/html5lib-tests/pull/92)
|
||||
|
||||
### Updated
|
||||
|
||||
- Project for Xcode 9
|
||||
- Travis config for iOS 11.0, macOS 10.13, tvOS 11.0 and watchOS 4.0
|
||||
- Updated HTML5Lib-Tests submodule (cbafeba)
|
||||
|
||||
## [2.0.6](https://github.com/iabudiab/HTMLKit/releases/tag/2.0.6)
|
||||
|
||||
Released on 2017.05.02
|
||||
|
||||
### Added
|
||||
|
||||
- Memory consumption improvements (issue #10)
|
||||
- Allocate `childNodes` collection in `HTMLNode` only when inserting child nodes
|
||||
- Replace `NSStringFromSelector` calls with constants in `HTMLNode` validations
|
||||
- Improve `reverseObjectEnumerator` usage while parsing HTML
|
||||
- Rewrite internal logic of the `HTMLStackOfOpenElements` to prevent excessive allocations
|
||||
|
||||
|
||||
## [2.0.5](https://github.com/iabudiab/HTMLKit/releases/tag/2.0.5)
|
||||
|
||||
Released on 2017.04.19
|
||||
|
||||
### Fixed
|
||||
|
||||
- Xcode 8.3 issue with modulemaps
|
||||
- Temporary workaround (renamed modulemap file)
|
||||
- Memory Leaks in `CSSInputStream`
|
||||
|
||||
### Added
|
||||
|
||||
- Minor memory consumption improvements
|
||||
- Collections for child nodes or attributes of HTML Nodes or Elements are allocated lazily
|
||||
- Underyling data string of `CharacterData` is allocated on first access
|
||||
- Autorelease pool for the main `HTMLTokenizer` loop
|
||||
|
||||
|
||||
## [2.0.4](https://github.com/iabudiab/HTMLKit/releases/tag/2.0.4)
|
||||
|
||||
Released on 2017.04.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- Testing with Swift 3.1
|
||||
- Fixed by @tali in PR #8
|
||||
|
||||
### Deprecated
|
||||
|
||||
- `HTMLRange` initializers with typo
|
||||
- `initWithDowcument:startContainer:startOffset:endContainer:endOffset:`
|
||||
|
||||
|
||||
## [2.0.3](https://github.com/iabudiab/HTMLKit/releases/tag/2.0.3)
|
||||
|
||||
Released on 2017.03.6
|
||||
|
||||
### Fixed
|
||||
|
||||
- Compilation for Swift 3.1
|
||||
- Fixed by @tali in PR #6
|
||||
|
||||
|
||||
## [2.0.2](https://github.com/iabudiab/HTMLKit/releases/tag/2.0.2)
|
||||
|
||||
Released on 2017.02.26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Retain cycles in `HTMLNodeIterator` (issue #4)
|
||||
- Retain cycles in `HTMLRange` (issue #5)
|
||||
- The layout of `HTMLKit` tests module for Swift Package Manager
|
||||
|
||||
|
||||
## [2.0.1](https://github.com/iabudiab/HTMLKit/releases/tag/2.0.1)
|
||||
|
||||
Released on 2017.02.20
|
||||
|
||||
### Hotifx
|
||||
|
||||
- Set `INSTALL_PATH` and `DYLIB_INSTALL_NAME_BASE` to `@rpath` for macOS target
|
||||
- This fixes embedding `HTMLKit` in a Cocoa application
|
||||
|
||||
|
||||
## [2.0.0](https://github.com/iabudiab/HTMLKit/releases/tag/2.0.0)
|
||||
|
||||
Released on 2017.02.11
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0800;
|
||||
LastUpgradeCheck = 0800;
|
||||
LastUpgradeCheck = 0900;
|
||||
ORGANIZATIONNAME = iabudiab;
|
||||
TargetAttributes = {
|
||||
629A63C81D9AFE0E0089679F = {
|
||||
@@ -136,7 +136,9 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
@@ -144,7 +146,12 @@
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
@@ -184,7 +191,9 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
@@ -192,7 +201,12 @@
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
@@ -212,6 +226,7 @@
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -250,6 +265,7 @@
|
||||
629A63D21D9AFE0E0089679F /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
@@ -45,6 +46,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "HTMLKit"
|
||||
s.version = "2.0.0"
|
||||
s.version = "2.1.5"
|
||||
s.summary = "HTMLKit, an Objective-C framework for your everyday HTML needs."
|
||||
s.license = "MIT"
|
||||
s.homepage = "https://github.com/iabudiab/HTMLKit"
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
62056C501E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 62056C4E1E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
62056C511E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 62056C4E1E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
62056C521E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 62056C4E1E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
620AB7B12087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */ = {isa = PBXBuildFile; fileRef = 620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */; };
|
||||
620AB7B22087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */ = {isa = PBXBuildFile; fileRef = 620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */; };
|
||||
620AB7B32087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */ = {isa = PBXBuildFile; fileRef = 620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */; };
|
||||
62132E5A1C01F83200084175 /* CSSSelectorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 62132E581C01F83200084175 /* CSSSelectorTest.m */; };
|
||||
62132E5D1C021FF200084175 /* css-tests in Resources */ = {isa = PBXBuildFile; fileRef = 62132E5B1C021FF200084175 /* css-tests */; };
|
||||
6216ACFD1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6216ACFC1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m */; };
|
||||
@@ -35,7 +38,6 @@
|
||||
624AB31B1B050A4D00F3830D /* CSSAttributeSelectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 624AB3191B050A4D00F3830D /* CSSAttributeSelectorTests.m */; };
|
||||
624AC90219FBF9ED00BD3C4A /* HTMLKitTokenizerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 624AC90019FBF9ED00BD3C4A /* HTMLKitTokenizerTests.m */; };
|
||||
624AC90519FBFE9A00BD3C4A /* html5lib-tests in Resources */ = {isa = PBXBuildFile; fileRef = 624AC90419FBFE8A00BD3C4A /* html5lib-tests */; };
|
||||
624AC90F19FC702E00BD3C4A /* HTML Standard.html in Resources */ = {isa = PBXBuildFile; fileRef = 624AC90D19FC702E00BD3C4A /* HTML Standard.html */; };
|
||||
624B9FB31AE0313300646C4C /* HTMLStringCategoryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 624B9FB11AE0313300646C4C /* HTMLStringCategoryTests.m */; };
|
||||
624B9FB61AE0391400646C4C /* HTMLOrderedDictionaryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 624B9FB41AE0391400646C4C /* HTMLOrderedDictionaryTests.m */; };
|
||||
624C777A1DE9D05E00DD6DFA /* HTMLCharacterData.h in Headers */ = {isa = PBXBuildFile; fileRef = 624C77781DE9D05E00DD6DFA /* HTMLCharacterData.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -247,7 +249,6 @@
|
||||
62857D431D39A34B008DC254 /* HTMLKitTestObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 625EE4561CBAA41D00F2CC8E /* HTMLKitTestObserver.m */; };
|
||||
62857D441D39A34D008DC254 /* HTMLKitTestUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 625EE45A1CBB171300F2CC8E /* HTMLKitTestUtil.m */; };
|
||||
62857D451D39A353008DC254 /* css-tests in Resources */ = {isa = PBXBuildFile; fileRef = 62132E5B1C021FF200084175 /* css-tests */; };
|
||||
62857D461D39A3D7008DC254 /* HTML Standard.html in Resources */ = {isa = PBXBuildFile; fileRef = 624AC90D19FC702E00BD3C4A /* HTML Standard.html */; };
|
||||
62857D471D39A3E4008DC254 /* html5lib-tests in Resources */ = {isa = PBXBuildFile; fileRef = 624AC90419FBFE8A00BD3C4A /* html5lib-tests */; };
|
||||
62857D491D39A3F4008DC254 /* HTMLKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 625A14BC19C7829400AD0C32 /* HTMLKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
62857D4A1D39A3F4008DC254 /* HTMLKitErrorDomain.h in Headers */ = {isa = PBXBuildFile; fileRef = 626652F81C03D30F00C3F121 /* HTMLKitErrorDomain.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -308,6 +309,12 @@
|
||||
62857D8F1D39A47F008DC254 /* CSSCombinatorSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 62FA04E11BCC360D009ABF98 /* CSSCombinatorSelector.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
62857D901D39A47F008DC254 /* CSSCompoundSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 620C87791BD44CBE00FB3EEE /* CSSCompoundSelector.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
628AF6301BC99A6C00496128 /* CSSNthExpressionsParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 628AF62E1BC99A6C00496128 /* CSSNthExpressionsParserTests.m */; };
|
||||
62A95A4D1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */; };
|
||||
62A95A4E1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */; };
|
||||
62A95A4F1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */; };
|
||||
62C82E0D20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62C82E0C20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m */; };
|
||||
62C82E0E20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62C82E0C20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m */; };
|
||||
62C82E0F20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62C82E0C20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m */; };
|
||||
62D8345A19FB1AC4009205A9 /* HTML5LibTokenizerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 62D8345819FB1AC4009205A9 /* HTML5LibTokenizerTest.m */; };
|
||||
62D91C231DE218A500BEFADE /* HTMLRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 62D91C211DE218A500BEFADE /* HTMLRange.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
62D91C241DE218A500BEFADE /* HTMLRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 62D91C211DE218A500BEFADE /* HTMLRange.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -320,6 +327,9 @@
|
||||
62E0BA971E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62E0BA961E25456700E4D193 /* HTMLCharacterDataTests.m */; };
|
||||
62E0BA981E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62E0BA961E25456700E4D193 /* HTMLCharacterDataTests.m */; };
|
||||
62E0BA991E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62E0BA961E25456700E4D193 /* HTMLCharacterDataTests.m */; };
|
||||
62E1A3B51E610E5300C41C3B /* Fixtures in Resources */ = {isa = PBXBuildFile; fileRef = 62E1A3B41E610E5300C41C3B /* Fixtures */; };
|
||||
62E1A3B61E610E5300C41C3B /* Fixtures in Resources */ = {isa = PBXBuildFile; fileRef = 62E1A3B41E610E5300C41C3B /* Fixtures */; };
|
||||
62E1A3B71E610E5300C41C3B /* Fixtures in Resources */ = {isa = PBXBuildFile; fileRef = 62E1A3B41E610E5300C41C3B /* Fixtures */; };
|
||||
62EC0A851E158BD80007786B /* HTMLRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62EC0A841E158BD80007786B /* HTMLRangeTests.m */; };
|
||||
62EC0A861E158BD80007786B /* HTMLRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62EC0A841E158BD80007786B /* HTMLRangeTests.m */; };
|
||||
62EC0A871E158BD80007786B /* HTMLRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62EC0A841E158BD80007786B /* HTMLRangeTests.m */; };
|
||||
@@ -545,7 +555,6 @@
|
||||
62ECBFDB1C0B6E2E00AF847B /* CSSNThExpressionSelectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62F6586F1BD83C8E0045F137 /* CSSNThExpressionSelectorTests.m */; };
|
||||
62ECBFDC1C0B6E2E00AF847B /* CSSCombinatorSelectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 621FBE5C1BDAD90200BC9555 /* CSSCombinatorSelectorTests.m */; };
|
||||
62ECBFDD1C0B6E4400AF847B /* css-tests in Resources */ = {isa = PBXBuildFile; fileRef = 62132E5B1C021FF200084175 /* css-tests */; };
|
||||
62ECBFDE1C0B6E4400AF847B /* HTML Standard.html in Resources */ = {isa = PBXBuildFile; fileRef = 624AC90D19FC702E00BD3C4A /* HTML Standard.html */; };
|
||||
62ECBFDF1C0B6E4400AF847B /* html5lib-tests in Resources */ = {isa = PBXBuildFile; fileRef = 624AC90419FBFE8A00BD3C4A /* html5lib-tests */; };
|
||||
62F658711BD83C8E0045F137 /* CSSNThExpressionSelectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 62F6586F1BD83C8E0045F137 /* CSSNThExpressionSelectorTests.m */; };
|
||||
62F7E5A21DEB63F900DEF09B /* HTMLRange+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 62F7E5A01DEB63F900DEF09B /* HTMLRange+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
@@ -581,18 +590,19 @@
|
||||
/* Begin PBXFileReference section */
|
||||
62056C4E1E2AD9FB009A4EE0 /* HTMLNodeIterator+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "HTMLNodeIterator+Private.h"; path = "include/HTMLNodeIterator+Private.h"; sourceTree = "<group>"; };
|
||||
62079BE71AF56F1E00D3B402 /* CSSSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSSelector.h; path = include/CSSSelector.h; sourceTree = "<group>"; };
|
||||
620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CSSStructuralPseudoSelectors.m; path = HTMLKitTests/CSSStructuralPseudoSelectors.m; sourceTree = "<group>"; };
|
||||
620C87791BD44CBE00FB3EEE /* CSSCompoundSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSCompoundSelector.h; path = include/CSSCompoundSelector.h; sourceTree = "<group>"; };
|
||||
620C877A1BD44CBE00FB3EEE /* CSSCompoundSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSCompoundSelector.m; sourceTree = "<group>"; };
|
||||
620EE9471BC46F2A0028ED34 /* CSSPseudoClassSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSPseudoClassSelector.h; path = include/CSSPseudoClassSelector.h; sourceTree = "<group>"; };
|
||||
620EE9481BC46F2A0028ED34 /* CSSPseudoClassSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSPseudoClassSelector.m; sourceTree = "<group>"; };
|
||||
62132E571C01F83200084175 /* CSSSelectorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelectorTest.h; sourceTree = "<group>"; };
|
||||
62132E581C01F83200084175 /* CSSSelectorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSSelectorTest.m; sourceTree = "<group>"; };
|
||||
62132E571C01F83200084175 /* CSSSelectorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSSelectorTest.h; path = HTMLKitTests/CSSSelectorTest.h; sourceTree = "<group>"; };
|
||||
62132E581C01F83200084175 /* CSSSelectorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSSelectorTest.m; path = HTMLKitTests/CSSSelectorTest.m; sourceTree = "<group>"; };
|
||||
62132E5B1C021FF200084175 /* css-tests */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "css-tests"; sourceTree = "<group>"; };
|
||||
6216ACFC1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSExtensionSelectorsParsingTests.m; sourceTree = "<group>"; };
|
||||
6216ACFC1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSExtensionSelectorsParsingTests.m; path = HTMLKitTests/CSSExtensionSelectorsParsingTests.m; sourceTree = "<group>"; };
|
||||
621CC48F1DEA704000D1992A /* HTMLDocument+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "HTMLDocument+Private.h"; path = "include/HTMLDocument+Private.h"; sourceTree = "<group>"; };
|
||||
621CC4A31DEA721A00D1992A /* HTMLParser+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "HTMLParser+Private.h"; path = "include/HTMLParser+Private.h"; sourceTree = "<group>"; };
|
||||
621FBE591BDAD68700BC9555 /* CSSSelectorParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSSelectorParserTests.m; sourceTree = "<group>"; };
|
||||
621FBE5C1BDAD90200BC9555 /* CSSCombinatorSelectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSCombinatorSelectorTests.m; sourceTree = "<group>"; };
|
||||
621FBE591BDAD68700BC9555 /* CSSSelectorParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSSelectorParserTests.m; path = HTMLKitTests/CSSSelectorParserTests.m; sourceTree = "<group>"; };
|
||||
621FBE5C1BDAD90200BC9555 /* CSSCombinatorSelectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSCombinatorSelectorTests.m; path = HTMLKitTests/CSSCombinatorSelectorTests.m; sourceTree = "<group>"; };
|
||||
6223211D1A969B9300BACED5 /* HTMLElementTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLElementTypes.h; path = include/HTMLElementTypes.h; sourceTree = "<group>"; };
|
||||
622BF57F1BBF2FD700363583 /* CSSSelectorParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSSelectorParser.h; path = include/CSSSelectorParser.h; sourceTree = "<group>"; };
|
||||
622BF5801BBF2FD700363583 /* CSSSelectorParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSSelectorParser.m; sourceTree = "<group>"; };
|
||||
@@ -616,7 +626,7 @@
|
||||
62362A3F1A9FDE8A00301989 /* HTMLDOM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLDOM.h; path = include/HTMLDOM.h; sourceTree = "<group>"; };
|
||||
62363C3B1ABE428200DAB4C6 /* HTMLListOfActiveFormattingElements.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLListOfActiveFormattingElements.h; path = include/HTMLListOfActiveFormattingElements.h; sourceTree = "<group>"; };
|
||||
62363C3C1ABE428200DAB4C6 /* HTMLListOfActiveFormattingElements.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLListOfActiveFormattingElements.m; sourceTree = "<group>"; };
|
||||
6236738D1AC0CE2500FF89B3 /* HTMLKitTokenizerPerformance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLKitTokenizerPerformance.m; sourceTree = "<group>"; };
|
||||
6236738D1AC0CE2500FF89B3 /* HTMLKitTokenizerPerformance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLKitTokenizerPerformance.m; path = HTMLKitTests/HTMLKitTokenizerPerformance.m; sourceTree = "<group>"; };
|
||||
623719431AA12EE8002E03C8 /* HTMLQuirksMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLQuirksMode.h; path = include/HTMLQuirksMode.h; sourceTree = "<group>"; };
|
||||
6238039D1AB63A8C008A53D0 /* HTMLEOFToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLEOFToken.h; path = include/HTMLEOFToken.h; sourceTree = "<group>"; };
|
||||
6238039E1AB63A8C008A53D0 /* HTMLEOFToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLEOFToken.m; sourceTree = "<group>"; };
|
||||
@@ -628,11 +638,11 @@
|
||||
6238579A1A9E8934003A45D9 /* HTMLComment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLComment.m; sourceTree = "<group>"; };
|
||||
6238C9831AB8D6330006512E /* HTMLKitDOMExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLKitDOMExceptions.h; path = include/HTMLKitDOMExceptions.h; sourceTree = "<group>"; };
|
||||
6238C9841AB8D6330006512E /* HTMLKitDOMExceptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLKitDOMExceptions.m; sourceTree = "<group>"; };
|
||||
623916C61AC7209E0066B4FE /* HTMLNodeIteratorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLNodeIteratorTests.m; sourceTree = "<group>"; };
|
||||
623975591AC362CA007E26F1 /* HTMLKitTreeConstructionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLKitTreeConstructionTests.m; sourceTree = "<group>"; };
|
||||
6239755C1AC364BB007E26F1 /* HTML5LibTreeConstructionTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5LibTreeConstructionTest.h; sourceTree = "<group>"; };
|
||||
6239755D1AC364BB007E26F1 /* HTML5LibTreeConstructionTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTML5LibTreeConstructionTest.m; sourceTree = "<group>"; };
|
||||
623CAF9C1AD88BEA00E34C32 /* HTMLKitParserPerformance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLKitParserPerformance.m; sourceTree = "<group>"; };
|
||||
623916C61AC7209E0066B4FE /* HTMLNodeIteratorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLNodeIteratorTests.m; path = HTMLKitTests/HTMLNodeIteratorTests.m; sourceTree = "<group>"; };
|
||||
623975591AC362CA007E26F1 /* HTMLKitTreeConstructionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLKitTreeConstructionTests.m; path = HTMLKitTests/HTMLKitTreeConstructionTests.m; sourceTree = "<group>"; };
|
||||
6239755C1AC364BB007E26F1 /* HTML5LibTreeConstructionTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTML5LibTreeConstructionTest.h; path = HTMLKitTests/HTML5LibTreeConstructionTest.h; sourceTree = "<group>"; };
|
||||
6239755D1AC364BB007E26F1 /* HTML5LibTreeConstructionTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTML5LibTreeConstructionTest.m; path = HTMLKitTests/HTML5LibTreeConstructionTest.m; sourceTree = "<group>"; };
|
||||
623CAF9C1AD88BEA00E34C32 /* HTMLKitParserPerformance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLKitParserPerformance.m; path = HTMLKitTests/HTMLKitParserPerformance.m; sourceTree = "<group>"; };
|
||||
624493A419CCC54100BCDDF4 /* HTMLTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLTokenizer.h; path = include/HTMLTokenizer.h; sourceTree = "<group>"; };
|
||||
624493A519CCC54100BCDDF4 /* HTMLTokenizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLTokenizer.m; sourceTree = "<group>"; };
|
||||
624493A919CCE84A00BCDDF4 /* HTMLTokenizerStates.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLTokenizerStates.h; path = include/HTMLTokenizerStates.h; sourceTree = "<group>"; };
|
||||
@@ -640,7 +650,7 @@
|
||||
624493AB19CD0CBE00BCDDF4 /* HTMLToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLToken.m; sourceTree = "<group>"; };
|
||||
624717161B22333200C11912 /* HTMLNodeTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLNodeTraversal.h; path = include/HTMLNodeTraversal.h; sourceTree = "<group>"; };
|
||||
624717171B22333200C11912 /* HTMLNodeTraversal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLNodeTraversal.m; sourceTree = "<group>"; };
|
||||
6247171B1B2240B800C11912 /* HTMLTreeWalkerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLTreeWalkerTests.m; sourceTree = "<group>"; };
|
||||
6247171B1B2240B800C11912 /* HTMLTreeWalkerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLTreeWalkerTests.m; path = HTMLKitTests/HTMLTreeWalkerTests.m; sourceTree = "<group>"; };
|
||||
624717B71B21FE5400B38302 /* HTMLNodeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLNodeFilter.m; sourceTree = "<group>"; };
|
||||
624717BA1B22009200B38302 /* HTMLTreeWalker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLTreeWalker.h; path = include/HTMLTreeWalker.h; sourceTree = "<group>"; };
|
||||
624717BB1B22009200B38302 /* HTMLTreeWalker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLTreeWalker.m; sourceTree = "<group>"; };
|
||||
@@ -648,12 +658,11 @@
|
||||
6247A9421B152F4F00CCF25C /* HTMLNodeIterator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLNodeIterator.m; sourceTree = "<group>"; };
|
||||
6247A9461B152F8C00CCF25C /* HTMLNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLNodeFilter.h; path = include/HTMLNodeFilter.h; sourceTree = "<group>"; };
|
||||
624AB3151B04EA4200F3830D /* CSSSelectors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CSSSelectors.h; path = include/CSSSelectors.h; sourceTree = "<group>"; };
|
||||
624AB3161B0508AE00F3830D /* CSSTypeSelectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSTypeSelectorTests.m; sourceTree = "<group>"; };
|
||||
624AB3191B050A4D00F3830D /* CSSAttributeSelectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSAttributeSelectorTests.m; sourceTree = "<group>"; };
|
||||
624AB3161B0508AE00F3830D /* CSSTypeSelectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSTypeSelectorTests.m; path = HTMLKitTests/CSSTypeSelectorTests.m; sourceTree = "<group>"; };
|
||||
624AB3191B050A4D00F3830D /* CSSAttributeSelectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSAttributeSelectorTests.m; path = HTMLKitTests/CSSAttributeSelectorTests.m; sourceTree = "<group>"; };
|
||||
624AC8FE19FBF4F700BD3C4A /* HTMLTokens.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLTokens.h; path = include/HTMLTokens.h; sourceTree = "<group>"; };
|
||||
624AC90019FBF9ED00BD3C4A /* HTMLKitTokenizerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLKitTokenizerTests.m; sourceTree = "<group>"; };
|
||||
624AC90019FBF9ED00BD3C4A /* HTMLKitTokenizerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLKitTokenizerTests.m; path = HTMLKitTests/HTMLKitTokenizerTests.m; sourceTree = "<group>"; };
|
||||
624AC90419FBFE8A00BD3C4A /* html5lib-tests */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "html5lib-tests"; sourceTree = "<group>"; };
|
||||
624AC90D19FC702E00BD3C4A /* HTML Standard.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "HTML Standard.html"; sourceTree = "<group>"; };
|
||||
624B28B61B03DA820048D328 /* CSSTypeSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSTypeSelector.h; path = include/CSSTypeSelector.h; sourceTree = "<group>"; };
|
||||
624B28B71B03DA820048D328 /* CSSTypeSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSTypeSelector.m; sourceTree = "<group>"; };
|
||||
624B28BD1B0413200048D328 /* CSSAttributeSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSAttributeSelector.h; path = include/CSSAttributeSelector.h; sourceTree = "<group>"; };
|
||||
@@ -663,14 +672,14 @@
|
||||
624B371C1B24E9BA0010BDDF /* CSSInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSInputStream.h; path = include/CSSInputStream.h; sourceTree = "<group>"; };
|
||||
624B371D1B24E9BA0010BDDF /* CSSInputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSInputStream.m; sourceTree = "<group>"; };
|
||||
624B37211B250BB50010BDDF /* CSSCodePoints.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CSSCodePoints.h; path = include/CSSCodePoints.h; sourceTree = "<group>"; };
|
||||
624B9FB11AE0313300646C4C /* HTMLStringCategoryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLStringCategoryTests.m; sourceTree = "<group>"; };
|
||||
624B9FB41AE0391400646C4C /* HTMLOrderedDictionaryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLOrderedDictionaryTests.m; sourceTree = "<group>"; };
|
||||
624B9FB11AE0313300646C4C /* HTMLStringCategoryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLStringCategoryTests.m; path = HTMLKitTests/HTMLStringCategoryTests.m; sourceTree = "<group>"; };
|
||||
624B9FB41AE0391400646C4C /* HTMLOrderedDictionaryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLOrderedDictionaryTests.m; path = HTMLKitTests/HTMLOrderedDictionaryTests.m; sourceTree = "<group>"; };
|
||||
624C77781DE9D05E00DD6DFA /* HTMLCharacterData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLCharacterData.h; path = include/HTMLCharacterData.h; sourceTree = "<group>"; };
|
||||
624C77791DE9D05E00DD6DFA /* HTMLCharacterData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLCharacterData.m; sourceTree = "<group>"; };
|
||||
624FC3791AE591D80015DDF9 /* HTMLNodesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLNodesTests.m; sourceTree = "<group>"; };
|
||||
624FC3791AE591D80015DDF9 /* HTMLNodesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLNodesTests.m; path = HTMLKitTests/HTMLNodesTests.m; sourceTree = "<group>"; };
|
||||
62567F4E1C0CB5750025D458 /* HTMLDOMTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLDOMTokenList.h; path = include/HTMLDOMTokenList.h; sourceTree = "<group>"; };
|
||||
62567F4F1C0CB5750025D458 /* HTMLDOMTokenList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLDOMTokenList.m; sourceTree = "<group>"; };
|
||||
62567F551C0CC3AE0025D458 /* HTMLDOMTokenListTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLDOMTokenListTests.m; sourceTree = "<group>"; };
|
||||
62567F551C0CC3AE0025D458 /* HTMLDOMTokenListTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLDOMTokenListTests.m; path = HTMLKitTests/HTMLDOMTokenListTests.m; sourceTree = "<group>"; };
|
||||
625A14AC19C7829400AD0C32 /* HTMLKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HTMLKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
625A14AF19C7829400AD0C32 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
625A14B219C7829400AD0C32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
@@ -680,15 +689,14 @@
|
||||
625A14BC19C7829400AD0C32 /* HTMLKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLKit.h; path = include/HTMLKit.h; sourceTree = "<group>"; };
|
||||
625A14C319C7829400AD0C32 /* HTMLKitTests-macOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HTMLKitTests-macOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
625A14C419C7829400AD0C32 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
||||
625A14CC19C7829400AD0C32 /* HTMLKitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HTMLKitTests-Info.plist"; sourceTree = "<group>"; };
|
||||
625A14DF19C7834100AD0C32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
625A150619C78ABA00AD0C32 /* HTMLInputStreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLInputStreamReader.h; path = include/HTMLInputStreamReader.h; sourceTree = "<group>"; };
|
||||
625A150719C78ABA00AD0C32 /* HTMLInputStreamReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLInputStreamReader.m; sourceTree = "<group>"; };
|
||||
625D0F011C2717DE00D7BEB0 /* HTMLNode+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "HTMLNode+Private.h"; path = "include/HTMLNode+Private.h"; sourceTree = "<group>"; };
|
||||
625EE4551CBAA41D00F2CC8E /* HTMLKitTestObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLKitTestObserver.h; sourceTree = "<group>"; };
|
||||
625EE4561CBAA41D00F2CC8E /* HTMLKitTestObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLKitTestObserver.m; sourceTree = "<group>"; };
|
||||
625EE4591CBB171300F2CC8E /* HTMLKitTestUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLKitTestUtil.h; sourceTree = "<group>"; };
|
||||
625EE45A1CBB171300F2CC8E /* HTMLKitTestUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLKitTestUtil.m; sourceTree = "<group>"; };
|
||||
625EE4551CBAA41D00F2CC8E /* HTMLKitTestObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLKitTestObserver.h; path = HTMLKitTests/HTMLKitTestObserver.h; sourceTree = "<group>"; };
|
||||
625EE4561CBAA41D00F2CC8E /* HTMLKitTestObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLKitTestObserver.m; path = HTMLKitTests/HTMLKitTestObserver.m; sourceTree = "<group>"; };
|
||||
625EE4591CBB171300F2CC8E /* HTMLKitTestUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLKitTestUtil.h; path = HTMLKitTests/HTMLKitTestUtil.h; sourceTree = "<group>"; };
|
||||
625EE45A1CBB171300F2CC8E /* HTMLKitTestUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLKitTestUtil.m; path = HTMLKitTests/HTMLKitTestUtil.m; sourceTree = "<group>"; };
|
||||
626652F81C03D30F00C3F121 /* HTMLKitErrorDomain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLKitErrorDomain.h; path = include/HTMLKitErrorDomain.h; sourceTree = "<group>"; };
|
||||
626679CD1DEA3DAF004353E7 /* HTMLCharacterData+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "HTMLCharacterData+Private.h"; path = "include/HTMLCharacterData+Private.h"; sourceTree = "<group>"; };
|
||||
626BE1E01DF3819500C49514 /* HTMLDOMUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLDOMUtils.h; path = include/HTMLDOMUtils.h; sourceTree = "<group>"; };
|
||||
@@ -699,12 +707,13 @@
|
||||
62857C4E1D398642008DC254 /* HTMLKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HTMLKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
62857CEA1D39A262008DC254 /* HTMLKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HTMLKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
62857CF31D39A262008DC254 /* HTMLKit-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HTMLKit-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
628AF62E1BC99A6C00496128 /* CSSNthExpressionsParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSNthExpressionsParserTests.m; sourceTree = "<group>"; };
|
||||
628AF62E1BC99A6C00496128 /* CSSNthExpressionsParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSNthExpressionsParserTests.m; path = HTMLKitTests/CSSNthExpressionsParserTests.m; sourceTree = "<group>"; };
|
||||
628AF6311BC9A63D00496128 /* CSSNthExpressionSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSNthExpressionSelector.h; path = include/CSSNthExpressionSelector.h; sourceTree = "<group>"; };
|
||||
628AF6321BC9A63D00496128 /* CSSNthExpressionSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSNthExpressionSelector.m; sourceTree = "<group>"; };
|
||||
628AF63C1BC9D6FB00496128 /* CSSStructuralPseudoSelectors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSStructuralPseudoSelectors.h; path = include/CSSStructuralPseudoSelectors.h; sourceTree = "<group>"; };
|
||||
628AF63D1BC9D6FB00496128 /* CSSStructuralPseudoSelectors.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSStructuralPseudoSelectors.m; sourceTree = "<group>"; };
|
||||
628B7CE61A080E1000602C87 /* HTMLNamespaces.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLNamespaces.h; path = include/HTMLNamespaces.h; sourceTree = "<group>"; };
|
||||
62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTMLSerializationTests.m; path = HTMLKitTests/HTMLSerializationTests.m; sourceTree = "<group>"; };
|
||||
62ACB8DB1BC5C13E00E283C1 /* CSSPseudoFunctionSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSPseudoFunctionSelector.h; path = include/CSSPseudoFunctionSelector.h; sourceTree = "<group>"; };
|
||||
62ACB8DC1BC5C13E00E283C1 /* CSSPseudoFunctionSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSPseudoFunctionSelector.m; sourceTree = "<group>"; };
|
||||
62AE593319F97D880043F069 /* HTMLParseErrorToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLParseErrorToken.h; path = include/HTMLParseErrorToken.h; sourceTree = "<group>"; };
|
||||
@@ -717,21 +726,23 @@
|
||||
62AE594319F992F30043F069 /* HTMLCommentToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLCommentToken.m; sourceTree = "<group>"; };
|
||||
62AE594719F9948A0043F069 /* HTMLCharacterToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLCharacterToken.h; path = include/HTMLCharacterToken.h; sourceTree = "<group>"; };
|
||||
62AE594819F9948A0043F069 /* HTMLCharacterToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLCharacterToken.m; sourceTree = "<group>"; };
|
||||
62D8345719FB1AC4009205A9 /* HTML5LibTokenizerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5LibTokenizerTest.h; sourceTree = "<group>"; };
|
||||
62D8345819FB1AC4009205A9 /* HTML5LibTokenizerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTML5LibTokenizerTest.m; sourceTree = "<group>"; };
|
||||
62C82E0C20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = HTMLKitParserIssuesTests.m; path = HTMLKitTests/HTMLKitParserIssuesTests.m; sourceTree = "<group>"; };
|
||||
62D8345719FB1AC4009205A9 /* HTML5LibTokenizerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTML5LibTokenizerTest.h; path = HTMLKitTests/HTML5LibTokenizerTest.h; sourceTree = "<group>"; };
|
||||
62D8345819FB1AC4009205A9 /* HTML5LibTokenizerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTML5LibTokenizerTest.m; path = HTMLKitTests/HTML5LibTokenizerTest.m; sourceTree = "<group>"; };
|
||||
62D91C211DE218A500BEFADE /* HTMLRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLRange.h; path = include/HTMLRange.h; sourceTree = "<group>"; };
|
||||
62D91C221DE218A500BEFADE /* HTMLRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLRange.m; sourceTree = "<group>"; };
|
||||
62E0BA961E25456700E4D193 /* HTMLCharacterDataTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLCharacterDataTests.m; sourceTree = "<group>"; };
|
||||
62E0BA961E25456700E4D193 /* HTMLCharacterDataTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLCharacterDataTests.m; path = HTMLKitTests/HTMLCharacterDataTests.m; sourceTree = "<group>"; };
|
||||
62E1A3B41E610E5300C41C3B /* Fixtures */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Fixtures; sourceTree = "<group>"; };
|
||||
62E7CAAE19CDFFB500465A83 /* HTMLTokenizerCharacters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HTMLTokenizerCharacters.h; path = include/HTMLTokenizerCharacters.h; sourceTree = "<group>"; };
|
||||
62EC0A841E158BD80007786B /* HTMLRangeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLRangeTests.m; sourceTree = "<group>"; };
|
||||
62EC7AE51AEEAC6F0015D3BE /* HTMLMutationAlgorithmsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLMutationAlgorithmsTests.m; sourceTree = "<group>"; };
|
||||
62EC0A841E158BD80007786B /* HTMLRangeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLRangeTests.m; path = HTMLKitTests/HTMLRangeTests.m; sourceTree = "<group>"; };
|
||||
62EC7AE51AEEAC6F0015D3BE /* HTMLMutationAlgorithmsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTMLMutationAlgorithmsTests.m; path = HTMLKitTests/HTMLMutationAlgorithmsTests.m; sourceTree = "<group>"; };
|
||||
62ECBF4D1C0B6C7600AF847B /* HTMLKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HTMLKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
62ECBF561C0B6C7600AF847B /* HTMLKitTests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HTMLKitTests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
62F31FDB19E9DCCF007F0657 /* HTMLTokenizerEntities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLTokenizerEntities.h; path = include/HTMLTokenizerEntities.h; sourceTree = "<group>"; };
|
||||
62F31FDC19E9DCCF007F0657 /* HTMLTokenizerEntities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLTokenizerEntities.m; sourceTree = "<group>"; };
|
||||
62F501631BC9576B0069F47B /* CSSNthExpressionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSNthExpressionParser.h; path = include/CSSNthExpressionParser.h; sourceTree = "<group>"; };
|
||||
62F501641BC9576B0069F47B /* CSSNthExpressionParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSNthExpressionParser.m; sourceTree = "<group>"; };
|
||||
62F6586F1BD83C8E0045F137 /* CSSNThExpressionSelectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSNThExpressionSelectorTests.m; sourceTree = "<group>"; };
|
||||
62F6586F1BD83C8E0045F137 /* CSSNThExpressionSelectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSNThExpressionSelectorTests.m; path = HTMLKitTests/CSSNThExpressionSelectorTests.m; sourceTree = "<group>"; };
|
||||
62F7E5A01DEB63F900DEF09B /* HTMLRange+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "HTMLRange+Private.h"; path = "include/HTMLRange+Private.h"; sourceTree = "<group>"; };
|
||||
62F873E919E088C90062683C /* HTMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLParser.h; path = include/HTMLParser.h; sourceTree = "<group>"; };
|
||||
62F873EA19E088C90062683C /* HTMLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTMLParser.m; sourceTree = "<group>"; };
|
||||
@@ -886,6 +897,7 @@
|
||||
62EC7AE51AEEAC6F0015D3BE /* HTMLMutationAlgorithmsTests.m */,
|
||||
62EC0A841E158BD80007786B /* HTMLRangeTests.m */,
|
||||
62E0BA961E25456700E4D193 /* HTMLCharacterDataTests.m */,
|
||||
62A95A4C1FB0FBFC0009FF26 /* HTMLSerializationTests.m */,
|
||||
);
|
||||
name = DOM;
|
||||
sourceTree = "<group>";
|
||||
@@ -985,6 +997,7 @@
|
||||
625EE45A1CBB171300F2CC8E /* HTMLKitTestUtil.m */,
|
||||
6236738C1AC0CD2400FF89B3 /* Tokenizer */,
|
||||
623975581AC362A5007E26F1 /* Tree Construction */,
|
||||
62C82E0B20FD2FCB008497A8 /* Parser */,
|
||||
624B9FB71AE072CB00646C4C /* DOM */,
|
||||
624B9FB81AE072D500646C4C /* Categories */,
|
||||
624E1A2D1B1D1C8A00E66AAC /* Structures */,
|
||||
@@ -997,10 +1010,9 @@
|
||||
625A14CB19C7829400AD0C32 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
62E1A3B41E610E5300C41C3B /* Fixtures */,
|
||||
62132E5B1C021FF200084175 /* css-tests */,
|
||||
624AC90D19FC702E00BD3C4A /* HTML Standard.html */,
|
||||
624AC90419FBFE8A00BD3C4A /* html5lib-tests */,
|
||||
625A14CC19C7829400AD0C32 /* HTMLKitTests-Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
@@ -1090,6 +1102,14 @@
|
||||
name = Tokenizing;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
62C82E0B20FD2FCB008497A8 /* Parser */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
62C82E0C20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m */,
|
||||
);
|
||||
name = Parser;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
62ECBEDF1C0B671000AF847B /* Parsing */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -1141,6 +1161,7 @@
|
||||
624AB3191B050A4D00F3830D /* CSSAttributeSelectorTests.m */,
|
||||
62F6586F1BD83C8E0045F137 /* CSSNThExpressionSelectorTests.m */,
|
||||
621FBE5C1BDAD90200BC9555 /* CSSCombinatorSelectorTests.m */,
|
||||
620AB7B02087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m */,
|
||||
);
|
||||
name = Selectors;
|
||||
sourceTree = "<group>";
|
||||
@@ -1575,7 +1596,7 @@
|
||||
625A14A319C7829400AD0C32 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0800;
|
||||
LastUpgradeCheck = 0900;
|
||||
ORGANIZATIONNAME = BrainCookie;
|
||||
TargetAttributes = {
|
||||
625A14C219C7829400AD0C32 = {
|
||||
@@ -1637,7 +1658,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
624AC90F19FC702E00BD3C4A /* HTML Standard.html in Resources */,
|
||||
62E1A3B51E610E5300C41C3B /* Fixtures in Resources */,
|
||||
624AC90519FBFE9A00BD3C4A /* html5lib-tests in Resources */,
|
||||
62132E5D1C021FF200084175 /* css-tests in Resources */,
|
||||
);
|
||||
@@ -1661,9 +1682,9 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
62E1A3B71E610E5300C41C3B /* Fixtures in Resources */,
|
||||
62857D471D39A3E4008DC254 /* html5lib-tests in Resources */,
|
||||
62857D451D39A353008DC254 /* css-tests in Resources */,
|
||||
62857D461D39A3D7008DC254 /* HTML Standard.html in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -1678,8 +1699,8 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
62E1A3B61E610E5300C41C3B /* Fixtures in Resources */,
|
||||
62ECBFDD1C0B6E4400AF847B /* css-tests in Resources */,
|
||||
62ECBFDE1C0B6E4400AF847B /* HTML Standard.html in Resources */,
|
||||
62ECBFDF1C0B6E4400AF847B /* html5lib-tests in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -1747,8 +1768,10 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
62EC0A851E158BD80007786B /* HTMLRangeTests.m in Sources */,
|
||||
620AB7B12087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */,
|
||||
62E0BA971E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */,
|
||||
6216ACFD1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m in Sources */,
|
||||
62C82E0D20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m in Sources */,
|
||||
62132E5A1C01F83200084175 /* CSSSelectorTest.m in Sources */,
|
||||
6239755B1AC362CA007E26F1 /* HTMLKitTreeConstructionTests.m in Sources */,
|
||||
62F658711BD83C8E0045F137 /* CSSNThExpressionSelectorTests.m in Sources */,
|
||||
@@ -1763,6 +1786,7 @@
|
||||
62567F561C0CC3AE0025D458 /* HTMLDOMTokenListTests.m in Sources */,
|
||||
624AC90219FBF9ED00BD3C4A /* HTMLKitTokenizerTests.m in Sources */,
|
||||
624B9FB31AE0313300646C4C /* HTMLStringCategoryTests.m in Sources */,
|
||||
62A95A4D1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */,
|
||||
623916C81AC7209E0066B4FE /* HTMLNodeIteratorTests.m in Sources */,
|
||||
62D8345A19FB1AC4009205A9 /* HTML5LibTokenizerTest.m in Sources */,
|
||||
6239755F1AC364BB007E26F1 /* HTML5LibTreeConstructionTest.m in Sources */,
|
||||
@@ -1889,8 +1913,10 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
62EC0A871E158BD80007786B /* HTMLRangeTests.m in Sources */,
|
||||
620AB7B32087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */,
|
||||
62E0BA991E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */,
|
||||
62857D3B1D39A345008DC254 /* CSSSelectorTest.m in Sources */,
|
||||
62C82E0F20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m in Sources */,
|
||||
62857D421D39A345008DC254 /* CSSCombinatorSelectorTests.m in Sources */,
|
||||
62857D3C1D39A345008DC254 /* CSSSelectorParserTests.m in Sources */,
|
||||
62857D301D39A339008DC254 /* HTMLKitTokenizerPerformance.m in Sources */,
|
||||
@@ -1905,6 +1931,7 @@
|
||||
62857D401D39A345008DC254 /* CSSAttributeSelectorTests.m in Sources */,
|
||||
62857D311D39A33C008DC254 /* HTML5LibTreeConstructionTest.m in Sources */,
|
||||
62857D391D39A342008DC254 /* HTMLOrderedDictionaryTests.m in Sources */,
|
||||
62A95A4F1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */,
|
||||
62857D411D39A345008DC254 /* CSSNThExpressionSelectorTests.m in Sources */,
|
||||
62857D381D39A342008DC254 /* HTMLStringCategoryTests.m in Sources */,
|
||||
62857D331D39A33C008DC254 /* HTMLKitParserPerformance.m in Sources */,
|
||||
@@ -1976,8 +2003,10 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
62EC0A861E158BD80007786B /* HTMLRangeTests.m in Sources */,
|
||||
620AB7B22087F18D00AFCCC7 /* CSSStructuralPseudoSelectors.m in Sources */,
|
||||
62E0BA981E25456700E4D193 /* HTMLCharacterDataTests.m in Sources */,
|
||||
6216ACFE1C28DCC80074CAB4 /* CSSExtensionSelectorsParsingTests.m in Sources */,
|
||||
62C82E0E20FD2FFD008497A8 /* HTMLKitParserIssuesTests.m in Sources */,
|
||||
62ECBFCA1C0B6E2E00AF847B /* HTML5LibTokenizerTest.m in Sources */,
|
||||
62ECBFCB1C0B6E2E00AF847B /* HTMLKitTokenizerTests.m in Sources */,
|
||||
62ECBFCC1C0B6E2E00AF847B /* HTMLKitTokenizerPerformance.m in Sources */,
|
||||
@@ -1992,6 +2021,7 @@
|
||||
62567F571C0CC3AE0025D458 /* HTMLDOMTokenListTests.m in Sources */,
|
||||
62ECBFD41C0B6E2E00AF847B /* HTMLStringCategoryTests.m in Sources */,
|
||||
62ECBFD51C0B6E2E00AF847B /* HTMLOrderedDictionaryTests.m in Sources */,
|
||||
62A95A4E1FB0FBFC0009FF26 /* HTMLSerializationTests.m in Sources */,
|
||||
62ECBFD61C0B6E2E00AF847B /* CSSSelectorTest.m in Sources */,
|
||||
62ECBFD71C0B6E2E00AF847B /* CSSSelectorParserTests.m in Sources */,
|
||||
62ECBFD81C0B6E2E00AF847B /* CSSNthExpressionsParserTests.m in Sources */,
|
||||
@@ -2032,14 +2062,20 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
@@ -2076,14 +2112,20 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
@@ -2108,17 +2150,22 @@
|
||||
625A14D519C7829400AD0C32 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
|
||||
INSTALL_PATH = "@rpath";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = de.iabudiab.HTMLKit;
|
||||
PRODUCT_NAME = HTMLKit;
|
||||
@@ -2131,17 +2178,22 @@
|
||||
625A14D619C7829400AD0C32 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
|
||||
INSTALL_PATH = "@rpath";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = de.iabudiab.HTMLKit;
|
||||
PRODUCT_NAME = HTMLKit;
|
||||
@@ -2166,7 +2218,7 @@
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests-Info.plist";
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "de.iabudiab.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -2188,7 +2240,7 @@
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests-Info.plist";
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "de.iabudiab.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -2204,6 +2256,7 @@
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
@@ -2215,7 +2268,9 @@
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
@@ -2239,6 +2294,7 @@
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@@ -2250,7 +2306,9 @@
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
@@ -2274,6 +2332,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer";
|
||||
@@ -2287,7 +2346,9 @@
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
@@ -2309,6 +2370,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer";
|
||||
@@ -2322,7 +2384,9 @@
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
@@ -2349,7 +2413,7 @@
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests-Info.plist";
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
@@ -2369,7 +2433,7 @@
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests-Info.plist";
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
@@ -2385,6 +2449,7 @@
|
||||
62ECBF5F1C0B6C7600AF847B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
@@ -2397,8 +2462,10 @@
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_INHIBIT_ALL_WARNINGS = NO;
|
||||
GCC_WARN_PEDANTIC = NO;
|
||||
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
|
||||
@@ -2421,6 +2488,7 @@
|
||||
62ECBF601C0B6C7600AF847B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
@@ -2433,8 +2501,10 @@
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_INHIBIT_ALL_WARNINGS = NO;
|
||||
GCC_WARN_PEDANTIC = NO;
|
||||
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
|
||||
@@ -2463,7 +2533,7 @@
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests-Info.plist";
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
@@ -2483,7 +2553,7 @@
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests-Info.plist";
|
||||
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
<Testables>
|
||||
@@ -70,6 +71,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
<Testables>
|
||||
@@ -70,6 +71,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
<Testables>
|
||||
@@ -64,6 +65,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
<Testables>
|
||||
@@ -37,6 +38,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "HTMLKit"
|
||||
name: "HTMLKit",
|
||||
exclude: ["Tests/Fixtures", "Tests/css-tests", "Tests/html5lib-tests"]
|
||||
)
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
An Objective-C framework for your everyday HTML needs.
|
||||
|
||||
[](https://travis-ci.org/iabudiab/HTMLKit)
|
||||
[](https://travis-ci.org/iabudiab/HTMLKit)
|
||||
[](https://codecov.io/gh/iabudiab/HTMLKit)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](https://cocoapods.org/pods/HTMLKit)
|
||||
[](http://cocoadocs.org/docsets/HTMLKit)
|
||||
@@ -75,10 +76,8 @@ $ gem install cocoapods
|
||||
To add `HTMLKit` as a dependency into your project using CocoaPods just add the following in your `Podfile`:
|
||||
|
||||
```ruby
|
||||
use_frameworks!
|
||||
|
||||
target 'MyTarget' do
|
||||
pod 'HTMLKit', '~> 2.0'
|
||||
pod 'HTMLKit', '~> 2.1'
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
@@ -24,14 +24,14 @@
|
||||
|
||||
- (NSString *)consumeIdentifier
|
||||
{
|
||||
CFMutableStringRef value = CFStringCreateMutable(kCFAllocatorDefault, 0);
|
||||
|
||||
if (!isValidIdentifierStart([self inputCharacterPointAtOffset:0],
|
||||
[self inputCharacterPointAtOffset:1],
|
||||
[self inputCharacterPointAtOffset:2])) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
CFMutableStringRef value = CFStringCreateMutable(kCFAllocatorDefault, 0);
|
||||
|
||||
while (YES) {
|
||||
UTF32Char codePoint = [self consumeNextInputCharacter];
|
||||
if (codePoint == EOF) {
|
||||
@@ -47,7 +47,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
return (__bridge NSString *)(CFStringGetLength(value) > 0 ? value : nil);
|
||||
if (CFStringGetLength(value) > 0) {
|
||||
return (__bridge_transfer NSString *)value;
|
||||
}
|
||||
|
||||
CFRelease(value);
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *)consumeStringWithEndingCodePoint:(UTF32Char)endingCodePoint
|
||||
@@ -85,7 +90,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
return (__bridge NSString *)(CFStringGetLength(value) > 0 ? value : nil);
|
||||
if (CFStringGetLength(value) > 0) {
|
||||
return (__bridge_transfer NSString *)value;
|
||||
}
|
||||
|
||||
CFRelease(value);
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (UTF32Char)consumeEscapedCodePoint
|
||||
@@ -105,7 +115,7 @@
|
||||
[self consumeNextInputCharacter];
|
||||
}
|
||||
|
||||
NSScanner *scanner = [NSScanner scannerWithString:(__bridge NSString *)(hexString)];
|
||||
NSScanner *scanner = [NSScanner scannerWithString:(__bridge_transfer NSString *)(hexString)];
|
||||
unsigned int number;
|
||||
[scanner scanHexInt:&number];
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ NSString * _Nonnull NSStringFromNthExpression(CSSNthExpression expression)
|
||||
|
||||
#pragma mark - Implementation
|
||||
|
||||
NSInteger computeIndex(NSEnumerator *enumerator, HTMLElement *element)
|
||||
NS_INLINE NSInteger computeIndex(NSEnumerator *enumerator, HTMLElement *element)
|
||||
{
|
||||
NSInteger index = 0;
|
||||
for (HTMLNode *node in enumerator) {
|
||||
|
||||
@@ -276,7 +276,7 @@ CSSSelector * ltSelector(NSInteger index)
|
||||
return namedBlockSelector(name, ^BOOL(HTMLElement * _Nonnull element) {
|
||||
NSUInteger elementIndex = [element.parentElement indexOfChildNode:element];
|
||||
|
||||
if (index > 0) {
|
||||
if (index >= 0) {
|
||||
return elementIndex < index;
|
||||
} else {
|
||||
return elementIndex < element.parentElement.childNodesCount - index - 1;
|
||||
@@ -290,7 +290,7 @@ CSSSelector * gtSelector(NSInteger index)
|
||||
return namedBlockSelector(name, ^BOOL(HTMLElement * _Nonnull element) {
|
||||
NSUInteger elementIndex = [element.parentElement indexOfChildNode:element];
|
||||
|
||||
if (index > 0) {
|
||||
if (index >= 0) {
|
||||
return elementIndex > index;
|
||||
} else {
|
||||
return elementIndex > element.parentElement.childNodesCount - index - 1;
|
||||
@@ -304,7 +304,7 @@ CSSSelector * eqSelector(NSInteger index)
|
||||
return namedBlockSelector(name, ^BOOL(HTMLElement * _Nonnull element) {
|
||||
NSUInteger elementIndex = [element.parentElement indexOfChildNode:element];
|
||||
|
||||
if (index > 0) {
|
||||
if (index >= 0) {
|
||||
return elementIndex == index;
|
||||
} else {
|
||||
return elementIndex == element.parentElement.childNodesCount - index - 1;
|
||||
|
||||
@@ -24,14 +24,25 @@
|
||||
{
|
||||
self = [super initWithName:name type:type];
|
||||
if (self) {
|
||||
_data = [[NSMutableString alloc] initWithString:data ?: @""];
|
||||
if (data) {
|
||||
_data = [[NSMutableString alloc] initWithString:data];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)data
|
||||
{
|
||||
if (_data == nil) {
|
||||
_data = [[NSMutableString alloc] initWithString:@""];
|
||||
}
|
||||
|
||||
return _data;
|
||||
}
|
||||
|
||||
- (NSString *)textContent
|
||||
{
|
||||
return [_data copy];
|
||||
return [self.data copy];
|
||||
}
|
||||
|
||||
- (void)setTextContent:(NSString *)textContent
|
||||
@@ -41,7 +52,7 @@
|
||||
|
||||
- (NSUInteger)length
|
||||
{
|
||||
return _data.length;
|
||||
return self.data.length;
|
||||
}
|
||||
|
||||
#pragma mark - Data
|
||||
@@ -81,7 +92,7 @@ NS_INLINE void CheckValidOffset(HTMLCharacterData *node, NSUInteger offset, NSSt
|
||||
|
||||
range.length = MIN(range.length, self.length - range.location);
|
||||
|
||||
[_data replaceCharactersInRange:range withString:data];
|
||||
[(NSMutableString *)self.data replaceCharactersInRange:range withString:data];
|
||||
[self.ownerDocument didRemoveCharacterDataInNode:self atOffset:range.location withLength:range.length];
|
||||
[self.ownerDocument didAddCharacterDataToNode:self atOffset:range.location withLength:data.length];
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
@interface HTMLDocument ()
|
||||
{
|
||||
HTMLDocument *_inertTemplateDocument;
|
||||
NSMutableArray *_nodeIterators;
|
||||
NSMutableArray *_ranges;
|
||||
NSHashTable *_nodeIterators;
|
||||
NSHashTable *_ranges;
|
||||
}
|
||||
@property (nonatomic, assign) HTMLDocumentReadyState readyState;
|
||||
@end
|
||||
@@ -41,8 +41,8 @@
|
||||
self = [super initWithName:@"#document" type:HTMLNodeDocument];
|
||||
if (self) {
|
||||
_readyState = HTMLDocumentLoading;
|
||||
_nodeIterators = [NSMutableArray new];
|
||||
_ranges = [NSMutableArray new];
|
||||
_nodeIterators = [[NSHashTable alloc] initWithOptions:NSHashTableWeakMemory capacity:10];
|
||||
_ranges = [[NSHashTable alloc] initWithOptions:NSHashTableWeakMemory capacity:10];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+24
-15
@@ -32,7 +32,7 @@
|
||||
|
||||
- (instancetype)initWithTagName:(NSString *)tagName
|
||||
{
|
||||
return [self initWithTagName:tagName attributes:@{}];
|
||||
return [self initWithTagName:tagName attributes:nil];
|
||||
}
|
||||
|
||||
- (instancetype)initWithTagName:(NSString *)tagName attributes:(NSDictionary *)attributes
|
||||
@@ -45,8 +45,9 @@
|
||||
self = [super initWithName:tagName type:HTMLNodeElement];
|
||||
if (self) {
|
||||
_tagName = [tagName copy];
|
||||
_attributes = [HTMLOrderedDictionary new];
|
||||
_attributes = nil;
|
||||
if (attributes != nil) {
|
||||
_attributes = [HTMLOrderedDictionary new];
|
||||
[_attributes addEntriesFromDictionary:attributes];
|
||||
}
|
||||
_htmlNamespace = htmlNamespace;
|
||||
@@ -56,24 +57,33 @@
|
||||
|
||||
#pragma mark - Special Attributes
|
||||
|
||||
- (NSMutableDictionary<NSString *,NSString *> *)attributes
|
||||
{
|
||||
if (_attributes == nil) {
|
||||
_attributes = [HTMLOrderedDictionary new];
|
||||
}
|
||||
|
||||
return _attributes;
|
||||
}
|
||||
|
||||
- (NSString *)elementId
|
||||
{
|
||||
return _attributes[@"id"] ?: @"";
|
||||
return self.attributes[@"id"] ?: @"";
|
||||
}
|
||||
|
||||
- (void)setElementId:(NSString *)elementId
|
||||
{
|
||||
_attributes[@"id"] = elementId;
|
||||
self.attributes[@"id"] = elementId;
|
||||
}
|
||||
|
||||
- (NSString *)className
|
||||
{
|
||||
return _attributes[@"class"] ?: @"";
|
||||
return self.attributes[@"class"] ?: @"";
|
||||
}
|
||||
|
||||
- (void)setClassName:(NSString *)className
|
||||
{
|
||||
_attributes[@"class"] = className;
|
||||
self.attributes[@"class"] = className;
|
||||
}
|
||||
|
||||
- (HTMLDOMTokenList *)classList
|
||||
@@ -85,22 +95,22 @@
|
||||
|
||||
- (BOOL)hasAttribute:(NSString *)name
|
||||
{
|
||||
return _attributes[name] != nil;
|
||||
return self.attributes[name] != nil;
|
||||
}
|
||||
|
||||
- (NSString *)objectForKeyedSubscript:(NSString *)name;
|
||||
{
|
||||
return _attributes[name];
|
||||
return self.attributes[name];
|
||||
}
|
||||
|
||||
- (void)setObject:(NSString *)value forKeyedSubscript:(NSString *)attribute
|
||||
{
|
||||
_attributes[attribute] = value;
|
||||
self.attributes[attribute] = value;
|
||||
}
|
||||
|
||||
- (void)removeAttribute:(NSString *)name
|
||||
{
|
||||
[_attributes removeObjectForKey:name];
|
||||
[self.attributes removeObjectForKey:name];
|
||||
}
|
||||
|
||||
- (NSString *)textContent
|
||||
@@ -134,7 +144,7 @@
|
||||
{
|
||||
HTMLElement *copy = [super copyWithZone:zone];
|
||||
copy->_tagName = [_tagName copy];
|
||||
copy->_attributes = [_attributes copy];
|
||||
copy->_attributes = [_attributes mutableCopy];
|
||||
copy->_htmlNamespace = _htmlNamespace;
|
||||
return copy;
|
||||
}
|
||||
@@ -147,11 +157,10 @@
|
||||
|
||||
[result appendFormat:@"<%@", self.tagName];
|
||||
[self.attributes enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
|
||||
NSRange range = NSMakeRange(0, value.length);
|
||||
NSMutableString *escaped = [value mutableCopy];
|
||||
[escaped replaceOccurrencesOfString:@"&" withString:@"&" options:0 range:range];
|
||||
[escaped replaceOccurrencesOfString:@"\00A0" withString:@" " options:0 range:range];
|
||||
[escaped replaceOccurrencesOfString:@"\"" withString:@""" options:0 range:range];
|
||||
[escaped replaceOccurrencesOfString:@"&" withString:@"&" options:0 range:NSMakeRange(0, escaped.length)];
|
||||
[escaped replaceOccurrencesOfString:@"0x00A0" withString:@" " options:0 range:NSMakeRange(0, escaped.length)];
|
||||
[escaped replaceOccurrencesOfString:@"\"" withString:@""" options:0 range:NSMakeRange(0, escaped.length)];
|
||||
|
||||
[result appendFormat:@" %@=\"%@\"", key, escaped];
|
||||
}];
|
||||
|
||||
@@ -48,10 +48,10 @@
|
||||
|
||||
#pragma mark - Errors
|
||||
|
||||
- (void)emitParseError:(NSString *)reason
|
||||
- (void)emitParseError:(NSString *)code details:(NSString *)details
|
||||
{
|
||||
if (self.errorCallback) {
|
||||
self.errorCallback(reason);
|
||||
self.errorCallback(code, details);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,16 +82,16 @@
|
||||
return LINE_FEED;
|
||||
}
|
||||
if (CFStringIsSurrogateLowCharacter(nextInputCharacter)) {
|
||||
NSString *reason = [NSString stringWithFormat:@"Non-Unicode character found (an isolated low surrogate: 0x%X)", (unsigned int)nextInputCharacter];
|
||||
[self emitParseError:reason];
|
||||
NSString *details = [NSString stringWithFormat:@"Non-Unicode character found (an isolated low surrogate: 0x%X)", (unsigned int)nextInputCharacter];
|
||||
[self emitParseError:@"surrogate-in-input-stream" details:details];
|
||||
return nextInputCharacter;
|
||||
}
|
||||
|
||||
if (CFStringIsSurrogateHighCharacter(nextInputCharacter)) {
|
||||
UniChar surrogateLow = CFStringGetCharacterFromInlineBuffer(&_buffer, _location + 1);
|
||||
if (CFStringIsSurrogateLowCharacter(surrogateLow) == NO) {
|
||||
NSString *reason = [NSString stringWithFormat:@"Non-Unicode character found (an isolated high surrogate: 0x%X)", (unsigned int)nextInputCharacter];
|
||||
[self emitParseError:reason];
|
||||
NSString *details = [NSString stringWithFormat:@"Non-Unicode character found (an isolated high surrogate: 0x%X)", (unsigned int)nextInputCharacter];
|
||||
[self emitParseError:@"surrogate-in-input-stream" details:details];
|
||||
return nextInputCharacter;
|
||||
}
|
||||
|
||||
@@ -99,9 +99,14 @@
|
||||
nextInputCharacter = CFStringGetLongCharacterForSurrogatePair(nextInputCharacter, surrogateLow);
|
||||
}
|
||||
|
||||
if (isControlOrUndefinedCharacter(nextInputCharacter)) {
|
||||
NSString *reason = [NSString stringWithFormat:@"A control/undefined character found: (0x%X)", (unsigned int)nextInputCharacter];
|
||||
[self emitParseError:reason];
|
||||
if (isControlCharacter(nextInputCharacter)) {
|
||||
NSString *details = [NSString stringWithFormat:@"A control character found: (0x%X)", (unsigned int)nextInputCharacter];
|
||||
[self emitParseError:@"control-character-in-input-stream" details:details];
|
||||
}
|
||||
|
||||
if (isNoncharacter(nextInputCharacter)) {
|
||||
NSString *details = [NSString stringWithFormat:@"A noncharacter found: (0x%X)", (unsigned int)nextInputCharacter];
|
||||
[self emitParseError:@"noncharacter-in-input-stream" details:details];
|
||||
}
|
||||
|
||||
return nextInputCharacter;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.0</string>
|
||||
<string>2.1.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
- (void)addElement:(HTMLElement *)element
|
||||
{
|
||||
NSUInteger existing = 0;
|
||||
for (HTMLElement *node in _list.reverseObjectEnumerator.allObjects) {
|
||||
for (HTMLElement *node in _list.reverseObjectEnumerator) {
|
||||
if ([node isEqual:[HTMLMarker marker]]) {
|
||||
break;
|
||||
}
|
||||
|
||||
+60
-37
@@ -19,6 +19,10 @@
|
||||
#import "HTMLDocument+Private.h"
|
||||
#import "HTMLDOMUtils.h"
|
||||
|
||||
NSString * const ValidationNodePreInsertion = @"-ensurePreInsertionValidityOfNode:beforeChildNode:";
|
||||
NSString * const ValidationNodeReplacement = @"-ensureReplacementValidityOfChildNode:withNode:";
|
||||
NSString * const RemoveChildNode = @"-removeChildNode:";
|
||||
|
||||
@interface HTMLNode ()
|
||||
{
|
||||
NSMutableOrderedSet *_childNodes;
|
||||
@@ -36,13 +40,22 @@
|
||||
if (self) {
|
||||
_name = name;
|
||||
_nodeType = type;
|
||||
_childNodes = [NSMutableOrderedSet new];
|
||||
_childNodes = nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Properties
|
||||
|
||||
- (NSOrderedSet<HTMLNode *> *)childNodes
|
||||
{
|
||||
if (_childNodes == nil) {
|
||||
_childNodes = [NSMutableOrderedSet new];
|
||||
}
|
||||
|
||||
return _childNodes;
|
||||
}
|
||||
|
||||
- (HTMLDocument *)ownerDocument
|
||||
{
|
||||
if (_nodeType == HTMLNodeDocument) {
|
||||
@@ -55,7 +68,9 @@
|
||||
- (void)setOwnerDocument:(HTMLDocument *)ownerDocument
|
||||
{
|
||||
_ownerDocument = ownerDocument;
|
||||
[self.childNodes.array makeObjectsPerformSelector:@selector(setOwnerDocument:) withObject:ownerDocument];
|
||||
for (HTMLNode *child in _childNodes) {
|
||||
[child setOwnerDocument:ownerDocument];
|
||||
}
|
||||
}
|
||||
|
||||
- (HTMLNode *)rootNode
|
||||
@@ -75,12 +90,12 @@
|
||||
|
||||
- (HTMLNode *)firstChild
|
||||
{
|
||||
return self.childNodes.firstObject;
|
||||
return _childNodes.firstObject;
|
||||
}
|
||||
|
||||
- (HTMLNode *)lastChild
|
||||
{
|
||||
return self.childNodes.lastObject;
|
||||
return _childNodes.lastObject;
|
||||
}
|
||||
|
||||
- (HTMLNode *)previousSibling
|
||||
@@ -112,7 +127,7 @@
|
||||
|
||||
- (HTMLElement *)nextSiblingElement
|
||||
{
|
||||
HTMLNode *node = self.previousSibling;
|
||||
HTMLNode *node = self.nextSibling;
|
||||
while (node && node.nodeType != HTMLNodeElement) {
|
||||
node = node.nextSibling;
|
||||
}
|
||||
@@ -121,7 +136,7 @@
|
||||
|
||||
- (NSUInteger)index
|
||||
{
|
||||
return [self.parentNode indexOfChildNode:self];
|
||||
return [_parentNode indexOfChildNode:self];
|
||||
}
|
||||
|
||||
- (NSString *)textContent
|
||||
@@ -145,12 +160,16 @@
|
||||
|
||||
- (BOOL)hasChildNodes
|
||||
{
|
||||
return self.childNodes.count > 0;
|
||||
return _childNodes.count > 0;
|
||||
}
|
||||
|
||||
- (BOOL)hasChildNodeOfType:(HTMLNodeType)type
|
||||
{
|
||||
NSUInteger index = [self.childNodes indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {
|
||||
if (_childNodes == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSUInteger index = [_childNodes indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {
|
||||
if ([(HTMLNode *)obj nodeType] == type) {
|
||||
*stop = YES;
|
||||
return YES;
|
||||
@@ -163,7 +182,7 @@
|
||||
|
||||
- (NSUInteger)childNodesCount
|
||||
{
|
||||
return self.childNodes.count;
|
||||
return _childNodes.count;
|
||||
}
|
||||
|
||||
- (BOOL)isEmpty
|
||||
@@ -173,25 +192,25 @@
|
||||
|
||||
- (HTMLNode *)childNodeAtIndex:(NSUInteger)index
|
||||
{
|
||||
return [self.childNodes objectAtIndex:index];
|
||||
return [_childNodes objectAtIndex:index];
|
||||
}
|
||||
|
||||
- (NSUInteger)childElementsCount
|
||||
{
|
||||
return [self.childNodes indexesOfObjectsPassingTest:^BOOL(HTMLNode * _Nonnull node, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
return [_childNodes indexesOfObjectsPassingTest:^BOOL(HTMLNode * _Nonnull node, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
return node.nodeType == HTMLNodeElement;
|
||||
}].count;
|
||||
}
|
||||
|
||||
- (NSUInteger)indexOfChildNode:(HTMLNode *)node
|
||||
{
|
||||
return [self.childNodes indexOfObject:node];
|
||||
return [_childNodes indexOfObject:node];
|
||||
}
|
||||
|
||||
- (HTMLElement *)childElementAtIndex:(NSUInteger)index
|
||||
{
|
||||
NSUInteger counter = 0;
|
||||
for (HTMLNode *node in self.childNodes) {
|
||||
for (HTMLNode *node in _childNodes) {
|
||||
if (node.nodeType == HTMLNodeElement) {
|
||||
if (counter == index) {
|
||||
return node.asElement;
|
||||
@@ -205,7 +224,7 @@
|
||||
- (NSUInteger)indexOfChildElement:(HTMLElement *)element
|
||||
{
|
||||
NSUInteger counter = 0;
|
||||
for (HTMLNode *node in self.childNodes) {
|
||||
for (HTMLNode *node in _childNodes) {
|
||||
if (node.nodeType == HTMLNodeElement) {
|
||||
if (node == element) {
|
||||
return counter;
|
||||
@@ -262,7 +281,9 @@
|
||||
[node removeAllChildNodes];
|
||||
}
|
||||
|
||||
[nodes makeObjectsPerformSelector:@selector(setParentNode:) withObject:self];
|
||||
for (HTMLNode *node in nodes) {
|
||||
[node setParentNode:self];
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -290,7 +311,7 @@
|
||||
|
||||
- (void)removeFromParentNode
|
||||
{
|
||||
[self.parentNode removeChildNode:self];
|
||||
[_parentNode removeChildNode:self];
|
||||
}
|
||||
|
||||
- (HTMLNode *)removeChildNode:(HTMLNode *)child
|
||||
@@ -298,7 +319,7 @@
|
||||
if (child.parentNode != self) {
|
||||
[NSException raise:HTMLKitNotFoundError
|
||||
format:@"%@: Not Fount Error, removing non-child node %@. The object can not be found here.",
|
||||
NSStringFromSelector(_cmd), child];
|
||||
RemoveChildNode, child];
|
||||
}
|
||||
|
||||
HTMLNode *oldNode = child;
|
||||
@@ -322,16 +343,18 @@
|
||||
|
||||
- (void)reparentChildNodesIntoNode:(HTMLNode *)node
|
||||
{
|
||||
for (HTMLNode *child in self.childNodes.array) {
|
||||
for (HTMLNode *child in _childNodes) {
|
||||
[node appendNode:child];
|
||||
}
|
||||
[(NSMutableOrderedSet *)self.childNodes removeAllObjects];
|
||||
[(NSMutableOrderedSet *)_childNodes removeAllObjects];
|
||||
}
|
||||
|
||||
- (void)removeAllChildNodes
|
||||
{
|
||||
[self.childNodes.array makeObjectsPerformSelector:@selector(setParentNode:) withObject:nil];
|
||||
[(NSMutableOrderedSet *)self.childNodes removeAllObjects];
|
||||
for (HTMLNode *child in _childNodes) {
|
||||
[child setParentNode:nil];
|
||||
}
|
||||
[(NSMutableOrderedSet *)_childNodes removeAllObjects];
|
||||
}
|
||||
|
||||
- (HTMLDocumentPosition)compareDocumentPositionWithNode:(HTMLNode *)otherNode
|
||||
@@ -402,7 +425,7 @@
|
||||
return self.nodeType != HTMLNodeDocument && self.ownerDocument == otherNode;
|
||||
}
|
||||
|
||||
for (HTMLNode *parentNode = self.parentNode; parentNode; parentNode = parentNode.parentNode) {
|
||||
for (HTMLNode *parentNode = _parentNode; parentNode; parentNode = parentNode.parentNode) {
|
||||
if (parentNode == otherNode) {
|
||||
return YES;
|
||||
}
|
||||
@@ -424,7 +447,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
[self.childNodes enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
[_childNodes enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
block(obj, idx, stop);
|
||||
}];
|
||||
}
|
||||
@@ -435,7 +458,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
[self.childNodes enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
[_childNodes enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
if ([obj isKindOfClass:[HTMLElement class]]) {
|
||||
block([obj asElement], idx, stop);
|
||||
}
|
||||
@@ -558,18 +581,18 @@ NS_INLINE void CheckInvalidCombination(HTMLNode *parent, HTMLNode *node, NSStrin
|
||||
|
||||
- (void)ensurePreInsertionValidityOfNode:(HTMLNode *)node beforeChildNode:(HTMLNode *)child
|
||||
{
|
||||
CheckParentValid(self, NSStringFromSelector(_cmd));
|
||||
CheckParentValid(self, ValidationNodePreInsertion);
|
||||
|
||||
CheckChildsParent(self, child, NSStringFromSelector(_cmd));
|
||||
CheckChildsParent(self, child, ValidationNodePreInsertion);
|
||||
|
||||
CheckInsertedNodeValid(node, NSStringFromSelector(_cmd));
|
||||
CheckInsertedNodeValid(node, ValidationNodePreInsertion);
|
||||
|
||||
CheckInvalidCombination(self, node, NSStringFromSelector(_cmd));
|
||||
CheckInvalidCombination(self, node, ValidationNodePreInsertion);
|
||||
|
||||
void (^ hierarchyError)() = ^{
|
||||
void (^ hierarchyError)(void) = ^{
|
||||
[NSException raise:HTMLKitHierarchyRequestError
|
||||
format:@"%@: Hierarchy Request Error, inserting (%@) into (%@). The operation would yield an incorrect node tree.",
|
||||
NSStringFromSelector(_cmd), self, node];
|
||||
ValidationNodePreInsertion, self, node];
|
||||
};
|
||||
|
||||
if (self.nodeType == HTMLNodeDocument) {
|
||||
@@ -608,18 +631,18 @@ NS_INLINE void CheckInvalidCombination(HTMLNode *parent, HTMLNode *node, NSStrin
|
||||
|
||||
- (void)ensureReplacementValidityOfChildNode:(HTMLNode *)child withNode:(HTMLNode *)node
|
||||
{
|
||||
CheckParentValid(self, NSStringFromSelector(_cmd));
|
||||
CheckParentValid(self, ValidationNodeReplacement);
|
||||
|
||||
CheckChildsParent(self, child, NSStringFromSelector(_cmd));
|
||||
CheckChildsParent(self, child, ValidationNodeReplacement);
|
||||
|
||||
CheckInsertedNodeValid(node, NSStringFromSelector(_cmd));
|
||||
CheckInsertedNodeValid(node, ValidationNodeReplacement);
|
||||
|
||||
CheckInvalidCombination(self, node, NSStringFromSelector(_cmd));
|
||||
CheckInvalidCombination(self, node, ValidationNodeReplacement);
|
||||
|
||||
void (^ hierarchyError)() = ^{
|
||||
void (^ hierarchyError)(void) = ^{
|
||||
[NSException raise:HTMLKitHierarchyRequestError
|
||||
format:@"%@: Hierarchy Request Error. The operation would yield an incorrect node tree.",
|
||||
NSStringFromSelector(_cmd)];
|
||||
ValidationNodeReplacement];
|
||||
};
|
||||
|
||||
void (^ checkParentHasAnotherChildOfType)(HTMLNodeType) = ^ void (HTMLNodeType type) {
|
||||
@@ -675,7 +698,7 @@ NS_INLINE void CheckInvalidCombination(HTMLNode *parent, HTMLNode *node, NSStrin
|
||||
HTMLNode *copy = [self copy];
|
||||
|
||||
if (deep) {
|
||||
for (HTMLNode *child in self.childNodes) {
|
||||
for (HTMLNode *child in _childNodes) {
|
||||
[copy appendNode:[child cloneNodeDeep:YES]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
@interface HTMLNodeFilterBlock ()
|
||||
{
|
||||
BOOL (^ _block)(HTMLNode *);
|
||||
HTMLNodeFilterValue (^ _block)(HTMLNode *);
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@@ -154,4 +154,11 @@
|
||||
return [_keys countByEnumeratingWithState:state objects:buffer count:len];
|
||||
}
|
||||
|
||||
#pragma mark - Copying
|
||||
|
||||
- (id)mutableCopy
|
||||
{
|
||||
return [[HTMLOrderedDictionary alloc] initWithDictionary:self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -10,29 +10,46 @@
|
||||
|
||||
@interface HTMLParseErrorToken ()
|
||||
{
|
||||
NSString *_reason;
|
||||
NSString *_code;
|
||||
NSString *_details;
|
||||
NSUInteger _location;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation HTMLParseErrorToken
|
||||
@synthesize reason = _reason;
|
||||
@synthesize code = _code;
|
||||
@synthesize details = _details;
|
||||
@synthesize location = _location;
|
||||
|
||||
- (instancetype)initWithReasonMessage:(NSString *)reason andStreamLocation:(NSUInteger)location
|
||||
- (instancetype)initWithCode:(NSString *)code details:(NSString *)details location:(NSUInteger)location
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.type = HTMLTokenTypeParseError;
|
||||
_reason = [reason copy];
|
||||
_code = [code copy];
|
||||
_details = [details copy];
|
||||
_location = location;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)other
|
||||
{
|
||||
if ([other isKindOfClass:[self class]]) {
|
||||
HTMLParseErrorToken *token = (HTMLParseErrorToken *)other;
|
||||
return bothNilOrEqual(self.code, token.code);
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSUInteger)hash
|
||||
{
|
||||
return self.code.hash + self.code.hash;
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@: %p Reason='%@' Location='%lu'>", self.class, self, _reason, (unsigned long)_location];
|
||||
return [NSString stringWithFormat:@"<%@: %p Code='%@' Details='%@' Location='%lu'>", self.class, self, _code, _details, (unsigned long)_location];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+15
-15
@@ -73,6 +73,10 @@
|
||||
|
||||
_tokenizer = [[HTMLTokenizer alloc] initWithString:string ?: @""];
|
||||
_tokenizer.parser = self;
|
||||
__weak HTMLParser *weakSelf = self;
|
||||
_tokenizer.parseErrorCallback = ^(HTMLParseErrorToken *token) {
|
||||
[weakSelf emitParseError:@"Tokenization error: %@", token.asParseError];
|
||||
};
|
||||
|
||||
_pendingTableCharacterTokens = [[HTMLCharacterToken alloc] initWithString:@""];
|
||||
|
||||
@@ -130,6 +134,10 @@
|
||||
[self initializeDocument];
|
||||
_tokenizer = [[HTMLTokenizer alloc] initWithString:_tokenizer.string];
|
||||
_tokenizer.parser = self;
|
||||
__weak HTMLParser *weakSelf = self;
|
||||
_tokenizer.parseErrorCallback = ^(HTMLParseErrorToken *token) {
|
||||
[weakSelf emitParseError:@"Tokenization error: %@", token.asParseError];
|
||||
};
|
||||
|
||||
_contextElement = contextElement;
|
||||
_fragmentParsingAlgorithm = YES;
|
||||
@@ -226,11 +234,6 @@
|
||||
return NO;
|
||||
};
|
||||
|
||||
if (token.isParseError) {
|
||||
[self emitParseError:@"Tokenizer Parser Error: %@", token.asParseError];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_ignoreNextLineFeedCharacterToken) {
|
||||
_ignoreNextLineFeedCharacterToken = NO;
|
||||
if (token.isCharacterToken) {
|
||||
@@ -1272,7 +1275,7 @@
|
||||
@"dd": @[@"dd", @"dt"],
|
||||
@"dt": @[@"dd", @"dt"]};
|
||||
|
||||
for (HTMLElement *node in _stackOfOpenElements.reverseObjectEnumerator.allObjects) {
|
||||
for (HTMLElement *node in _stackOfOpenElements.reverseObjectEnumerator) {
|
||||
if ([map[tagName] containsObject:node.tagName]) {
|
||||
[self generateImpliedEndTagsExceptForElement:node.tagName];
|
||||
if (![self.currentNode.tagName isEqualToString:node.tagName]) {
|
||||
@@ -1440,7 +1443,6 @@
|
||||
} else if ([tagName isEqualToString:@"math"]) {
|
||||
[self reconstructActiveFormattingElements];
|
||||
AdjustMathMLAttributes(token);
|
||||
AdjustForeignAttributes(token);
|
||||
[self insertForeignElementForToken:token inNamespace:HTMLNamespaceMathML];
|
||||
if (token.isSelfClosing) {
|
||||
[_stackOfOpenElements popCurrentNode];
|
||||
@@ -1448,7 +1450,6 @@
|
||||
} else if ([tagName isEqualToString:@"svg"]) {
|
||||
[self reconstructActiveFormattingElements];
|
||||
AdjustSVGAttributes(token);
|
||||
AdjustForeignAttributes(token);
|
||||
[self insertForeignElementForToken:token inNamespace:HTMLNamespaceSVG];
|
||||
if (token.isSelfClosing) {
|
||||
[_stackOfOpenElements popCurrentNode];
|
||||
@@ -1529,7 +1530,7 @@
|
||||
}
|
||||
[self closePElement];
|
||||
} else if ([tagName isEqualToString:@"li"]) {
|
||||
if (![_stackOfOpenElements hasElementInListItemScopeWithTagName:@"li"]) {
|
||||
if (![_stackOfOpenElements hasElementInListItemScopeWithTagName:tagName]) {
|
||||
[self emitParseError:@"Unexpected <li> element in <body>"];
|
||||
return;
|
||||
}
|
||||
@@ -1549,7 +1550,7 @@
|
||||
}
|
||||
[_stackOfOpenElements popElementsUntilElementPoppedWithTagName:tagName];
|
||||
} else if ([tagName isEqualToAny:@"h1", @"h2", @"h3", @"h4", @"h5", @"h6", nil]) {
|
||||
if (![_stackOfOpenElements hasAnyElementInScopeWithAnyOfTagNames:@[@"h1", @"h2", @"h3", @"h4", @"h5", @"h6"]]) {
|
||||
if (![_stackOfOpenElements hasHeaderElementInScope]) {
|
||||
[self emitParseError:@"Unexpected <%@> element in <body>", tagName];
|
||||
return;
|
||||
}
|
||||
@@ -1569,7 +1570,7 @@
|
||||
return;
|
||||
}
|
||||
} else if ([tagName isEqualToAny:@"applet", @"marquee", @"object", nil]) {
|
||||
if (![_stackOfOpenElements hasAnyElementInScopeWithAnyOfTagNames:@[@"applet", @"marquee", @"object"]]) {
|
||||
if (![_stackOfOpenElements hasElementInScopeWithTagName:tagName]) {
|
||||
[self emitParseError:@"Unexpected <%@> element in <body>", tagName];
|
||||
return;
|
||||
}
|
||||
@@ -1590,7 +1591,7 @@
|
||||
|
||||
- (void)processAnyOtherEndTagTokenInBody:(HTMLTagToken *)token
|
||||
{
|
||||
for (HTMLElement *node in _stackOfOpenElements.reverseObjectEnumerator.allObjects) {
|
||||
for (HTMLElement *node in _stackOfOpenElements.reverseObjectEnumerator) {
|
||||
if ([node.tagName isEqualToString:token.tagName]) {
|
||||
[self generateImpliedEndTagsExceptForElement:token.tagName];
|
||||
if (![node.tagName isEqualToString:self.currentNode.tagName]) {
|
||||
@@ -2530,7 +2531,7 @@
|
||||
return;
|
||||
case HTMLTokenTypeStartTag:
|
||||
{
|
||||
void (^ anythingElse)() = ^ {
|
||||
void (^ anythingElse)(void) = ^ {
|
||||
if (self.adjustedCurrentNode.htmlNamespace == HTMLNamespaceMathML) {
|
||||
AdjustMathMLAttributes(token.asTagToken);
|
||||
}
|
||||
@@ -2538,14 +2539,13 @@
|
||||
AdjustSVGNameCase(token.asTagToken);
|
||||
AdjustSVGAttributes(token.asTagToken);
|
||||
}
|
||||
AdjustForeignAttributes(token.asTagToken);
|
||||
[self insertForeignElementForToken:token.asTagToken inNamespace:self.adjustedCurrentNode.htmlNamespace];
|
||||
if (token.asTagToken.selfClosing) {
|
||||
[_stackOfOpenElements popCurrentNode];
|
||||
}
|
||||
};
|
||||
|
||||
void (^ matchedCase)() = ^ {
|
||||
void (^ matchedCase)(void) = ^ {
|
||||
[self emitParseError:@"Unexpected start tag <%@> in foreign content", token.asTagToken.tagName];
|
||||
if (_fragmentParsingAlgorithm) {
|
||||
anythingElse();
|
||||
|
||||
+19
-5
@@ -23,14 +23,28 @@
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
- (instancetype)initWithDocument:(HTMLDocument *)document
|
||||
{
|
||||
return [self initWithDocument:document startContainer:document startOffset:0 endContainer:document endOffset:0];
|
||||
}
|
||||
|
||||
- (instancetype)initWithDowcument:(HTMLDocument *)document
|
||||
{
|
||||
return [self initWithDowcument:document startContainer:document startOffset:0 endContainer:document endOffset:0];
|
||||
return [self initWithDocument:document startContainer:document startOffset:0 endContainer:document endOffset:0];
|
||||
}
|
||||
|
||||
- (instancetype)initWithDowcument:(HTMLDocument *)document
|
||||
startContainer:(HTMLNode *)startContainer startOffset:(NSUInteger)startOffset
|
||||
endContainer:(HTMLNode *)endContainer endOffset:(NSUInteger)endOffset
|
||||
{
|
||||
return [self initWithDocument:document
|
||||
startContainer:startContainer startOffset:startOffset
|
||||
endContainer:endContainer endOffset:endOffset];
|
||||
}
|
||||
|
||||
- (instancetype)initWithDocument:(HTMLDocument *)document
|
||||
startContainer:(HTMLNode *)startContainer startOffset:(NSUInteger)startOffset
|
||||
endContainer:(HTMLNode *)endContainer endOffset:(NSUInteger)endOffset
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
@@ -517,7 +531,7 @@ NS_INLINE HTMLCharacterData * CloneCharachterData(HTMLNode *node, NSUInteger sta
|
||||
HTMLNode *clone = [firstPartiallyContainedChild copy];
|
||||
[fragment appendNode:clone];
|
||||
|
||||
HTMLRange *subRange = [[HTMLRange alloc] initWithDowcument:_ownerDocument
|
||||
HTMLRange *subRange = [[HTMLRange alloc] initWithDocument:_ownerDocument
|
||||
startContainer:_startContainer
|
||||
startOffset:_startOffset
|
||||
endContainer:firstPartiallyContainedChild
|
||||
@@ -537,7 +551,7 @@ NS_INLINE HTMLCharacterData * CloneCharachterData(HTMLNode *node, NSUInteger sta
|
||||
HTMLNode *clone = [lastPartiallyContainedChild copy];
|
||||
[fragment appendNode:clone];
|
||||
|
||||
HTMLRange *subRange = [[HTMLRange alloc] initWithDowcument:_ownerDocument
|
||||
HTMLRange *subRange = [[HTMLRange alloc] initWithDocument:_ownerDocument
|
||||
startContainer:lastPartiallyContainedChild
|
||||
startOffset:0
|
||||
endContainer:_endContainer
|
||||
@@ -580,7 +594,7 @@ NS_INLINE HTMLCharacterData * CloneCharachterData(HTMLNode *node, NSUInteger sta
|
||||
HTMLNode *clone = [firstPartiallyContainedChild copy];
|
||||
[fragment appendNode:clone];
|
||||
|
||||
HTMLRange *subRange = [[HTMLRange alloc] initWithDowcument:_ownerDocument
|
||||
HTMLRange *subRange = [[HTMLRange alloc] initWithDocument:_ownerDocument
|
||||
startContainer:_startContainer
|
||||
startOffset:_startOffset
|
||||
endContainer:firstPartiallyContainedChild
|
||||
@@ -601,7 +615,7 @@ NS_INLINE HTMLCharacterData * CloneCharachterData(HTMLNode *node, NSUInteger sta
|
||||
HTMLNode *clone = [lastPartiallyContainedChild copy];
|
||||
[fragment appendNode:clone];
|
||||
|
||||
HTMLRange *subRange = [[HTMLRange alloc] initWithDowcument:_ownerDocument
|
||||
HTMLRange *subRange = [[HTMLRange alloc] initWithDocument:_ownerDocument
|
||||
startContainer:lastPartiallyContainedChild
|
||||
startOffset:0
|
||||
endContainer:_endContainer
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
@interface HTMLStackOfOpenElements ()
|
||||
{
|
||||
NSMutableArray *_stack;
|
||||
NSDictionary *_specificScopeElementTypes;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -27,26 +26,6 @@
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_stack = [NSMutableArray new];
|
||||
_specificScopeElementTypes = @{
|
||||
@"applet": @(HTMLNamespaceHTML),
|
||||
@"caption": @(HTMLNamespaceHTML),
|
||||
@"html": @(HTMLNamespaceHTML),
|
||||
@"table": @(HTMLNamespaceHTML),
|
||||
@"td": @(HTMLNamespaceHTML),
|
||||
@"th": @(HTMLNamespaceHTML),
|
||||
@"marquee": @(HTMLNamespaceHTML),
|
||||
@"object": @(HTMLNamespaceHTML),
|
||||
@"template": @(HTMLNamespaceHTML),
|
||||
@"mi": @(HTMLNamespaceMathML),
|
||||
@"mo": @(HTMLNamespaceMathML),
|
||||
@"mn": @(HTMLNamespaceMathML),
|
||||
@"ms": @(HTMLNamespaceMathML),
|
||||
@"mtext": @(HTMLNamespaceMathML),
|
||||
@"annotation-xml": @(HTMLNamespaceMathML),
|
||||
@"foreignObject": @(HTMLNamespaceSVG),
|
||||
@"desc": @(HTMLNamespaceSVG),
|
||||
@"title": @(HTMLNamespaceSVG)
|
||||
};
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -195,82 +174,148 @@
|
||||
|
||||
#pragma mark - Element Scope
|
||||
|
||||
NS_INLINE BOOL IsSpecificScopeElement(HTMLElement *element)
|
||||
{
|
||||
switch (element.htmlNamespace) {
|
||||
case HTMLNamespaceHTML:
|
||||
return [element.tagName isEqualToAny:@"applet", @"caption", @"html", @"table", @"td", @"th", @"marquee", @"object", @"template", nil];
|
||||
case HTMLNamespaceMathML:
|
||||
return [element.tagName isEqualToAny:@"mi", @"mo", @"mn", @"ms", @"mtext", @"annotation-xml", nil];
|
||||
case HTMLNamespaceSVG:
|
||||
return [element.tagName isEqualToAny:@"foreignObject", @"desc", @"title", nil];
|
||||
}
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsHeaderElement(HTMLElement *element)
|
||||
{
|
||||
if (element.htmlNamespace != HTMLNamespaceHTML) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [element.tagName isEqualToAny:@"h1", @"h2", @"h3", @"h4", @"h5", @"h6", nil];
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsTableScopeElement(HTMLElement *element)
|
||||
{
|
||||
if (element.htmlNamespace != HTMLNamespaceHTML) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [element.tagName isEqualToAny:@"html", @"table", @"template", nil];
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsListItemScopeElement(HTMLElement *element)
|
||||
{
|
||||
if (element.htmlNamespace != HTMLNamespaceHTML) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [element.tagName isEqualToAny:@"ol", @"ul", nil];
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsSelectScopeElement(HTMLElement *element)
|
||||
{
|
||||
if (element.htmlNamespace != HTMLNamespaceHTML) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return ![element.tagName isEqualToString:@"optgroup"] && ![element.tagName isEqualToString:@"option"];
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsButtonScopeElement(HTMLElement *element)
|
||||
{
|
||||
if (element.htmlNamespace != HTMLNamespaceHTML) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [element.tagName isEqualToString:@"button"];
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInScopeWithTagName:(NSString *)tagName;
|
||||
{
|
||||
return [self hasAnyElementInSpecificScopeWithTagNames:@[tagName] andElementTypes:_specificScopeElementTypes];
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasAnyElementInScopeWithAnyOfTagNames:(NSArray *)tagNames
|
||||
{
|
||||
return [self hasAnyElementInSpecificScopeWithTagNames:tagNames andElementTypes:_specificScopeElementTypes];
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInListItemScopeWithTagName:(NSString *)tagName
|
||||
{
|
||||
NSMutableDictionary *elementTypes = [NSMutableDictionary dictionaryWithDictionary:_specificScopeElementTypes];
|
||||
[elementTypes addEntriesFromDictionary:@{@"ol": @(HTMLNamespaceHTML),
|
||||
@"ul": @(HTMLNamespaceHTML)}];
|
||||
|
||||
return [self hasElementInSpecificScopeWithTagName:tagName
|
||||
andElementTypes:elementTypes];
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInButtonScopeWithTagName:(NSString *)tagName
|
||||
{
|
||||
NSMutableDictionary *elementTypes = [NSMutableDictionary dictionaryWithDictionary:_specificScopeElementTypes];
|
||||
[elementTypes addEntriesFromDictionary:@{@"button": @(HTMLNamespaceHTML)}];
|
||||
|
||||
return [self hasElementInSpecificScopeWithTagName:tagName
|
||||
andElementTypes:elementTypes];
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInTableScopeWithTagName:(NSString *)tagName
|
||||
{
|
||||
return [self hasElementInSpecificScopeWithTagName:tagName
|
||||
andElementTypes:@{@"html": @(HTMLNamespaceHTML),
|
||||
@"table": @(HTMLNamespaceHTML),
|
||||
@"template": @(HTMLNamespaceHTML)}];
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInTableScopeWithAnyOfTagNames:(NSArray *)tagNames
|
||||
{
|
||||
return [self hasAnyElementInSpecificScopeWithTagNames:tagNames
|
||||
andElementTypes:@{@"html": @(HTMLNamespaceHTML),
|
||||
@"table": @(HTMLNamespaceHTML),
|
||||
@"template": @(HTMLNamespaceHTML)}];
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInSelectScopeWithTagName:(NSString *)tagName
|
||||
{
|
||||
for (HTMLElement *node in _stack.reverseObjectEnumerator) {
|
||||
if ([node.tagName isEqualToString:tagName]) {
|
||||
if (node.htmlNamespace == HTMLNamespaceHTML && [tagName isEqualToString:node.tagName]) {
|
||||
return node;
|
||||
}
|
||||
if (!(node.htmlNamespace == HTMLNamespaceHTML &&
|
||||
[node.tagName isEqualToAny:@"optgroup", @"option", nil])) {
|
||||
if (IsSpecificScopeElement(node)) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInSpecificScopeWithTagName:(NSString *)tagName
|
||||
andElementTypes:(NSDictionary *)elementTypes
|
||||
{
|
||||
return [self hasAnyElementInSpecificScopeWithTagNames:@[tagName] andElementTypes:elementTypes];
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasAnyElementInSpecificScopeWithTagNames:(NSArray *)tagNames
|
||||
andElementTypes:(NSDictionary *)elementTypes
|
||||
- (HTMLElement *)hasHeaderElementInScope
|
||||
{
|
||||
for (HTMLElement *node in _stack.reverseObjectEnumerator) {
|
||||
if ([tagNames containsObject:node.tagName]) {
|
||||
NSNumber *namespace = elementTypes[node.tagName] ?: @(HTMLNamespaceHTML);
|
||||
if ([namespace isEqual:@(node.htmlNamespace)]) {
|
||||
return node;
|
||||
}
|
||||
if (IsHeaderElement(node)) {
|
||||
return node;
|
||||
}
|
||||
if ([elementTypes[node.tagName] isEqual:@(node.htmlNamespace)]) {
|
||||
if (IsSpecificScopeElement(node)) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInTableScopeWithTagName:(NSString *)tagName
|
||||
{
|
||||
for (HTMLElement *node in _stack.reverseObjectEnumerator) {
|
||||
if (node.htmlNamespace == HTMLNamespaceHTML && [tagName isEqualToString:node.tagName]) {
|
||||
return node;
|
||||
}
|
||||
if (IsTableScopeElement(node)) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInTableScopeWithAnyOfTagNames:(NSArray *)tagNames
|
||||
{
|
||||
for (HTMLElement *node in _stack.reverseObjectEnumerator) {
|
||||
if (node.htmlNamespace == HTMLNamespaceHTML && [tagNames containsObject:node.tagName]) {
|
||||
return node;
|
||||
}
|
||||
if (IsTableScopeElement(node)) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInListItemScopeWithTagName:(NSString *)tagName
|
||||
{
|
||||
for (HTMLElement *node in _stack.reverseObjectEnumerator) {
|
||||
if (node.htmlNamespace == HTMLNamespaceHTML && [tagName isEqualToString:node.tagName]) {
|
||||
return node;
|
||||
}
|
||||
if (IsSpecificScopeElement(node) || IsListItemScopeElement(node)) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInButtonScopeWithTagName:(NSString *)tagName
|
||||
{
|
||||
for (HTMLElement *node in _stack.reverseObjectEnumerator) {
|
||||
if (node.htmlNamespace == HTMLNamespaceHTML && [tagName isEqualToString:node.tagName]) {
|
||||
return node;
|
||||
}
|
||||
if (IsSpecificScopeElement(node) || IsButtonScopeElement(node)) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (HTMLElement *)hasElementInSelectScopeWithTagName:(NSString *)tagName
|
||||
{
|
||||
for (HTMLElement *node in _stack.reverseObjectEnumerator) {
|
||||
if (node.htmlNamespace == HTMLNamespaceHTML && [tagName isEqualToString:node.tagName]) {
|
||||
return node;
|
||||
}
|
||||
if (IsSelectScopeElement(node)) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -74,12 +74,11 @@ NS_INLINE void CheckValidOffset(HTMLNode *node, NSUInteger offset, NSString *cmd
|
||||
@"plaintext", @"noscript", nil]) {
|
||||
return self.data;
|
||||
} else {
|
||||
NSRange range = NSMakeRange(0, self.data.length);
|
||||
NSMutableString *escaped = [self.data mutableCopy];
|
||||
[escaped replaceOccurrencesOfString:@"&" withString:@"&" options:0 range:range];
|
||||
[escaped replaceOccurrencesOfString:@"\00A0" withString:@" " options:0 range:range];
|
||||
[escaped replaceOccurrencesOfString:@"<" withString:@"<" options:0 range:range];
|
||||
[escaped replaceOccurrencesOfString:@">" withString:@">" options:0 range:range];
|
||||
[escaped replaceOccurrencesOfString:@"&" withString:@"&" options:0 range:NSMakeRange(0, escaped.length)];
|
||||
[escaped replaceOccurrencesOfString:@"\00A0" withString:@" " options:0 range:NSMakeRange(0, escaped.length)];
|
||||
[escaped replaceOccurrencesOfString:@"<" withString:@"<" options:0 range:NSMakeRange(0, escaped.length)];
|
||||
[escaped replaceOccurrencesOfString:@">" withString:@">" options:0 range:NSMakeRange(0, escaped.length)];
|
||||
return escaped;
|
||||
}
|
||||
}
|
||||
|
||||
+821
-650
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
Initializes and returns a CSS has-descendant selector, e.g. 'div:has(p)'
|
||||
|
||||
@discussion 'div:has(p)' matches all <div> elements which have a descendant <p> element.
|
||||
@discussion 'div:has(p)' matches all <div> elements which have a descendant <p> element.
|
||||
|
||||
@param selector The selector matching a descendant element.
|
||||
@return A new instance of the has-descendant selector.
|
||||
|
||||
@@ -76,7 +76,7 @@ extern NSString * _Nonnull NSStringFromNthExpression(CSSNthExpression expression
|
||||
@param string The selector string which will be parsed.
|
||||
@return A new instance of a parsed CSS Selector, `nil` if the string is not a valid selector string.
|
||||
*/
|
||||
+ (nullable instancetype)selectorWithString:(NSString *)stirng;
|
||||
+ (nullable instancetype)selectorWithString:(NSString *)string;
|
||||
|
||||
/**
|
||||
Implementations should override this method to provide the selector-sprecific logic for matching elements.
|
||||
|
||||
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@return The universal CSS selector.
|
||||
*/
|
||||
extern CSSSelector * universalSelector();
|
||||
extern CSSSelector * universalSelector(void);
|
||||
|
||||
/**
|
||||
CSS type selector, e.g. 'div', 'p', ...etc.
|
||||
@@ -125,7 +125,7 @@ extern CSSSelector * nthLastOfTypeSelector(CSSNthExpression expression);
|
||||
|
||||
@return Odd-Child selector.
|
||||
*/
|
||||
extern CSSSelector * oddSelector();
|
||||
extern CSSSelector * oddSelector(void);
|
||||
|
||||
/**
|
||||
CSS even-child selector: ':nth-child(even)'
|
||||
@@ -134,49 +134,49 @@ extern CSSSelector * oddSelector();
|
||||
|
||||
@return Even-Child selector.
|
||||
*/
|
||||
extern CSSSelector * evenSlector();
|
||||
extern CSSSelector * evenSlector(void);
|
||||
|
||||
/**
|
||||
CSS first-child selector: ':nth-child(1)'
|
||||
|
||||
@return First-Child selector.
|
||||
*/
|
||||
extern CSSSelector * firstChildSelector();
|
||||
extern CSSSelector * firstChildSelector(void);
|
||||
|
||||
/**
|
||||
CSS first-child selector: ':nth-last-child(1)'
|
||||
|
||||
@return First-Child selector.
|
||||
*/
|
||||
extern CSSSelector * lastChildSelector();
|
||||
extern CSSSelector * lastChildSelector(void);
|
||||
|
||||
/**
|
||||
CSS first-of-type selector: ':nth-first-of-type(1)'
|
||||
|
||||
@return First-Of-Type selector.
|
||||
*/
|
||||
extern CSSSelector * firstOfTypeSelector();
|
||||
extern CSSSelector * firstOfTypeSelector(void);
|
||||
|
||||
/**
|
||||
CSS last-of-type selector: ':nth-last-of-type(1)'
|
||||
|
||||
@return Last-Of-Type selector.
|
||||
*/
|
||||
extern CSSSelector * lastOfTypeSelector();
|
||||
extern CSSSelector * lastOfTypeSelector(void);
|
||||
|
||||
/**
|
||||
CSS only-child selector: ':first-child:last-child'
|
||||
|
||||
@return Only-Child selector.
|
||||
*/
|
||||
extern CSSSelector * onlyChildSelector();
|
||||
extern CSSSelector * onlyChildSelector(void);
|
||||
|
||||
/**
|
||||
CSS only-of-type selector: ':first-of-type:last-of-type'
|
||||
|
||||
@return Only-Of-Type selector.
|
||||
*/
|
||||
extern CSSSelector * onlyOfTypeSelector();
|
||||
extern CSSSelector * onlyOfTypeSelector(void);
|
||||
|
||||
#pragma mark - Combinators
|
||||
|
||||
@@ -225,7 +225,7 @@ extern CSSSelector * not(CSSSelector *selector);
|
||||
/**
|
||||
CSS has-descendant selector, e.g. 'div:has(p)'
|
||||
|
||||
@discussion 'div:has(p)' matches all <div> elements which have a descendant <p> element.
|
||||
@discussion 'div:has(p)' matches all <div> elements which have a descendant <p> element.
|
||||
|
||||
@param selector The selector matching a descendant element.
|
||||
@return A has-descendant selector.
|
||||
|
||||
@@ -15,102 +15,102 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
@return Root element selector: ':root'
|
||||
*/
|
||||
extern CSSSelector * rootSelector();
|
||||
extern CSSSelector * rootSelector(void);
|
||||
|
||||
/**
|
||||
@return Empy element selector: ':empty'
|
||||
*/
|
||||
extern CSSSelector * emptySelector();
|
||||
extern CSSSelector * emptySelector(void);
|
||||
|
||||
/**
|
||||
@return A parent element selector: ':parent'
|
||||
*/
|
||||
extern CSSSelector * parentSelector();
|
||||
extern CSSSelector * parentSelector(void);
|
||||
|
||||
/**
|
||||
@return A button element selector: ':button'
|
||||
*/
|
||||
extern CSSSelector * buttonSelector();
|
||||
extern CSSSelector * buttonSelector(void);
|
||||
|
||||
/**
|
||||
@return A checkbox element selector: ':checkbox'
|
||||
*/
|
||||
extern CSSSelector * checkboxSelector();
|
||||
extern CSSSelector * checkboxSelector(void);
|
||||
|
||||
/**
|
||||
@return A file element selector: ':file'
|
||||
*/
|
||||
extern CSSSelector * fileSelector();
|
||||
extern CSSSelector * fileSelector(void);
|
||||
|
||||
/**
|
||||
@return A header element selector: ':header'
|
||||
*/
|
||||
extern CSSSelector * headerSelector();
|
||||
extern CSSSelector * headerSelector(void);
|
||||
|
||||
/**
|
||||
@return An image element selector: ':image'
|
||||
*/
|
||||
extern CSSSelector * imageSelector();
|
||||
extern CSSSelector * imageSelector(void);
|
||||
|
||||
/**
|
||||
@return A parent element selector: ':parent'
|
||||
*/
|
||||
extern CSSSelector * inputSelector();
|
||||
extern CSSSelector * inputSelector(void);
|
||||
|
||||
/**
|
||||
@return A link element selector: ':link'
|
||||
*/
|
||||
extern CSSSelector * linkSelector();
|
||||
extern CSSSelector * linkSelector(void);
|
||||
|
||||
/**
|
||||
@return A password element selector: ':password'
|
||||
*/
|
||||
extern CSSSelector * passwordSelector();
|
||||
extern CSSSelector * passwordSelector(void);
|
||||
|
||||
/**
|
||||
@return A radio element selector: ':radio'
|
||||
*/
|
||||
extern CSSSelector * radioSelector();
|
||||
extern CSSSelector * radioSelector(void);
|
||||
|
||||
/**
|
||||
@return A reset element selector: ':reset'
|
||||
*/
|
||||
extern CSSSelector * resetSelector();
|
||||
extern CSSSelector * resetSelector(void);
|
||||
|
||||
/**
|
||||
@return A submit element selector: ':submit'
|
||||
*/
|
||||
extern CSSSelector * submitSelector();
|
||||
extern CSSSelector * submitSelector(void);
|
||||
|
||||
/**
|
||||
@return A text element selector: ':text'
|
||||
*/
|
||||
extern CSSSelector * textSelector();
|
||||
extern CSSSelector * textSelector(void);
|
||||
|
||||
/**
|
||||
@return An enabled element selector: ':enabled'
|
||||
*/
|
||||
extern CSSSelector * enabledSelector();
|
||||
extern CSSSelector * enabledSelector(void);
|
||||
|
||||
/**
|
||||
@return A disabled element selector: ':disabled'
|
||||
*/
|
||||
extern CSSSelector * disabledSelector();
|
||||
extern CSSSelector * disabledSelector(void);
|
||||
|
||||
/**
|
||||
@return A checked element selector: ':checked'
|
||||
*/
|
||||
extern CSSSelector * checkedSelector();
|
||||
extern CSSSelector * checkedSelector(void);
|
||||
|
||||
/**
|
||||
@return An optional element selector: ':optional'
|
||||
*/
|
||||
extern CSSSelector * optionalSelector();
|
||||
extern CSSSelector * optionalSelector(void);
|
||||
|
||||
/**
|
||||
@return A required element selector: ':required'
|
||||
*/
|
||||
extern CSSSelector * requiredSelector();
|
||||
extern CSSSelector * requiredSelector(void);
|
||||
|
||||
/**
|
||||
Less-than selector, e.g. 'lt(2)'
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
/**
|
||||
Initializes a new comment token.
|
||||
|
||||
@param string The string with which to initialize the token.
|
||||
@param data The string with which to initialize the token.
|
||||
@return A new instance of a comment token.
|
||||
*/
|
||||
- (instancetype)initWithData:(NSString *)data;
|
||||
|
||||
@@ -24,3 +24,5 @@
|
||||
#import "HTMLKitDOMExceptions.h"
|
||||
#import "HTMLNamespaces.h"
|
||||
#import "HTMLQuirksMode.h"
|
||||
|
||||
#import "HTMLOrderedDictionary.h"
|
||||
|
||||
@@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
Initializes a new HTML element with the given tag name.
|
||||
|
||||
@param tagname The tag name.
|
||||
@param tagName The tag name.
|
||||
@return A new HTML element.
|
||||
*/
|
||||
- (instancetype)initWithTagName:(NSString *)tagName;
|
||||
@@ -71,21 +71,21 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
Initializes a new HTML element with the given tag name and attributes.
|
||||
|
||||
@param tagname The tag name.
|
||||
@param tagName The tag name.
|
||||
@param attributes The attributes.
|
||||
@return A new HTML element.
|
||||
*/
|
||||
- (instancetype)initWithTagName:(NSString *)tagName attributes:(NSDictionary<NSString *, NSString *> *)attributes;
|
||||
- (instancetype)initWithTagName:(NSString *)tagName attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
|
||||
|
||||
/**
|
||||
Initializes a new HTML element with the given tag name, namespace, and attributes.
|
||||
|
||||
@param tagname The tag name.
|
||||
@param namespace The namespace.
|
||||
@param tagName The tag name.
|
||||
@param htmlNamespace The HTML namespace.
|
||||
@param attributes The attributes.
|
||||
@return A new HTML element.
|
||||
*/
|
||||
- (instancetype)initWithTagName:(NSString *)tagName namespace:(HTMLNamespace)htmlNamespace attributes:(NSDictionary<NSString *, NSString *> *)attributes;
|
||||
- (instancetype)initWithTagName:(NSString *)tagName namespace:(HTMLNamespace)htmlNamespace attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
|
||||
|
||||
/**
|
||||
Checks whether this element has an attribute with the given name.
|
||||
@@ -107,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
Set the value of the attribute with the given name.
|
||||
|
||||
@param value The value to set.
|
||||
@param name The attribute's name.
|
||||
@param attribute The attribute's name.
|
||||
*/
|
||||
- (void)setObject:(NSString *)value forKeyedSubscript:(NSString *)attribute;
|
||||
|
||||
|
||||
@@ -140,31 +140,3 @@ NS_INLINE void AdjustSVGNameCase(HTMLTagToken *token)
|
||||
NSString *replacement = replacements[token.tagName] ?: token.tagName;
|
||||
token.tagName = replacement;
|
||||
}
|
||||
|
||||
NS_INLINE void AdjustForeignAttributes(HTMLTagToken *token)
|
||||
{
|
||||
if (token.attributes == nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSDictionary *replacements = @{ @"xlink:actuate": @"xlink actuate",
|
||||
@"xlink:arcrole": @"xlink arcrole",
|
||||
@"xlink:href": @"xlink href",
|
||||
@"xlink:role": @"xlink role",
|
||||
@"xlink:show": @"xlink show",
|
||||
@"xlink:title": @"xlink title",
|
||||
@"xlink:type": @"xlink type",
|
||||
@"xml:base": @"xml base",
|
||||
@"xml:lang": @"xml lang",
|
||||
@"xml:space": @"xml space",
|
||||
@"xmlns": @"xmlns",
|
||||
@"xmlns:xlink": @"xmlns xlink"};
|
||||
|
||||
HTMLOrderedDictionary *adjusted = [HTMLOrderedDictionary new];
|
||||
for (id key in token.attributes) {
|
||||
NSString *replacement = replacements[key] ?: key;
|
||||
adjusted[replacement] = token.attributes[key];
|
||||
}
|
||||
token.attributes = adjusted;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
/**
|
||||
Typedef for the error callback block.
|
||||
|
||||
@param reason The string describing the reason of the reported error.
|
||||
@param code The standarized error-code
|
||||
@param details The string describing the reason of the reported error.
|
||||
*/
|
||||
typedef void (^ HTMLStreamReaderErrorCallback)(NSString *reason);
|
||||
typedef void (^ HTMLStreamReaderErrorCallback)(NSString *code, NSString *details);
|
||||
|
||||
/**
|
||||
* HTML Input Stream Reader processor conforming to the HTML standard
|
||||
|
||||
@@ -232,7 +232,7 @@ typedef NS_OPTIONS(unsigned short, HTMLDocumentPosition)
|
||||
/**
|
||||
Returns the index of the given child element in the set of child nodes.
|
||||
|
||||
@param node The element.
|
||||
@param element The element.
|
||||
@return The index of the given element in the children set.
|
||||
*/
|
||||
- (NSUInteger)indexOfChildElement:(HTMLElement *)element;
|
||||
@@ -248,7 +248,7 @@ typedef NS_OPTIONS(unsigned short, HTMLDocumentPosition)
|
||||
/**
|
||||
Prepends the given array of nodes to the set of child nodes.
|
||||
|
||||
@param node The nodes to prepend.
|
||||
@param nodes The nodes to prepend.
|
||||
*/
|
||||
- (void)prependNodes:(NSArray<HTMLNode *> *)nodes;
|
||||
|
||||
|
||||
@@ -18,19 +18,22 @@
|
||||
*/
|
||||
@interface HTMLParseErrorToken : HTMLToken
|
||||
|
||||
/** @brief The error's reason message. */
|
||||
@property (nonatomic, copy) NSString *reason;
|
||||
/** @brief The parse error's code as specified at https://html.spec.whatwg.org/multipage/parsing.html#parse-errors. */
|
||||
@property (nonatomic, strong, readonly) NSString *code;
|
||||
|
||||
/** @brief Additional detailed error information. */
|
||||
@property (nonatomic, strong, readonly) NSString *details;
|
||||
|
||||
/** @brief The error's location in the stream. */
|
||||
@property (nonatomic, assign) NSUInteger location;
|
||||
@property (nonatomic, assign, readonly) NSUInteger location;
|
||||
|
||||
/**
|
||||
Initializes a new Parse Error token.
|
||||
|
||||
@param reason The error's reason message.
|
||||
@param code The parse error's as specified at https://html.spec.whatwg.org/multipage/parsing.html#parse-errors.
|
||||
@param location The error's location in the stream.
|
||||
@return A new instance of a parse error token.
|
||||
*/
|
||||
- (instancetype)initWithReasonMessage:(NSString *)reason andStreamLocation:(NSUInteger)location;
|
||||
- (instancetype)initWithCode:(NSString *)code details:(NSString *)details location:(NSUInteger)location;
|
||||
|
||||
@end
|
||||
|
||||
@@ -81,7 +81,12 @@ typedef NS_ENUM(unsigned short, HTMLRangeComparisonMethod)
|
||||
@param document The HTML doucment for which the range will be constructed.
|
||||
@return A new HTML Range instance.
|
||||
*/
|
||||
- (instancetype)initWithDowcument:(HTMLDocument *)document;
|
||||
- (instancetype)initWithDocument:(HTMLDocument *)document;
|
||||
|
||||
/**
|
||||
Deprecated due to typo.
|
||||
*/
|
||||
- (instancetype)initWithDowcument:(HTMLDocument *)document __attribute__((deprecated("Replaced by -initWithDocument:")));
|
||||
|
||||
/**
|
||||
Initializes a new range instance for the given document and boundaries.
|
||||
@@ -93,23 +98,31 @@ typedef NS_ENUM(unsigned short, HTMLRangeComparisonMethod)
|
||||
@param endOffset The offset of the end boundary
|
||||
@return A new HTML Range instance.
|
||||
*/
|
||||
- (instancetype)initWithDocument:(HTMLDocument *)document
|
||||
startContainer:(HTMLNode *)startContainer startOffset:(NSUInteger)startOffset
|
||||
endContainer:(HTMLNode *)endContainer endOffset:(NSUInteger)endOffset;
|
||||
|
||||
/**
|
||||
Deprecated due to typo.
|
||||
*/
|
||||
- (instancetype)initWithDowcument:(HTMLDocument *)document
|
||||
startContainer:(HTMLNode *)startContainer startOffset:(NSUInteger)startOffset
|
||||
endContainer:(HTMLNode *)endContainer endOffset:(NSUInteger)endOffset;
|
||||
endContainer:(HTMLNode *)endContainer endOffset:(NSUInteger)endOffset
|
||||
__attribute__((deprecated("Replaced by -initWithDocument:startContainer:startOffset:endContainer:endOffset:")));
|
||||
|
||||
/**
|
||||
Sets the start boundary.
|
||||
|
||||
@param startNode The new node of the start boundary.
|
||||
@param startOffset The new offset of the start boundary.
|
||||
@param node The new node of the start boundary.
|
||||
@param offset The new offset of the start boundary.
|
||||
*/
|
||||
- (void)setStartNode:(HTMLNode *)node startOffset:(NSUInteger)offset;
|
||||
|
||||
/**
|
||||
Sets the end boundary.
|
||||
|
||||
@param startNode The new node of the end boundary.
|
||||
@param startOffset The new offset of the end boundary.
|
||||
@param node The new node of the end boundary.
|
||||
@param offset The new offset of the end boundary.
|
||||
*/
|
||||
- (void)setEndNode:(HTMLNode *)node endOffset:(NSUInteger)offset;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
/**
|
||||
Checks whether an element with the given tag name is in the stack.
|
||||
|
||||
@param tagname The element's tag name.
|
||||
@param tagName The element's tag name.
|
||||
@return `YES` if such an element is in the stack, `NO` otherwise.
|
||||
*/
|
||||
- (BOOL)containsElementWithTagName:(NSString *)tagName;
|
||||
@@ -163,11 +163,11 @@
|
||||
https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-the-specific-scope
|
||||
*/
|
||||
- (HTMLElement *)hasElementInScopeWithTagName:(NSString *)tagName;
|
||||
- (HTMLElement *)hasAnyElementInScopeWithAnyOfTagNames:(NSArray *)tagNames;
|
||||
- (HTMLElement *)hasElementInListItemScopeWithTagName:(NSString *)tagName;
|
||||
- (HTMLElement *)hasElementInButtonScopeWithTagName:(NSString *)tagName;
|
||||
- (HTMLElement *)hasHeaderElementInScope;
|
||||
- (HTMLElement *)hasElementInTableScopeWithTagName:(NSString *)tagName;
|
||||
- (HTMLElement *)hasElementInTableScopeWithAnyOfTagNames:(NSArray *)tagNames;
|
||||
- (HTMLElement *)hasElementInListItemScopeWithTagName:(NSString *)tagName;
|
||||
- (HTMLElement *)hasElementInButtonScopeWithTagName:(NSString *)tagName;
|
||||
- (HTMLElement *)hasElementInSelectScopeWithTagName:(NSString *)tagName;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,13 @@
|
||||
|
||||
@class HTMLParser;
|
||||
|
||||
/**
|
||||
Typedef for the parse error callback block.
|
||||
|
||||
@param token The parse error token.
|
||||
*/
|
||||
typedef void (^ HTMLTokenizerParseErrorCallback)(HTMLParseErrorToken *token);
|
||||
|
||||
/**
|
||||
* HTML Tokenizer
|
||||
* https://html.spec.whatwg.org/multipage/syntax.html#tokenization
|
||||
@@ -39,6 +46,13 @@
|
||||
*/
|
||||
@property (nonatomic, weak) HTMLParser *parser;
|
||||
|
||||
/**
|
||||
An error callback block, which gets called when encountering parse errors while tokenizing the stream
|
||||
|
||||
Parse error tokens are dropped if the callback is `nil`.
|
||||
*/
|
||||
@property (nonatomic, copy) HTMLTokenizerParseErrorCallback parseErrorCallback;
|
||||
|
||||
/**
|
||||
Initializes a new Tokenizer with the given string.
|
||||
|
||||
|
||||
@@ -23,11 +23,16 @@
|
||||
CHAR( DIGIT_NINE, 0x0039 ) \
|
||||
CHAR( LATIN_CAPITAL_LETTER_A, 0x0041 ) \
|
||||
CHAR( LATIN_CAPITAL_LETTER_F, 0x0046 ) \
|
||||
CHAR( LATIN_CAPITAL_LETTER_P, 0x0050 ) \
|
||||
CHAR( LATIN_CAPITAL_LETTER_S, 0x0053 ) \
|
||||
CHAR( LATIN_CAPITAL_LETTER_X, 0x0058 ) \
|
||||
CHAR( LATIN_CAPITAL_LETTER_Z, 0x005A ) \
|
||||
CHAR( RIGHT_SQUARE_BRACKET, 0x005D ) \
|
||||
CHAR( GRAVE_ACCENT, 0x0060 ) \
|
||||
CHAR( LATIN_SMALL_LETTER_A, 0x0061 ) \
|
||||
CHAR( LATIN_SMALL_LETTER_F, 0x0066 ) \
|
||||
CHAR( LATIN_SMALL_LETTER_P, 0x0070 ) \
|
||||
CHAR( LATIN_SMALL_LETTER_S, 0x0073 ) \
|
||||
CHAR( LATIN_SMALL_LETTER_X, 0x0078 ) \
|
||||
CHAR( LATIN_SMALL_LETTER_Z, 0x007A ) \
|
||||
CHAR( HYPHEN_MINUS, 0x002D ) \
|
||||
@@ -82,13 +87,17 @@ NUMERIC_REPLACEMENT_CHARACTERS
|
||||
#undef CHAR
|
||||
};
|
||||
|
||||
NS_INLINE BOOL isControlOrUndefinedCharacter(UTF32Char character)
|
||||
NS_INLINE BOOL isControlCharacter(unsigned long long character)
|
||||
{
|
||||
return ((character >= 0x0001 && character <= 0x0008) ||
|
||||
(character >= 0x000D && character <= 0x001F) ||
|
||||
(character >= 0x007F && character <= 0x009F) ||
|
||||
(character >= 0xFDD0 && character <= 0xFDEF) ||
|
||||
character == 0x000B ||
|
||||
(character >= 0x000E && character <= 0x001F) ||
|
||||
(character >= 0x007F && character <= 0x009F));
|
||||
}
|
||||
|
||||
NS_INLINE BOOL isNoncharacter(unsigned long long character)
|
||||
{
|
||||
return ((character >= 0xFDD0 && character <= 0xFDEF) ||
|
||||
character == 0xFFFE ||
|
||||
character == 0xFFFF ||
|
||||
character == 0x1FFFE ||
|
||||
@@ -137,6 +146,18 @@ NS_INLINE BOOL isHexDigit(UTF32Char character)
|
||||
(character >= LATIN_SMALL_LETTER_A && character <= LATIN_SMALL_LETTER_F));
|
||||
}
|
||||
|
||||
NS_INLINE BOOL isUpperHexDigit(UTF32Char character)
|
||||
{
|
||||
return ((character >= LATIN_CAPITAL_LETTER_A && character <= LATIN_CAPITAL_LETTER_F) ||
|
||||
(character >= DIGIT_ZERO && character <= DIGIT_NINE));
|
||||
}
|
||||
|
||||
NS_INLINE BOOL isLowerHexDigit(UTF32Char character)
|
||||
{
|
||||
return ((character >= LATIN_SMALL_LETTER_A && character <= LATIN_SMALL_LETTER_F) ||
|
||||
(character >= DIGIT_ZERO && character <= DIGIT_NINE));
|
||||
}
|
||||
|
||||
NS_INLINE BOOL isAlphanumeric(UTF32Char character)
|
||||
{
|
||||
return ((character >= DIGIT_ZERO && character <= DIGIT_NINE) ||
|
||||
@@ -151,17 +172,14 @@ NS_INLINE BOOL isStringAlphanumeric(NSString *string)
|
||||
return ([string rangeOfCharacterFromSet:set].location == NSNotFound);
|
||||
}
|
||||
|
||||
NS_INLINE BOOL isInvalidNumericRange(unsigned long long numeric)
|
||||
NS_INLINE BOOL isSurrogate(unsigned long long character)
|
||||
{
|
||||
return ((numeric >= 0xD800 && numeric <= 0xDFFF) ||
|
||||
numeric > 0x10FFFF);
|
||||
return (character >= 0xD800 && character <= 0xDFFF);
|
||||
}
|
||||
|
||||
NS_INLINE unichar NumericReplacementCharacter(UTF32Char character)
|
||||
{
|
||||
if (character == NULL_CHAR) {
|
||||
return REPLACEMENT_CHAR;
|
||||
} else if (character >= 0x0080 && character <= 0x009F) {
|
||||
if (character >= 0x0080 && character <= 0x009F) {
|
||||
return NumericReplacementTable[character - 0x0080];
|
||||
} else {
|
||||
return NULL_CHAR;
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
|
||||
#define TOKENIZER_STATES \
|
||||
STATE_ENTRY( HTMLTokenizerStateData, = 0) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCharacterReferenceInData, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateRCDATA, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCharacterReferenceInRCDATA, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateRAWTEXT, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateScriptData, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStatePLAINTEXT, ) \
|
||||
@@ -59,6 +57,10 @@
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentStart, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentStartDash, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateComment, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentLessThanSign, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentLessThanSignBang, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentLessThanSignBangDash, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentLessThanSignBangDashDash, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentEndDash, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentEnd, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCommentEndBang, ) \
|
||||
@@ -78,7 +80,18 @@
|
||||
STATE_ENTRY( HTMLTokenizerStateDOCTYPESystemIdentifierSingleQuoted, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateAfterDOCTYPESystemIdentifier, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateBogusDOCTYPE, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCDATASection, )
|
||||
STATE_ENTRY( HTMLTokenizerStateCDATASection, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCDATASectionBracket, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCDATASectionEnd, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateCharacterReference, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateNamedCharacterReference, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateAmbiguousAmpersand, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateNumericCharacterReference, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateHexadecimalCharacterReferenceStart, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateDecimalCharacterReferenceStart, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateHexadecimalCharacterReference, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateDecimalCharacterReference, ) \
|
||||
STATE_ENTRY( HTMLTokenizerStateNumericCharacterReferenceEnd, )
|
||||
|
||||
typedef NS_ENUM(NSUInteger, HTMLTokenizerState)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
Initializes a new tree walker with no filter and HTMLNodeFilterShowAll show options.
|
||||
|
||||
@param node The root node.
|
||||
@param filter The node filter to use.
|
||||
@return A new instance of a tree walker.
|
||||
*/
|
||||
- (instancetype)initWithNode:(HTMLNode *)node;
|
||||
|
||||
@@ -5,7 +5,7 @@ module HTMLKit {
|
||||
export *
|
||||
|
||||
explicit module Private {
|
||||
header "CSSCodePoints.h"
|
||||
textual header "CSSCodePoints.h"
|
||||
header "CSSInputStream.h"
|
||||
header "HTMLCharacterToken.h"
|
||||
header "HTMLCommentToken.h"
|
||||
@@ -22,7 +22,7 @@ module HTMLKit {
|
||||
header "HTMLTagToken.h"
|
||||
header "HTMLToken.h"
|
||||
header "HTMLTokenizer.h"
|
||||
header "HTMLTokenizerCharacters.h"
|
||||
textual header "HTMLTokenizerCharacters.h"
|
||||
header "HTMLTokenizerEntities.h"
|
||||
header "HTMLTokenizerStates.h"
|
||||
header "HTMLTokens.h"
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import <HTMLKit/HTMLKit.h>
|
||||
#import "HTMLKit.h"
|
||||
#import "CSSSelectorTest.h"
|
||||
#import "CSSSelectorParser.h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#import "HTMLDocument.h"
|
||||
#import "HTMLElement.h"
|
||||
#import "CSSSelectors.h"
|
||||
#import "HTMLKitTestUtil.h"
|
||||
|
||||
static NSString * const CSSTests = @"css-tests";
|
||||
|
||||
@@ -18,8 +19,7 @@ static NSString * const CSSTests = @"css-tests";
|
||||
|
||||
+ (NSArray *)loadCSSSelectorTests
|
||||
{
|
||||
NSString *path = [[NSBundle bundleForClass:self.class] resourcePath];
|
||||
path = [path stringByAppendingPathComponent:CSSTests];
|
||||
NSString *path = [HTMLKitTestUtil pathForFixture:CSSTests ofType:nil inDirectory:nil];
|
||||
|
||||
NSMutableArray *tests = [NSMutableArray array];
|
||||
NSArray *testFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// CSSStructuralPseudoSelectors.m
|
||||
// HTMLKit
|
||||
//
|
||||
// Created by Iska on 18.04.18.
|
||||
// Copyright © 2018 BrainCookie. All rights reserved.
|
||||
//
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "CSSSelectors.h"
|
||||
#import "HTMLParser.h"
|
||||
#import "HTMLDOM.h"
|
||||
|
||||
@interface CSSStructuralPseudoSelectors : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation CSSStructuralPseudoSelectors
|
||||
|
||||
#pragma mark - Bug Fixes
|
||||
|
||||
- (void)testBugFix_Issue_25
|
||||
{
|
||||
NSString *html = @"<table><tr><td>TD #0</td><td>TD #1</td><td>TD #2</td><td>TD #3</td></tr></table>";
|
||||
HTMLDocument *doc = [HTMLDocument documentWithString:html];
|
||||
NSArray<HTMLElement *> *elements = [doc querySelectorAll:@"td:gt(0)"];
|
||||
|
||||
XCTAssertEqual(elements.count, 3);
|
||||
XCTAssertEqualObjects(elements[0].textContent, @"TD #1");
|
||||
XCTAssertEqualObjects(elements[1].textContent, @"TD #2");
|
||||
XCTAssertEqualObjects(elements[2].textContent, @"TD #3");
|
||||
|
||||
elements = [doc querySelectorAll:@"td:lt(0)"];
|
||||
XCTAssertEqual(elements.count, 0);
|
||||
|
||||
elements = [doc querySelectorAll:@"td:eq(0)"];
|
||||
XCTAssertEqual(elements.count, 1);
|
||||
XCTAssertEqualObjects(elements[0].textContent, @"TD #0");
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -14,9 +14,9 @@
|
||||
@property (nonatomic, copy) NSString *title;
|
||||
@property (nonatomic, copy) NSString *input;
|
||||
@property (nonatomic, strong) NSArray *output;
|
||||
@property (nonatomic, strong) NSArray *errors;
|
||||
@property (nonatomic, strong) NSArray *initialStates;
|
||||
@property (nonatomic, copy) NSString *lastStartTag;
|
||||
@property (nonatomic, assign) BOOL ignoreErrorOrder;
|
||||
|
||||
+ (NSDictionary *)loadHTML5LibTokenizerTests;
|
||||
|
||||
@@ -7,23 +7,22 @@
|
||||
//
|
||||
|
||||
#import "HTML5LibTokenizerTest.h"
|
||||
#import "HTMLOrderedDictionary.h"
|
||||
#import "HTMLTokenizerStates.h"
|
||||
#import "HTMLTokens.h"
|
||||
#import "HTMLKitTestUtil.h"
|
||||
|
||||
static NSString * const HTML5LibTests = @"html5lib-tests";
|
||||
static NSString * const TOKENIZER = @"tokenizer";
|
||||
static NSString * const Tokenizer = @"tokenizer";
|
||||
|
||||
@implementation HTML5LibTokenizerTest
|
||||
|
||||
+ (NSDictionary *)loadHTML5LibTokenizerTests
|
||||
{
|
||||
NSString *path = [[NSBundle bundleForClass:self.class] resourcePath];
|
||||
path = [path stringByAppendingPathComponent:HTML5LibTests];
|
||||
path = [path stringByAppendingPathComponent:TOKENIZER];
|
||||
|
||||
NSMutableDictionary *testsMap = [NSMutableDictionary dictionary];
|
||||
NSString *path = [HTMLKitTestUtil pathForFixture:Tokenizer ofType:nil inDirectory:HTML5LibTests];
|
||||
NSArray *testFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
|
||||
|
||||
NSMutableDictionary *testsMap = [NSMutableDictionary dictionary];
|
||||
for (NSString *testFile in testFiles) {
|
||||
if (![testFile.pathExtension isEqualToString:@"test"]) {
|
||||
continue;
|
||||
@@ -71,16 +70,16 @@ static NSString * const TOKENIZER = @"tokenizer";
|
||||
{
|
||||
BOOL doubleEscaped = [test[@"doubleEscaped"] boolValue];
|
||||
|
||||
// Test Title
|
||||
// Test Title
|
||||
self.title = test[@"description"];
|
||||
|
||||
// Test Input
|
||||
// Test Input
|
||||
self.input = test[@"input"];
|
||||
if (doubleEscaped) {
|
||||
self.input = [self processDoubleEscaped:self.input];
|
||||
}
|
||||
|
||||
// Test Output
|
||||
// Test Output
|
||||
NSMutableArray *tokens = [NSMutableArray array];
|
||||
NSArray *outputs = test[@"output"];
|
||||
for (NSArray *output in outputs) {
|
||||
@@ -90,7 +89,7 @@ static NSString * const TOKENIZER = @"tokenizer";
|
||||
[tokens addObject:[HTMLEOFToken token]];
|
||||
self.output = tokens;
|
||||
|
||||
// Test Initial States
|
||||
// Test Initial States
|
||||
NSMutableArray *initialStates = [NSMutableArray array];
|
||||
|
||||
NSArray *states = test[@"initialStates"];
|
||||
@@ -102,6 +101,10 @@ static NSString * const TOKENIZER = @"tokenizer";
|
||||
state = HTMLTokenizerStateRCDATA;
|
||||
} else if ([name isEqualToString:@"RAWTEXT state"]) {
|
||||
state = HTMLTokenizerStateRAWTEXT;
|
||||
} else if ([name isEqualToString:@"Script data state"]) {
|
||||
state = HTMLTokenizerStateScriptData;
|
||||
} else if ([name isEqualToString:@"CDATA section state"]) {
|
||||
state = HTMLTokenizerStateCDATASection;
|
||||
}
|
||||
[initialStates addObject:@(state)];
|
||||
}
|
||||
@@ -111,19 +114,21 @@ static NSString * const TOKENIZER = @"tokenizer";
|
||||
|
||||
self.initialStates = initialStates;
|
||||
|
||||
// Test Last Start Tag
|
||||
// Test Last Start Tag
|
||||
self.lastStartTag = test[@"lastStartTag"];
|
||||
|
||||
// Ignore Error Order
|
||||
self.ignoreErrorOrder = [test[@"ignoreErrorOrder"] boolValue];
|
||||
// Test errors
|
||||
NSArray *errors = test[@"errors"];
|
||||
NSMutableArray *errorTokens = [NSMutableArray new];
|
||||
for (NSDictionary *error in errors) {
|
||||
HTMLParseErrorToken *token = [[HTMLParseErrorToken alloc] initWithCode:error[@"code"] details:nil location:0];
|
||||
[errorTokens addObject:token];
|
||||
}
|
||||
self.errors = errorTokens;
|
||||
}
|
||||
|
||||
- (HTMLToken *)processOutputToken:(id)output doubleEscaped:(BOOL)doubleEscaped
|
||||
{
|
||||
if ([output isKindOfClass:[NSString class]] && [output isEqualToString:@"ParseError"]) {
|
||||
return [HTMLParseErrorToken new];
|
||||
}
|
||||
|
||||
NSString *type = [output firstObject];
|
||||
|
||||
NSString *data = nil;
|
||||
@@ -147,8 +152,6 @@ static NSString * const TOKENIZER = @"tokenizer";
|
||||
return token;
|
||||
} else if ([type isEqualToString:@"EndTag"]) {
|
||||
return [[HTMLEndTagToken alloc] initWithTagName:data];
|
||||
} else if ([type isEqualToString:@"ParseError"]) {
|
||||
return [HTMLParseErrorToken new];
|
||||
} else if ([type isEqualToString:@"StartTag"]) {
|
||||
HTMLStartTagToken *token = [[HTMLStartTagToken alloc] initWithTagName:data];
|
||||
NSDictionary *attributes = output[2];
|
||||
+7
-6
@@ -9,10 +9,12 @@
|
||||
#import "HTML5LibTreeConstructionTest.h"
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#import "HTMLDOM.h"
|
||||
#import "HTMLDocumentType.h"
|
||||
#import "HTMLElement.h"
|
||||
#import "HTMLText.h"
|
||||
#import "HTMLComment.h"
|
||||
#import "HTMLKitTestUtil.h"
|
||||
|
||||
static NSString * const HTML5LibTests = @"html5lib-tests";
|
||||
static NSString * const TreeConstruction = @"tree-construction";
|
||||
@@ -21,13 +23,10 @@ static NSString * const TreeConstruction = @"tree-construction";
|
||||
|
||||
+ (NSDictionary *)loadHTML5LibTreeConstructionTests
|
||||
{
|
||||
NSString *path = [[NSBundle bundleForClass:self.class] resourcePath];
|
||||
path = [path stringByAppendingPathComponent:HTML5LibTests];
|
||||
path = [path stringByAppendingPathComponent:TreeConstruction];
|
||||
|
||||
NSMutableDictionary *testsMap = [NSMutableDictionary dictionary];
|
||||
NSString *path = [HTMLKitTestUtil pathForFixture:TreeConstruction ofType:nil inDirectory:HTML5LibTests];
|
||||
NSArray *testFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
|
||||
|
||||
NSMutableDictionary *testsMap = [NSMutableDictionary dictionary];
|
||||
for (NSString *testFile in testFiles) {
|
||||
if (![testFile.pathExtension isEqualToString:@"dat"]) {
|
||||
continue;
|
||||
@@ -48,7 +47,7 @@ static NSString * const TreeConstruction = @"tree-construction";
|
||||
NSMutableArray *tests = [NSMutableArray array];
|
||||
|
||||
NSScanner *scanner = [NSScanner scannerWithString:contents];
|
||||
NSString * (^ nextTest)() = ^ NSString * () {
|
||||
NSString * (^ nextTest)(void) = ^ NSString * () {
|
||||
NSString *str;
|
||||
[scanner scanUpToString:@"\n\n#data" intoString:&str];
|
||||
return str;
|
||||
@@ -291,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];
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// HTMLKitParserTests.m
|
||||
// HTMLKit
|
||||
//
|
||||
// Created by Iska on 16.07.18.
|
||||
// Copyright © 2018 BrainCookie. All rights reserved.
|
||||
//
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "HTMLDOM.h"
|
||||
|
||||
@interface HTMLKitParserIssuesTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation HTMLKitParserIssuesTests
|
||||
|
||||
#pragma mark - Bug Fixes
|
||||
|
||||
- (void)testBugFix_Issue_30 {
|
||||
NSString *html =
|
||||
@"<body>"
|
||||
" <svg id='draw_area' width='600' height='800' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"
|
||||
" <image id='overlay_img' xlink:href='foo.png' width='600' height='800'/>"
|
||||
" </svg>"
|
||||
"</body>";
|
||||
|
||||
HTMLDocument* document = [HTMLDocument documentWithString:html];
|
||||
HTMLElement *svg = [document querySelector:@"#draw_area"];
|
||||
|
||||
XCTAssertNil(svg.attributes[@"xlink"]);
|
||||
XCTAssertEqualObjects(svg.attributes[@"xmlns"], @"http://www.w3.org/2000/svg");
|
||||
XCTAssertEqualObjects(svg.attributes[@"xmlns:xlink"], @"http://www.w3.org/1999/xlink");
|
||||
|
||||
HTMLElement *image = [document querySelector:@"#overlay_img"];
|
||||
|
||||
XCTAssertNil(image.attributes[@"xlink"]);
|
||||
XCTAssertNil(image.attributes[@"href"]);
|
||||
XCTAssertEqualObjects(image.attributes[@"xlink:href"], @"foo.png");
|
||||
XCTAssertEqualObjects(image.outerHTML, @"<image id=\"overlay_img\" xlink:href=\"foo.png\" width=\"600\" height=\"800\"></image>");
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "HTMLParser.h"
|
||||
#import "HTMLKitTestUtil.h"
|
||||
|
||||
@interface HTMLKitParserPerformance : XCTestCase
|
||||
|
||||
@@ -17,10 +18,9 @@
|
||||
|
||||
#define HTMLKIT_NO_DOM_CHECKS
|
||||
|
||||
- (void)testParserPerformance
|
||||
- (void)_testParserPerformance
|
||||
{
|
||||
NSString *path = [[NSBundle bundleForClass:self.class] resourcePath];
|
||||
path = [path stringByAppendingPathComponent:@"HTML Standard.html"];
|
||||
NSString *path = [HTMLKitTestUtil pathForFixture:@"HTML Standard" ofType:@"html" inDirectory:@"Fixtures"];
|
||||
|
||||
NSString *string = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
@@ -11,5 +11,7 @@
|
||||
@interface HTMLKitTestUtil : NSObject
|
||||
|
||||
+ (NSInvocation *)addTestToClass:(Class)cls withName:(NSString *)name block:(id)block;
|
||||
+ (id)ivarForInstacne:(id)instance name:(NSString *)name;
|
||||
+ (NSString *)pathForFixture:(NSString *)fixture ofType:(NSString *)type inDirectory:(NSString *)directory;
|
||||
|
||||
@end
|
||||
@@ -26,4 +26,29 @@
|
||||
return invocation;
|
||||
}
|
||||
|
||||
+ (id)ivarForInstacne:(id)instance name:(NSString *)name
|
||||
{
|
||||
Ivar ivar = class_getInstanceVariable([instance class], [name UTF8String]);
|
||||
return object_getIvar(instance, ivar);
|
||||
}
|
||||
|
||||
+ (NSString *)pathForFixture:(NSString *)fixture ofType:(NSString *)type inDirectory:(NSString *)directory
|
||||
{
|
||||
// Try testing bundle first
|
||||
NSString *path = [[NSBundle bundleForClass:self.class] pathForResource:fixture ofType:type inDirectory:directory];
|
||||
if (path) {
|
||||
return path;
|
||||
}
|
||||
|
||||
path = [[@(__FILE__) stringByDeletingLastPathComponent] stringByDeletingLastPathComponent];
|
||||
if (directory) {
|
||||
path = [path stringByAppendingPathComponent:directory];
|
||||
}
|
||||
|
||||
NSString *resource = type ? [NSString stringWithFormat:@"%@.%@", fixture, type] : fixture;
|
||||
path = [path stringByAppendingPathComponent:resource];
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@end
|
||||
+3
-3
@@ -10,6 +10,7 @@
|
||||
#import "HTMLTokenizer.h"
|
||||
#import "HTMLTokenizerStates.h"
|
||||
#import "HTMLTokens.h"
|
||||
#import "HTMLKitTestUtil.h"
|
||||
|
||||
@interface HTMLKitTokenizerPerformance : XCTestCase
|
||||
|
||||
@@ -17,10 +18,9 @@
|
||||
|
||||
@implementation HTMLKitTokenizerPerformance
|
||||
|
||||
- (void)testTokenizerPerformance
|
||||
- (void)_testTokenizerPerformance
|
||||
{
|
||||
NSString *path = [[NSBundle bundleForClass:self.class] resourcePath];
|
||||
path = [path stringByAppendingPathComponent:@"HTML Standard.html"];
|
||||
NSString *path = [HTMLKitTestUtil pathForFixture:@"HTML Standard" ofType:@"html" inDirectory:@"Fixtures"];
|
||||
|
||||
NSString *string = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
@@ -81,20 +81,31 @@
|
||||
|
||||
for (NSNumber *state in test.initialStates) {
|
||||
HTMLTokenizer *tokenizer = [[HTMLTokenizer alloc] initWithString:test.input];
|
||||
[tokenizer setValue:test.lastStartTag forKey:@"_lastStartTagName"];
|
||||
|
||||
[tokenizer setValue:test.lastStartTag forKey:@"_lastStartTagName"];
|
||||
tokenizer.state = [state integerValue];
|
||||
|
||||
NSArray *expectedTokens = test.output;
|
||||
NSArray *tokens = tokenizer.allObjects;
|
||||
NSArray *expectedErrors = test.errors;
|
||||
NSMutableArray *actualErrors = [NSMutableArray new];
|
||||
tokenizer.parseErrorCallback = ^(HTMLParseErrorToken *token) {
|
||||
[actualErrors addObject:token];
|
||||
};
|
||||
|
||||
NSString *message = [NSString stringWithFormat:@"HTML5Lib test in file: \'%@\' Title: '%@'\nInput: '%@'\nExpected:\n%@\nActual:\n%@\n",
|
||||
NSArray *expectedTokens = test.output;
|
||||
NSArray *actualTokens = tokenizer.allObjects;
|
||||
|
||||
NSString *message = [NSString stringWithFormat:@"\nTest file: \'%@\'\nTitle: '%@'\nInput: '%@'\n",
|
||||
test.testFile,
|
||||
test.title,
|
||||
test.input,
|
||||
expectedTokens,
|
||||
tokens];
|
||||
XCTAssertEqualObjects(tokens, expectedTokens, @"%@", message);
|
||||
test.input];
|
||||
XCTAssertEqualObjects(actualTokens, expectedTokens, @"%@", message);
|
||||
|
||||
|
||||
message = [NSString stringWithFormat:@"\nTest file: \'%@\'\nTitle: '%@'\nInput: '%@'\n",
|
||||
test.testFile,
|
||||
test.title,
|
||||
test.input];
|
||||
XCTAssertEqualObjects(actualErrors, expectedErrors, @"%@", message);
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -157,7 +157,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
|
||||
HTMLDocument *document = [HTMLDocument new];
|
||||
HTMLDocumentFragment *fragment = [[HTMLDocumentFragment alloc] initWithDocument:document];
|
||||
|
||||
void (^ reset)() = ^ {
|
||||
void (^ reset)(void) = ^ {
|
||||
[fragment removeAllChildNodes];
|
||||
[document removeAllChildNodes];
|
||||
};
|
||||
@@ -213,7 +213,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
|
||||
HTMLDocument *document = [HTMLDocument new];
|
||||
HTMLElement *element = [HTMLElement new];
|
||||
|
||||
void (^ reset)() = ^ {
|
||||
void (^ reset)(void) = ^ {
|
||||
[element removeAllChildNodes];
|
||||
[document removeAllChildNodes];
|
||||
};
|
||||
@@ -247,7 +247,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
|
||||
HTMLDocument *document = [HTMLDocument new];
|
||||
HTMLDocumentType *doctype = [HTMLDocumentType new];
|
||||
|
||||
void (^ reset)() = ^ {
|
||||
void (^ reset)(void) = ^ {
|
||||
[document removeAllChildNodes];
|
||||
};
|
||||
|
||||
@@ -280,7 +280,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
|
||||
HTMLComment *child = [HTMLComment new];
|
||||
HTMLDocumentFragment *replacement = [[HTMLDocumentFragment alloc] initWithDocument:document];
|
||||
|
||||
void (^ reset)() = ^ {
|
||||
void (^ reset)(void) = ^ {
|
||||
[replacement removeAllChildNodes];
|
||||
[document removeAllChildNodes];
|
||||
[document appendNode:child];
|
||||
@@ -326,7 +326,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
|
||||
HTMLComment *child = [HTMLComment new];
|
||||
HTMLElement *replacement = [HTMLElement new];
|
||||
|
||||
void (^ reset)() = ^ {
|
||||
void (^ reset)(void) = ^ {
|
||||
[replacement removeAllChildNodes];
|
||||
[document removeAllChildNodes];
|
||||
[document appendNode:child];
|
||||
@@ -353,7 +353,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
|
||||
HTMLComment *child = [HTMLComment new];
|
||||
HTMLDocumentType *replacement = [HTMLDocumentType new];
|
||||
|
||||
void (^ reset)() = ^ {
|
||||
void (^ reset)(void) = ^ {
|
||||
[replacement removeAllChildNodes];
|
||||
[document removeAllChildNodes];
|
||||
[document appendNode:child];
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "HTMLDOM.h"
|
||||
#import "HTMLKitTestUtil.h"
|
||||
|
||||
@interface HTMLKitNodeIteratorTests : XCTestCase
|
||||
|
||||
@@ -565,4 +566,61 @@ static HTMLNode * (^ LastDescendant)(HTMLNode *) = ^ HTMLNode * (HTMLNode *node)
|
||||
XCTAssertEqual(iterator.pointerBeforeReferenceNode, NO);
|
||||
}
|
||||
|
||||
#pragma mark - Bug Fixes
|
||||
|
||||
- (void)testBugFix_Issue_4
|
||||
{
|
||||
HTMLDocument *document = [HTMLDocument documentWithString:@"<ul><li>1<li>2"];
|
||||
|
||||
NSHashTable *nodeIterators = [HTMLKitTestUtil ivarForInstacne:document name:@"_nodeIterators"];
|
||||
XCTAssertTrue([nodeIterators isKindOfClass:[NSHashTable class]]);
|
||||
|
||||
// document.body uses an iterator internally
|
||||
HTMLElement *body = document.body;
|
||||
XCTAssertNotNil(body);
|
||||
|
||||
// iterator should be deallocated and detached at this point
|
||||
XCTAssertEqual(0, nodeIterators.count);
|
||||
|
||||
// iterator should be autoreleased, deallocated and detached after autoreleasepool
|
||||
@autoreleasepool {
|
||||
HTMLNodeIterator *iterator = [[HTMLNodeIterator alloc] initWithNode:body];
|
||||
[iterator nextNode];
|
||||
XCTAssertEqual(1, nodeIterators.count);
|
||||
}
|
||||
|
||||
XCTAssertEqual(0, nodeIterators.count);
|
||||
}
|
||||
|
||||
- (void)testBugFix_Issue_22 {
|
||||
// The issue is applicable only for devices. On simulator the test is passed.
|
||||
HTMLDocument *document = [HTMLDocument documentWithString:@"<div id=\"id\"></div>"];
|
||||
|
||||
NSString *divId = @"id";
|
||||
HTMLNodeFilterBlock *filter = [HTMLNodeFilterBlock filterWithBlock:^HTMLNodeFilterValue(HTMLNode * _Nonnull node) {
|
||||
HTMLElement *element = (HTMLElement *)node;
|
||||
return [element.elementId isEqualToString:divId] ? HTMLNodeFilterAccept : HTMLNodeFilterSkip;
|
||||
}];
|
||||
|
||||
HTMLNodeIterator *iterator = [document nodeIteratorWithShowOptions:HTMLNodeFilterShowElement filter:filter];
|
||||
|
||||
HTMLElement *element = (HTMLElement*)iterator.nextObject;
|
||||
XCTAssertTrue([element.elementId isEqualToString:divId]);
|
||||
}
|
||||
|
||||
- (void)testBugFix_Issue_28 {
|
||||
HTMLDocument *document = self.document;
|
||||
HTMLNodeIterator *iterator = document.body.nodeIterator;
|
||||
|
||||
[iterator nextNode]; // Reference node: <body>
|
||||
|
||||
HTMLElement *span = (HTMLElement*)iterator.nextNode; // <span>
|
||||
NSString *spanTag = @"span";
|
||||
XCTAssertTrue([span.tagName isEqualToString:spanTag]);
|
||||
|
||||
HTMLElement *paragraph = span.nextSiblingElement; // <p>
|
||||
NSString *paragraphTag = @"p";
|
||||
XCTAssertTrue([paragraph.tagName isEqualToString:paragraphTag]);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -512,4 +512,60 @@
|
||||
XCTAssertTrue([image compareDocumentPositionWithNode:outerDiv] == (HTMLDocumentPositionContainedBy | HTMLDocumentPositionFollowing));
|
||||
}
|
||||
|
||||
- (void)testDeepCloneElement {
|
||||
HTMLElement *outer = [[HTMLElement alloc] initWithTagName:@"div"
|
||||
attributes:@{@"id": @"outer",
|
||||
@"class": @"green"}];
|
||||
|
||||
HTMLElement *innerLevel1 = [[HTMLElement alloc] initWithTagName:@"div"
|
||||
attributes:@{@"id": @"inner1",
|
||||
@"class": @"red"}];
|
||||
|
||||
HTMLElement *innerLevel2 = [[HTMLElement alloc] initWithTagName:@"div"
|
||||
attributes:@{@"id": @"inner2",
|
||||
@"class": @"red"}];
|
||||
|
||||
[outer appendNode:innerLevel1];
|
||||
[innerLevel1 appendNode:innerLevel2];
|
||||
|
||||
HTMLElement *clone = [outer cloneNodeDeep:YES];
|
||||
|
||||
XCTAssertNotEqual(clone, outer);
|
||||
XCTAssertEqualObjects(clone.elementId, outer.elementId);
|
||||
XCTAssertEqualObjects(clone.attributes, outer.attributes);
|
||||
|
||||
XCTAssertNotEqual(clone.firstChild, innerLevel1);
|
||||
XCTAssertEqualObjects(clone.firstChild.asElement.elementId, innerLevel1.elementId);
|
||||
XCTAssertEqualObjects(clone.firstChild.asElement.attributes, innerLevel1.attributes);
|
||||
|
||||
XCTAssertNotEqual(clone.firstChild, innerLevel2);
|
||||
XCTAssertEqualObjects(clone.firstChild.firstChild.asElement.elementId, innerLevel2.elementId);
|
||||
XCTAssertEqualObjects(clone.firstChild.firstChild.asElement.attributes, innerLevel2.attributes);
|
||||
}
|
||||
|
||||
- (void)testDeepCloneElementAttributes {
|
||||
HTMLElement *div = [[HTMLElement alloc] initWithTagName:@"div"
|
||||
attributes:@{@"id": @"outer",
|
||||
@"class": @"green",
|
||||
@"data": @"test"}];
|
||||
|
||||
HTMLElement *clone = [div cloneNodeDeep:YES];
|
||||
|
||||
XCTAssertEqualObjects(clone.attributes, div.attributes);
|
||||
XCTAssertTrue([clone.attributes isKindOfClass:[HTMLOrderedDictionary class]]);
|
||||
}
|
||||
|
||||
#pragma mark - Bug Fixes
|
||||
|
||||
- (void)testBugFix_Issue_20 {
|
||||
HTMLElement *element = [HTMLElement new];
|
||||
element.elementId = @"originalId";
|
||||
|
||||
HTMLElement *clone = [element cloneNodeDeep:YES];
|
||||
NSString *cloneId = @"cloneId";
|
||||
clone.elementId = cloneId;
|
||||
|
||||
XCTAssertTrue([clone.elementId isEqualToString:cloneId]);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -11,6 +11,7 @@
|
||||
#import "HTMLDOM.h"
|
||||
#import "HTMLNode+Private.h"
|
||||
#import "HTMLRange+Private.h"
|
||||
#import "HTMLKitTestUtil.h"
|
||||
|
||||
#define BodyOf(doc) doc.body.innerHTML
|
||||
#define InnerHTML(str) [HTMLDocument documentWithString:str].body.innerHTML
|
||||
@@ -89,7 +90,7 @@
|
||||
|
||||
- (void)testInitRange
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
XCTAssertEqualObjects(range.startContainer, _document);
|
||||
XCTAssertEqual(range.startOffset, 0);
|
||||
@@ -100,7 +101,7 @@
|
||||
|
||||
- (void)testSetStartBoundary
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
XCTAssertThrows([range setStartNode:[HTMLElement new] startOffset:0], @"Cannot set boundary to a node outside of the range's document");
|
||||
XCTAssertThrows([range setStartNode:[HTMLDocumentType new] startOffset:0], @"DOCTYPE as range boundary is invalid");
|
||||
@@ -129,7 +130,7 @@
|
||||
|
||||
- (void)testSetEndBoundary
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
XCTAssertThrows([range setEndNode:[HTMLDocumentType new] endOffset: 0], @"DOCTYPE as range boundary is invalid");
|
||||
XCTAssertThrows([range setEndNode:_firstText endOffset:_firstText.length + 1], @"Offset is outside the boundary node");
|
||||
@@ -167,7 +168,7 @@
|
||||
|
||||
- (void)testSetStartBeforeNode
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><!--Second comment--></div>
|
||||
// |___|
|
||||
@@ -262,7 +263,7 @@
|
||||
|
||||
- (void)testSetStartAfterNode
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><!--Second comment--></div>
|
||||
// |___|
|
||||
@@ -357,7 +358,7 @@
|
||||
|
||||
- (void)testSetEndBeforeNode
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><!--Second comment--></div>
|
||||
// |___|
|
||||
@@ -452,7 +453,7 @@
|
||||
|
||||
- (void)testSetEndAfterNode
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><!--Second comment--></div>
|
||||
// |___|
|
||||
@@ -547,7 +548,7 @@
|
||||
|
||||
- (void)testIsCollapsed
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
XCTAssertTrue(range.isCollapsed);
|
||||
|
||||
[range setEndNode:_title endOffset:1];
|
||||
@@ -559,7 +560,7 @@
|
||||
|
||||
- (void)testCollapseToStart
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |______________|
|
||||
@@ -578,7 +579,7 @@
|
||||
|
||||
- (void)testCollapseToEnd
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |______________|
|
||||
@@ -597,7 +598,7 @@
|
||||
|
||||
- (void)testSelectNode
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// ----------
|
||||
@@ -650,7 +651,7 @@
|
||||
|
||||
- (void)testSelectNodeContents
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// ----------
|
||||
@@ -703,9 +704,9 @@
|
||||
|
||||
- (void)testCompareBoundaries
|
||||
{
|
||||
HTMLRange *range1 = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range1 = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
HTMLRange *range2 = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range2 = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// ----------
|
||||
@@ -775,7 +776,7 @@
|
||||
|
||||
- (void)testContainmentAndComparisons
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
/*********** Compare ***********/
|
||||
|
||||
@@ -849,7 +850,7 @@
|
||||
|
||||
- (void)testIntersections
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
XCTAssertFalse([range intersectsNode:[HTMLText new]]);
|
||||
XCTAssertTrue([range intersectsNode:_document]);
|
||||
@@ -881,7 +882,7 @@
|
||||
|
||||
- (void)testThatCharacterDataMutationsUpdateRangeCorrectly
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |________|
|
||||
@@ -979,7 +980,7 @@
|
||||
|
||||
- (void)testThatCharacterDataMutationsUpdateRangeCorrectly_DifferentBoundaries
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |___________________________|
|
||||
@@ -1093,7 +1094,7 @@
|
||||
|
||||
- (void)testThatTextSplitUpdateRangeCorrectly_BeforeStartTextNode
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |________|
|
||||
[range selectNodeContents:_firstText];
|
||||
@@ -1110,7 +1111,7 @@
|
||||
|
||||
- (void)testThatTextSplitUpdateRangeCorrectly_AfterEndTextNode
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |________|
|
||||
[range selectNodeContents:_firstText];
|
||||
@@ -1127,7 +1128,7 @@
|
||||
|
||||
- (void)testThatTextSplitUpdateRangeCorrectly_MidleSameTextNode
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |________|
|
||||
[range selectNodeContents:_firstText];
|
||||
@@ -1144,7 +1145,7 @@
|
||||
|
||||
- (void)testThatTextSplitUpdateRangeCorrectly_MidleDifferentTextNodes
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |______________________________|
|
||||
[range setStartNode:_firstText startOffset:2];
|
||||
@@ -1162,7 +1163,7 @@
|
||||
|
||||
- (void)testThatTextSplitUpdateRangeCorrectly_BeforeStartDifferentTextNodes
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |______________________________|
|
||||
[range setStartNode:_firstText startOffset:6];
|
||||
@@ -1180,7 +1181,7 @@
|
||||
|
||||
- (void)testThatTextSplitUpdateRangeCorrectly_BeforeEndDifferentTextNodes
|
||||
{
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:_document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:_document];
|
||||
// <h1>Title</h1><p>Hello</p><div><div>First text<!--First comment-->Second text</div><--Second comment--></div>
|
||||
// |_______________________________|
|
||||
[range setStartNode:_firstText startOffset:6];
|
||||
@@ -1240,7 +1241,7 @@
|
||||
- (void)testDeleteContents_SameTextNode
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:1];
|
||||
@@ -1259,7 +1260,7 @@
|
||||
- (void)testDeleteContents_SameTextNode_Selected
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"].firstChild;
|
||||
[range selectNode:node];
|
||||
@@ -1278,7 +1279,7 @@
|
||||
- (void)testDeleteContents_SameTextNode_SelectedContents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"].firstChild;
|
||||
[range selectNodeContents:node];
|
||||
@@ -1298,7 +1299,7 @@
|
||||
- (void)testDeleteContents_DifferentTextNodesOfSingleParent
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1317,7 +1318,7 @@
|
||||
- (void)testDeleteContents_DifferentTextNodesOfDifferentParents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1336,7 +1337,7 @@
|
||||
- (void)testDeleteContents_DifferentTextNodesOfDifferentParents_HavingContainedNodesInBetween
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1354,7 +1355,7 @@
|
||||
- (void)testDeleteContents_SameContainerNode
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"];
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -1373,7 +1374,7 @@
|
||||
- (void)testDeleteContents_SameContainerNode_Selected
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"];
|
||||
[range selectNode:node];
|
||||
@@ -1390,7 +1391,7 @@
|
||||
- (void)testDeleteContents_SameContainerNode_SelectedContents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"];
|
||||
[range selectNodeContents:node];
|
||||
@@ -1407,7 +1408,7 @@
|
||||
- (void)testDeleteContents_StartContainerIsCommonRoot
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#D1"];
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -1426,7 +1427,7 @@
|
||||
- (void)testDeleteContents_EndContainerIsCommonRoot
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:1];
|
||||
@@ -1447,7 +1448,7 @@
|
||||
- (void)testCloneContents_SameTextNode
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:1];
|
||||
@@ -1463,7 +1464,7 @@
|
||||
- (void)testCloneContents_SameTextNode_Selected
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"].firstChild;
|
||||
[range selectNode:node];
|
||||
@@ -1477,7 +1478,7 @@
|
||||
- (void)testCloneContents_SameTextNode_SelectedContents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"].firstChild;
|
||||
[range selectNodeContents:node];
|
||||
@@ -1491,7 +1492,7 @@
|
||||
- (void)testCloneContents_DifferentTextNodesOfSingleParent
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1505,7 +1506,7 @@
|
||||
- (void)testCloneContents_DifferentTextNodesOfDifferentParents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1519,7 +1520,7 @@
|
||||
- (void)testCloneContents_DifferentTextNodesOfDifferentParents_HavingContainedNodesInBetween
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1535,7 +1536,7 @@
|
||||
- (void)testCloneContents_SameContainerNode
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"];
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -1549,7 +1550,7 @@
|
||||
- (void)testCloneContents_SameContainerNode_Selected
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"];
|
||||
[range selectNode:node];
|
||||
@@ -1561,7 +1562,7 @@
|
||||
- (void)testCloneContents_SameContainerNode_SelectedContents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"];
|
||||
[range selectNodeContents:node];
|
||||
@@ -1573,7 +1574,7 @@
|
||||
- (void)testCloneContents_StartContainerIsCommonRoot
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#D1"];
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -1587,7 +1588,7 @@
|
||||
- (void)testCloneContents_EndContainerIsCommonRoot
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:1];
|
||||
@@ -1603,7 +1604,7 @@
|
||||
- (void)testExtractContents_SameTextNode
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:1];
|
||||
@@ -1626,7 +1627,7 @@
|
||||
- (void)testExtractContents_SameTextNode_Selected
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"].firstChild;
|
||||
[range selectNode:node];
|
||||
@@ -1649,7 +1650,7 @@
|
||||
- (void)testExtractContents_SameTextNode_SelectedContents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"].firstChild;
|
||||
[range selectNodeContents:node];
|
||||
@@ -1673,7 +1674,7 @@
|
||||
- (void)testExtractContents_DifferentTextNodesOfSingleParent
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1694,7 +1695,7 @@
|
||||
- (void)testExtractContents_DifferentTextNodesOfDifferentParents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1715,7 +1716,7 @@
|
||||
- (void)testExtractContents_DifferentTextNodesOfDifferentParents_HavingContainedNodesInBetween
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:3];
|
||||
@@ -1737,7 +1738,7 @@
|
||||
- (void)testExtractContents_SameContainerNode
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"];
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -1758,7 +1759,7 @@
|
||||
- (void)testExtractContents_SameContainerNode_Selected
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"];
|
||||
[range selectNode:node];
|
||||
@@ -1777,7 +1778,7 @@
|
||||
- (void)testExtractContents_SameContainerNode_SelectedContents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *node = [document querySelector:@"#P1"];
|
||||
[range selectNodeContents:node];
|
||||
@@ -1796,7 +1797,7 @@
|
||||
- (void)testExtractContents_StartContainerIsCommonRoot
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#D1"];
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -1817,7 +1818,7 @@
|
||||
- (void)testExtractContents_EndContainerIsCommonRoot
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:1];
|
||||
@@ -1840,7 +1841,7 @@
|
||||
- (void)testInsertNode_InvalidNode
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:2];
|
||||
@@ -1859,7 +1860,7 @@
|
||||
- (void)testInsertNode_TextNodeStart_Begin
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -1883,7 +1884,7 @@
|
||||
- (void)testInsertNode_TextNodeStart_Middle
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:2];
|
||||
@@ -1907,7 +1908,7 @@
|
||||
- (void)testInsertNode_NonTextNodeStart_Begin
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"];
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -1931,7 +1932,7 @@
|
||||
- (void)testInsertNode_NonTextNodeStart_Middle
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"];
|
||||
[range setStartNode:start startOffset:2];
|
||||
@@ -1955,7 +1956,7 @@
|
||||
- (void)testInsertNode_NonTextNodeStart_DifferentParents
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#D1"];
|
||||
[range setStartNode:start startOffset:1];
|
||||
@@ -1979,7 +1980,7 @@
|
||||
- (void)testSurroundContents_InvalidNode
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:2];
|
||||
@@ -1994,7 +1995,7 @@
|
||||
- (void)testSurroundContents_PartiallySelectedAncestors
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:2];
|
||||
@@ -2015,7 +2016,7 @@
|
||||
- (void)testSurroundContents_TextNodes
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:2];
|
||||
@@ -2036,7 +2037,7 @@
|
||||
- (void)testSurroundContents_NonTextNodes
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"];
|
||||
[range setStartNode:start startOffset:0];
|
||||
@@ -2059,7 +2060,7 @@
|
||||
- (void)testRangeStringifier
|
||||
{
|
||||
HTMLDocument *document = self.editingDocument;
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDowcument:document];
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
|
||||
HTMLNode *start = [document querySelector:@"#P1"].firstChild;
|
||||
[range setStartNode:start startOffset:2];
|
||||
@@ -2098,4 +2099,23 @@
|
||||
XCTAssertEqualObjects([range textContent], @"This is a textHelloWorldAnother text");
|
||||
}
|
||||
|
||||
#pragma mark - Bug Fixes
|
||||
|
||||
- (void)testBugFix_Issue_5
|
||||
{
|
||||
HTMLDocument *document = [HTMLDocument documentWithString:@"<ul><li>1<li>2"];
|
||||
|
||||
NSHashTable *ranges = [HTMLKitTestUtil ivarForInstacne:document name:@"_ranges"];
|
||||
XCTAssertTrue([ranges isKindOfClass:[NSHashTable class]]);
|
||||
|
||||
// range should be autoreleased, deallocated and detached after autoreleasepool
|
||||
@autoreleasepool {
|
||||
HTMLRange *range = [[HTMLRange alloc] initWithDocument:document];
|
||||
[range cloneContents];
|
||||
XCTAssertEqual(1, ranges.count);
|
||||
}
|
||||
|
||||
XCTAssertEqual(0, ranges.count);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// HTMLSerializationTests.m
|
||||
// HTMLKit
|
||||
//
|
||||
// Created by Iska on 06.11.17.
|
||||
// Copyright © 2017 BrainCookie. All rights reserved.
|
||||
//
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "HTMLDOM.h"
|
||||
|
||||
@interface HTMLSerializationTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation HTMLSerializationTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
#pragma mark - Bug Fixes
|
||||
|
||||
- (void)testBugFix_Issue_16
|
||||
{
|
||||
NSString *html = @"<body><div><test></div></body>";
|
||||
HTMLDocument *document = [HTMLDocument documentWithString:html];
|
||||
|
||||
XCTAssertEqualObjects(document.body.outerHTML, html);
|
||||
}
|
||||
|
||||
- (void)testBugFix_Issue_17
|
||||
{
|
||||
NSString *html = @"<body key='& testing 0x00A0'></body>";
|
||||
HTMLDocument *document = [HTMLDocument documentWithString:html];
|
||||
|
||||
XCTAssertEqualObjects(document.body.outerHTML, @"<body key=\"& testing \"></body>");
|
||||
}
|
||||
|
||||
@end
|
||||
+1
-1
Submodule Tests/html5lib-tests updated: 13f1805136...515dc09aaa
Reference in New Issue
Block a user