27 Commits

Author SHA1 Message Date
Iskandar Abudiab 118cb41971 Bump version to 4.2.0 2021-04-29 20:11:41 +02:00
Iskandar Abudiab 3d9f2007ee Update tokenizer and parser logic to pass latest test suite 2021-04-29 20:07:05 +02:00
Iskandar Abudiab e79f96e217 Update html5lib-tests to latest commit as of 2021.04.28 2021-04-29 18:15:14 +02:00
Iskandar Abudiab 3333274cfb Use HTMLElement's designated initialiser in tests
Fixes #43
2021-04-29 18:14:15 +02:00
Iskandar Abudiab 26ee9e683f Update CI badge 2021-04-29 17:08:45 +02:00
Iskandar Abudiab 9e45ac5fa1 Update badges in Readme 2021-04-28 18:22:47 +02:00
Iskandar Abudiab 612173dfbb Update project settings for Xcode 12.5 2021-04-28 18:18:16 +02:00
Iskandar Abudiab 89876e8809 Bump version to 4.1.0 2021-04-28 18:14:24 +02:00
Iskandar Abudiab 09e06b5769 Update project for Xcode 12.5 2021-04-28 18:06:20 +02:00
Iskandar Abudiab 1b9149be2b Merge pull request #42 from pendowski/bug/xcode12-support
Fixed error with operator precedence in Xcode 12
2020-08-29 01:50:32 +02:00
Jarek Pendowski b945c13fa8 Fixed error with operator precedence in Xcode 12.
Removed ambiguity in the test.
2020-08-28 18:14:01 +02:00
Iskandar Abudiab 6948426302 Update Chengelog 2020-07-16 20:38:19 +02:00
Iskandar Abudiab 7d73afdd42 Update Readme 2020-07-16 20:36:14 +02:00
Iskandar Abudiab 85cf588032 Bump version to 4.0.0 2020-07-16 20:35:56 +02:00
Iskandar Abudiab e315cabfbd Remove travis 2020-07-16 20:26:17 +02:00
Iskandar Abudiab 00bbb363a7 Add CI code coverage 2020-07-16 19:58:31 +02:00
Iskandar Abudiab c7632b5a59 Add iOS CI Job 2020-07-16 18:27:15 +02:00
Iskandar Abudiab ac72498284 Update Package.swift to v5.1 2020-07-16 17:11:52 +02:00
Iskandar Abudiab e0e20243d5 Update LICENSE 2020-02-02 21:20:48 +01:00
Iskandar Abudiab de9a1fde8a Update .travis.yml 2020-02-02 21:18:35 +01:00
Iskandar Abudiab be3867a6e3 Update swift package for v4 and v5.1 2019-12-28 17:45:24 +01:00
Iskandar Abudiab 3760c76d74 Fix new compiler warnings 2019-12-28 16:29:19 +01:00
Iskandar Abudiab 834cda2d86 Update project settings for Xcode 11 2019-12-28 16:28:44 +01:00
Iskandar Abudiab 9467bc2474 Revert back to actions/checkout for submodules 2019-10-09 23:54:14 +02:00
Iskandar Abudiab bb7c5d4c02 Add submodules checkout step
Checkout html5lib-tests submodule
2019-10-09 23:46:37 +02:00
Iskandar Abudiab 169e013ad2 Add initial CI workflow 2019-10-09 23:32:24 +02:00
iska 3629b02097 Merge tag '3.1.0' into develop
3.1.0
2019-08-20 18:20:03 +02:00
33 changed files with 375 additions and 341 deletions
+30
View File
@@ -0,0 +1,30 @@
name: HTMLKit CI
on: [push]
jobs:
macOS:
name: Test macOS
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: macOS
run: xcodebuild -workspace "HTMLKit.xcworkspace" -scheme "HTMLKit-macOS" -destination "platform=macOS" -enableCodeCoverage YES clean test | xcpretty
- name: code coverage
uses: codecov/codecov-action@v1
iOS:
name: Test iOS
runs-on: macOS-latest
env:
DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
strategy:
matrix:
destination: ["OS=13.5,name=iPhone 11 Pro", "OS=12.4,name=iPhone XS", "OS=11.4,name=iPhone X"]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: iOS - ${{ matrix.destination }}
run: xcodebuild -workspace "HTMLKit.xcworkspace" -scheme "HTMLKit-iOS" -destination "${{ matrix.destination }}" clean test | xcpretty
+1 -1
View File
@@ -1,5 +1,5 @@
module: HTMLKit
module_version: 3.1.0
module_version: 4.2.0
author: Iskandar Abudiab
author_url: https://twitter.com/iabudiab
github_url: https://github.com/iabudiab/HTMLKit
-45
View File
@@ -1,45 +0,0 @@
language: objective-c
osx_image: xcode9
branches:
except:
- gh-pages
install:
- gem install xcpretty
env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- WORKSPACE=HTMLKit.xcworkspace
- IOS_FRAMEWORK_SCHEME=HTMLKit-iOS
- MACOS_FRAMEWORK_SCHEME=HTMLKit-macOS
- WATCHOS_FRAMEWORK_SCHEME="HTMLKit-watchOS"
- TVOS_FRAMEWORK_SCHEME="HTMLKit-tvOS"
- IOS_SDK=iphonesimulator11.0
- MACOS_SDK=macosx10.13
- WATCHOS_SDK=watchsimulator4.0
- TVOS_SDK=appletvsimulator11.0
matrix:
- 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
- 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 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)
+19
View File
@@ -1,5 +1,24 @@
# Change Log
## [4.2.0](https://github.com/iabudiab/HTMLKit/releases/tag/4.1.0)
- Fix test compilation under Xcode 12.5 (issue #43)
- Updated HTML5Lib-Tests submodule (082a4be)
- Updated parser and tokenizer for latest spec changes to pass test suite
## [4.1.0](https://github.com/iabudiab/HTMLKit/releases/tag/4.1.0)
- Updated project for Xcode 12.5
## [4.0.0](https://github.com/iabudiab/HTMLKit/releases/tag/4.0.0)
Release on 2020.07.16
### Breaking Change
- Swift package version updated to 5.1
## [3.1.0](https://github.com/iabudiab/HTMLKit/releases/tag/3.1.0)
Release on 2019.08.20
@@ -89,7 +89,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1250;
ORGANIZATIONNAME = iabudiab;
TargetAttributes = {
629A63C81D9AFE0E0089679F = {
@@ -100,10 +100,11 @@
};
buildConfigurationList = 629A63C41D9AFE0E0089679F /* Build configuration list for PBXProject "HTMLKitExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 629A63C01D9AFE0E0089679F;
productRefGroup = 629A63CA1D9AFE0E0089679F /* Products */;
@@ -131,6 +132,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -140,6 +142,7 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
@@ -147,8 +150,10 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -186,6 +191,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -195,6 +201,7 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
@@ -202,8 +209,10 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -233,16 +242,18 @@
629A63D11D9AFE0E0089679F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
629A63D21D9AFE0E0089679F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,10 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@@ -39,14 +36,13 @@
ReferencedContainer = "container:HTMLKitExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -63,8 +59,6 @@
ReferencedContainer = "container:HTMLKitExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "HTMLKit"
s.version = "3.1.0"
s.version = "4.2.0"
s.summary = "HTMLKit, an Objective-C framework for your everyday HTML needs."
s.license = "MIT"
s.homepage = "https://github.com/iabudiab/HTMLKit"
+65 -46
View File
@@ -1687,7 +1687,7 @@
625A14A319C7829400AD0C32 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = BrainCookie;
TargetAttributes = {
625A14C219C7829400AD0C32 = {
@@ -1716,10 +1716,11 @@
};
buildConfigurationList = 625A14A619C7829400AD0C32 /* Build configuration list for PBXProject "HTMLKit" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 625A14A219C7829400AD0C32;
productRefGroup = 625A14AD19C7829400AD0C32 /* Products */;
@@ -2172,6 +2173,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -2180,14 +2182,17 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2212,7 +2217,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.15;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
@@ -2222,6 +2227,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -2230,14 +2236,17 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2256,7 +2265,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.15;
SDKROOT = macosx;
};
name = Release;
@@ -2280,10 +2289,12 @@
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;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 4.2.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.iabudiab.HTMLKit;
PRODUCT_NAME = HTMLKit;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WRAPPER_EXTENSION = framework;
};
@@ -2308,10 +2319,12 @@
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;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MARKETING_VERSION = 4.2.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.iabudiab.HTMLKit;
PRODUCT_NAME = HTMLKit;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WRAPPER_EXTENSION = framework;
};
@@ -2333,11 +2346,11 @@
"$(inherited)",
);
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_BUNDLE_IDENTIFIER = "de.iabudiab.${PRODUCT_NAME:rfc1034identifier}";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_BUNDLE_IDENTIFIER = "dev.iabudiab.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WRAPPER_EXTENSION = xctest;
};
@@ -2355,11 +2368,11 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "";
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_BUNDLE_IDENTIFIER = "de.iabudiab.${PRODUCT_NAME:rfc1034identifier}";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_BUNDLE_IDENTIFIER = "dev.iabudiab.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
WRAPPER_EXTENSION = xctest;
};
@@ -2387,16 +2400,17 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 4.2.0;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = de.iabudiab.HTMLKit;
PRODUCT_BUNDLE_IDENTIFIER = dev.iabudiab.HTMLKit;
PRODUCT_MODULE_NAME = HTMLKit;
PRODUCT_NAME = HTMLKit;
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -2425,16 +2439,17 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 4.2.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = de.iabudiab.HTMLKit;
PRODUCT_BUNDLE_IDENTIFIER = dev.iabudiab.HTMLKit;
PRODUCT_MODULE_NAME = HTMLKit;
PRODUCT_NAME = HTMLKit;
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -2465,15 +2480,16 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 4.2.0;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = de.iabudiab.HTMLKit;
PRODUCT_BUNDLE_IDENTIFIER = dev.iabudiab.HTMLKit;
PRODUCT_NAME = HTMLKit;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -2503,15 +2519,16 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 4.2.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = de.iabudiab.HTMLKit;
PRODUCT_BUNDLE_IDENTIFIER = dev.iabudiab.HTMLKit;
PRODUCT_NAME = HTMLKit;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -2528,13 +2545,13 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "de.iabudiab.HTMLKit-tvOSTests";
PRODUCT_BUNDLE_IDENTIFIER = "dev.iabudiab.HTMLKit-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Debug;
@@ -2548,13 +2565,13 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "de.iabudiab.HTMLKit-tvOSTests";
PRODUCT_BUNDLE_IDENTIFIER = "dev.iabudiab.HTMLKit-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VALIDATE_PRODUCT = YES;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
@@ -2584,15 +2601,16 @@
GCC_WARN_PEDANTIC = NO;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 4.2.0;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = de.iabudiab.HTMLKit;
PRODUCT_BUNDLE_IDENTIFIER = dev.iabudiab.HTMLKit;
PRODUCT_NAME = HTMLKit;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -2623,15 +2641,16 @@
GCC_WARN_PEDANTIC = NO;
INFOPLIST_FILE = "Sources/HTMLKit-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 4.2.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = de.iabudiab.HTMLKit;
PRODUCT_BUNDLE_IDENTIFIER = dev.iabudiab.HTMLKit;
PRODUCT_NAME = HTMLKit;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -2648,13 +2667,13 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "de.iabudiab.HTMLKit-iOSTests";
PRODUCT_BUNDLE_IDENTIFIER = "dev.iabudiab.HTMLKit-iOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Debug;
@@ -2668,13 +2687,13 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "Tests/HTMLKitTests/HTMLKitTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "de.iabudiab.HTMLKit-iOSTests";
PRODUCT_BUNDLE_IDENTIFIER = "dev.iabudiab.HTMLKit-iOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VALIDATE_PRODUCT = YES;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,9 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62ECBF4C1C0B6C7600AF847B"
BuildableName = "HTMLKit.framework"
BlueprintName = "HTMLKit-iOS"
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@@ -55,23 +63,11 @@
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62ECBF4C1C0B6C7600AF847B"
BuildableName = "HTMLKit.framework"
BlueprintName = "HTMLKit-iOS"
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -87,8 +83,6 @@
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,9 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "625A14AB19C7829400AD0C32"
BuildableName = "HTMLKit.framework"
BlueprintName = "HTMLKit-macOS"
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@@ -55,23 +63,11 @@
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "625A14AB19C7829400AD0C32"
BuildableName = "HTMLKit.framework"
BlueprintName = "HTMLKit-macOS"
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -87,8 +83,6 @@
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,9 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62857CE91D39A262008DC254"
BuildableName = "HTMLKit.framework"
BlueprintName = "HTMLKit-tvOS"
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@@ -49,23 +57,11 @@
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62857CE91D39A262008DC254"
BuildableName = "HTMLKit.framework"
BlueprintName = "HTMLKit-tvOS"
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -81,8 +77,6 @@
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,19 +26,15 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -54,8 +50,6 @@
ReferencedContainer = "container:HTMLKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014 Iskandar Abudiab
Copyright (c) 2014-2020 Iskandar Abudiab
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+4 -1
View File
@@ -1,6 +1,9 @@
// swift-tools-version:5.1
import PackageDescription
let package = Package(
name: "HTMLKit",
exclude: ["Tests/Fixtures", "Tests/css-tests", "Tests/html5lib-tests"]
products: [.library(name: "HTMLKit", targets: ["HTMLKit"])],
targets: [.target(name: "HTMLKit", dependencies: [], path: "Sources")],
swiftLanguageVersions: [.v5]
)
+5 -6
View File
@@ -1,14 +1,13 @@
# HTMLKit
![HTMLKit Logo](https://raw.githubusercontent.com/iabudiab/HTMLKit/master/HTMLKit.png)
![HTMLKit Logo](https://raw.githubusercontent.com/iabudiab/HTMLKit/main/HTMLKit.png)
An Objective-C framework for your everyday HTML needs.
[![Build Status](https://img.shields.io/travis/iabudiab/HTMLKit/develop.svg?style=flat)](https://travis-ci.org/iabudiab/HTMLKit)
[![codecov](https://codecov.io/gh/iabudiab/HTMLKit/branch/develop/graph/badge.svg)](https://codecov.io/gh/iabudiab/HTMLKit)
[![HTMLKit CI](https://github.com/iabudiab/HTMLKit/actions/workflows/ci.yml/badge.svg)](https://github.com/iabudiab/HTMLKit/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/iabudiab/HTMLKit/branch/main/graph/badge.svg)](https://codecov.io/gh/iabudiab/HTMLKit)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/HTMLKit.svg?style=flat)](https://cocoapods.org/pods/HTMLKit)
[![CocoaDocs](https://img.shields.io/cocoapods/metrics/doc-percent/HTMLKit.svg?style=flat)](http://cocoadocs.org/docsets/HTMLKit)
[![Platform](https://img.shields.io/cocoapods/p/HTMLKit.svg?style=flat)](http://cocoadocs.org/docsets/HTMLKit)
[![License MIT](https://img.shields.io/badge/license-MIT-4481C7.svg?style=flat)](https://opensource.org/licenses/MIT)
@@ -77,7 +76,7 @@ To add `HTMLKit` as a dependency into your project using CocoaPods just add the
```ruby
target 'MyTarget' do
pod 'HTMLKit', '~> 3.1'
pod 'HTMLKit', '~> 4.2'
end
```
@@ -94,7 +93,7 @@ $ pod install
Add `HTMLKit` to your `Package.swift` dependecies:
```swift
.Package(url: "https://github.com/iabudiab/HTMLKit", majorVersion: 3)
.package(url: "https://github.com/iabudiab/HTMLKit", .upToNextMajor(from: "4.0.0")),
```
Then run:
+2 -2
View File
@@ -17,13 +17,13 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014 BrainCookie. All rights reserved.</string>
<string>Copyright © 2014 iabudiab. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
+4 -4
View File
@@ -383,16 +383,16 @@ NSString * const RemoveChildNode = @"-removeChildNode:";
}
if (self.ownerDocument != otherNode.ownerDocument) {
return (HTMLDocumentPositionDisconnected | HTMLDocumentPositionImplementationSpecific |
self.hash < otherNode.hash ? HTMLDocumentPositionPreceding : HTMLDocumentPositionFollowing);
return ((HTMLDocumentPositionDisconnected | HTMLDocumentPositionImplementationSpecific |
self.hash < otherNode.hash) ? HTMLDocumentPositionPreceding : HTMLDocumentPositionFollowing);
}
NSArray *ancestors1 = GetAncestorNodes(self);
NSArray *ancestors2 = GetAncestorNodes(otherNode);
if (ancestors1.lastObject != ancestors2.lastObject) {
return (HTMLDocumentPositionDisconnected | HTMLDocumentPositionImplementationSpecific |
self.hash < otherNode.hash ? HTMLDocumentPositionPreceding : HTMLDocumentPositionFollowing);
return ((HTMLDocumentPositionDisconnected | HTMLDocumentPositionImplementationSpecific |
self.hash < otherNode.hash) ? HTMLDocumentPositionPreceding : HTMLDocumentPositionFollowing);
}
NSUInteger index1 = ancestors1.count;
+24 -28
View File
@@ -1308,7 +1308,7 @@
_framesetOkFlag = NO;
} else if ([tagName isEqualToString:@"a"]) {
HTMLElement *element = ^ HTMLElement * {
for (HTMLElement *element in _listOfActiveFormattingElements.reverseObjectEnumerator) {
for (HTMLElement *element in self->_listOfActiveFormattingElements.reverseObjectEnumerator) {
if ([element isEqual:[HTMLMarker marker]]) return nil;
if ([element.tagName isEqualToString:@"a"]) {
return element;
@@ -1776,7 +1776,7 @@
- (void)HTMLInsertionModeInCaption:(HTMLToken *)token
{
void (^ common) (BOOL) = ^ (BOOL reprocess) {
if (![_stackOfOpenElements hasElementInTableScopeWithTagName:@"caption"]) {
if (![self->_stackOfOpenElements hasElementInTableScopeWithTagName:@"caption"]) {
[self emitParseError:@"Unexpected end tag </caption> for misnested element in <caption>"];
return;
}
@@ -1784,8 +1784,8 @@
if (![self.currentNode.tagName isEqualToString:@"caption"]) {
[self emitParseError:@"Misnested <caption> element in <caption>"];
}
[_stackOfOpenElements popElementsUntilElementPoppedWithTagName:@"caption"];
[_listOfActiveFormattingElements clearUptoLastMarker];
[self->_stackOfOpenElements popElementsUntilElementPoppedWithTagName:@"caption"];
[self->_listOfActiveFormattingElements clearUptoLastMarker];
[self switchInsertionMode:HTMLInsertionModeInTable];
if (reprocess) {
@@ -1890,12 +1890,12 @@
- (void)HTMLInsertionModeInTableBody:(HTMLToken *)token
{
void (^ common) (BOOL) = ^ (BOOL reprocess) {
if (![_stackOfOpenElements hasElementInTableScopeWithAnyOfTagNames:@[@"tbody", @"tfoot", @"thead"]]) {
if (![self->_stackOfOpenElements hasElementInTableScopeWithAnyOfTagNames:@[@"tbody", @"tfoot", @"thead"]]) {
[self emitParseError:@"Unexpected tag '%@' for misnested element in <tbody>", token.asTagToken.tagName];
return;
} else {
[_stackOfOpenElements clearBackToTableBodyContext];
[_stackOfOpenElements popCurrentNode];
[self->_stackOfOpenElements clearBackToTableBodyContext];
[self->_stackOfOpenElements popCurrentNode];
[self switchInsertionMode:HTMLInsertionModeInTable];
}
@@ -1946,12 +1946,12 @@
- (void)HTMLInsertionModeInRow:(HTMLToken *)token
{
void (^ common) (NSString *, BOOL) = ^ (NSString *elementTagName, BOOL reprocess) {
if (![_stackOfOpenElements hasElementInTableScopeWithTagName:elementTagName]) {
if (![self->_stackOfOpenElements hasElementInTableScopeWithTagName:elementTagName]) {
[self emitParseError:@"Unexpected tag '%@' for misnested element <%@> in <tr>", token.asTagToken.tagName, elementTagName];
return;
} else {
[_stackOfOpenElements clearBackToTableRowContext];
[_stackOfOpenElements popCurrentNode];
[self->_stackOfOpenElements clearBackToTableRowContext];
[self->_stackOfOpenElements popCurrentNode];
[self switchInsertionMode:HTMLInsertionModeInTableBody];
}
@@ -2513,13 +2513,13 @@
[characters enumerateSubstringsInRange:NSMakeRange(0, characters.length)
options:NSStringEnumerationByComposedCharacterSequences
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
if ([substring isEqualToString:@"\uFFFD"]) {
[self emitParseError:@"Unexpected Character (0x0000) in foreign content"];
} else if (!substring.htmlkit_isHTMLWhitespaceString) {
_framesetOkFlag = NO;
}
[self insertCharacters:substring];
}];
if ([substring isEqualToString:@"\uFFFD"]) {
[self emitParseError:@"Unexpected Character (0x0000) in foreign content"];
} else if (!substring.htmlkit_isHTMLWhitespaceString) {
self->_framesetOkFlag = NO;
}
[self insertCharacters:substring];
}];
return;
}
@@ -2541,23 +2541,19 @@
}
[self insertForeignElementForToken:token.asTagToken inNamespace:self.adjustedCurrentNode.htmlNamespace];
if (token.asTagToken.selfClosing) {
[_stackOfOpenElements popCurrentNode];
[self->_stackOfOpenElements popCurrentNode];
}
};
void (^ matchedCase)(void) = ^ {
[self emitParseError:@"Unexpected start tag <%@> in foreign content", token.asTagToken.tagName];
if (_fragmentParsingAlgorithm) {
anythingElse();
} else {
[_stackOfOpenElements popCurrentNode];
while (!IsNodeMathMLTextIntegrationPoint(self.currentNode) &&
!IsNodeHTMLIntegrationPoint(self.currentNode) &&
self.currentNode.htmlNamespace != HTMLNamespaceHTML) {
[_stackOfOpenElements popCurrentNode];
}
[self reprocessToken:token];
while (!IsNodeMathMLTextIntegrationPoint(self.currentNode) &&
!IsNodeHTMLIntegrationPoint(self.currentNode) &&
self.currentNode.htmlNamespace != HTMLNamespaceHTML) {
[self->_stackOfOpenElements popCurrentNode];
}
[self processToken:token byApplyingRulesForInsertionMode:HTMLInsertionModeInBody];
};
if ([token.asTagToken.tagName isEqualToAny:@"b", @"big", @"blockquote", @"body", @"br",
+4 -4
View File
@@ -54,11 +54,11 @@
[_result setString:@""];
HTMLNodeVisitorBlock *nodeVisitor = [HTMLNodeVisitorBlock visitorWithEnterBlock:^(HTMLNode * node) {
if (scope == HTMLSerializationScopeChildrenOnly && node == _root) {
if (scope == HTMLSerializationScopeChildrenOnly && node == self->_root) {
return;
}
if (_ignore > 0) {
if (self->_ignore > 0) {
return;
}
@@ -79,7 +79,7 @@
break;
}
} leaveBlock:^(HTMLNode * _Nonnull node) {
if (scope == HTMLSerializationScopeChildrenOnly && node == _root) {
if (scope == HTMLSerializationScopeChildrenOnly && node == self->_root) {
return;
}
@@ -88,7 +88,7 @@
if ([node.asElement.tagName isEqualToAny:@"area", @"base", @"basefont", @"bgsound", @"br", @"col", @"embed",
@"frame", @"hr", @"img", @"input", @"keygen", @"link", @"menuitem", @"meta", @"param", @"source",
@"track", @"wbr", nil]) {
_ignore--;
self->_ignore--;
break;
}
[self closeElement:node.asElement];
+1
View File
@@ -2413,6 +2413,7 @@
usingComparator:^ NSComparisonResult (id obj1, id obj2) { return [obj1 compare:obj2]; }];
if (searchIndex >= entities.count || ![[entities objectAtIndex:searchIndex] hasPrefix:name]) {
[name setString:[name substringToIndex:name.length -1]];
break;
}
+5
View File
@@ -15,6 +15,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface HTMLComment : HTMLCharacterData
/**
Decalration override for `NS_UNAVAILABLE` declared in `HTMLNode`
*/
- (instancetype)init;
/**
Initializes a new HTML comment node.
+5
View File
@@ -78,6 +78,11 @@ typedef NS_ENUM(short, HTMLDocumentReadyState)
*/
+ (instancetype)documentWithString:(NSString *)string;
/**
Decalration override for `NS_UNAVAILABLE` declared in `HTMLNode`
*/
- (instancetype)init;
/**
Adopts a given node into this document, i.e. the document becomes the new owner of the node. Raises a HTMLKitNotSupportedError
exception if node is an instance of HTMLDocument.
+5
View File
@@ -18,6 +18,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface HTMLDocumentFragment : HTMLNode
/**
Decalration override for `NS_UNAVAILABLE` declared in `HTMLNode`
*/
- (instancetype)init;
/**
Initializes a new document fragment with the given document as owner.
+5
View File
@@ -31,6 +31,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, copy, readonly) NSString *systemIdentifier;
/**
Decalration override for `NS_UNAVAILABLE` declared in `HTMLNode`
*/
- (instancetype)init;
/**
Initializes and returns a new isntance of a Document Type node.
+98 -95
View File
@@ -29,64 +29,66 @@ NS_INLINE void AdjustSVGAttributes(HTMLTagToken *token)
return;
}
NSDictionary *replacements = @{@"attributename": @"attributeName",
@"attributetype": @"attributeType",
@"basefrequency": @"baseFrequency",
@"baseprofile": @"baseProfile",
@"calcmode": @"calcMode",
@"clippathunits": @"clipPathUnits",
@"diffuseconstant": @"diffuseConstant",
@"edgemode": @"edgeMode",
@"filterunits": @"filterUnits",
@"glyphref": @"glyphRef",
@"gradienttransform": @"gradientTransform",
@"gradientunits": @"gradientUnits",
@"kernelmatrix": @"kernelMatrix",
@"kernelunitlength": @"kernelUnitLength",
@"keypoints": @"keyPoints",
@"keysplines": @"keySplines",
@"keytimes": @"keyTimes",
@"lengthadjust": @"lengthAdjust",
@"limitingconeangle": @"limitingConeAngle",
@"markerheight": @"markerHeight",
@"markerunits": @"markerUnits",
@"markerwidth": @"markerWidth",
@"maskcontentunits": @"maskContentUnits",
@"maskunits": @"maskUnits",
@"numoctaves": @"numOctaves",
@"pathlength": @"pathLength",
@"patterncontentunits": @"patternContentUnits",
@"patterntransform": @"patternTransform",
@"patternunits": @"patternUnits",
@"pointsatx": @"pointsAtX",
@"pointsaty": @"pointsAtY",
@"pointsatz": @"pointsAtZ",
@"preservealpha": @"preserveAlpha",
@"preserveaspectratio": @"preserveAspectRatio",
@"primitiveunits": @"primitiveUnits",
@"refx": @"refX",
@"refy": @"refY",
@"repeatcount": @"repeatCount",
@"repeatdur": @"repeatDur",
@"requiredextensions": @"requiredExtensions",
@"requiredfeatures": @"requiredFeatures",
@"specularconstant": @"specularConstant",
@"specularexponent": @"specularExponent",
@"spreadmethod": @"spreadMethod",
@"startoffset": @"startOffset",
@"stddeviation": @"stdDeviation",
@"stitchtiles": @"stitchTiles",
@"surfacescale": @"surfaceScale",
@"systemlanguage": @"systemLanguage",
@"tablevalues": @"tableValues",
@"targetx": @"targetX",
@"targety": @"targetY",
@"textlength": @"textLength",
@"viewbox": @"viewBox",
@"viewtarget": @"viewTarget",
@"xchannelselector": @"xChannelSelector",
@"ychannelselector": @"yChannelSelector",
@"zoomandpan": @"zoomAndPan"};
NSDictionary *replacements = @{
@"attributename": @"attributeName",
@"attributetype": @"attributeType",
@"basefrequency": @"baseFrequency",
@"baseprofile": @"baseProfile",
@"calcmode": @"calcMode",
@"clippathunits": @"clipPathUnits",
@"diffuseconstant": @"diffuseConstant",
@"edgemode": @"edgeMode",
@"filterunits": @"filterUnits",
@"glyphref": @"glyphRef",
@"gradienttransform": @"gradientTransform",
@"gradientunits": @"gradientUnits",
@"kernelmatrix": @"kernelMatrix",
@"kernelunitlength": @"kernelUnitLength",
@"keypoints": @"keyPoints",
@"keysplines": @"keySplines",
@"keytimes": @"keyTimes",
@"lengthadjust": @"lengthAdjust",
@"limitingconeangle": @"limitingConeAngle",
@"markerheight": @"markerHeight",
@"markerunits": @"markerUnits",
@"markerwidth": @"markerWidth",
@"maskcontentunits": @"maskContentUnits",
@"maskunits": @"maskUnits",
@"numoctaves": @"numOctaves",
@"pathlength": @"pathLength",
@"patterncontentunits": @"patternContentUnits",
@"patterntransform": @"patternTransform",
@"patternunits": @"patternUnits",
@"pointsatx": @"pointsAtX",
@"pointsaty": @"pointsAtY",
@"pointsatz": @"pointsAtZ",
@"preservealpha": @"preserveAlpha",
@"preserveaspectratio": @"preserveAspectRatio",
@"primitiveunits": @"primitiveUnits",
@"refx": @"refX",
@"refy": @"refY",
@"repeatcount": @"repeatCount",
@"repeatdur": @"repeatDur",
@"requiredextensions": @"requiredExtensions",
@"requiredfeatures": @"requiredFeatures",
@"specularconstant": @"specularConstant",
@"specularexponent": @"specularExponent",
@"spreadmethod": @"spreadMethod",
@"startoffset": @"startOffset",
@"stddeviation": @"stdDeviation",
@"stitchtiles": @"stitchTiles",
@"surfacescale": @"surfaceScale",
@"systemlanguage": @"systemLanguage",
@"tablevalues": @"tableValues",
@"targetx": @"targetX",
@"targety": @"targetY",
@"textlength": @"textLength",
@"viewbox": @"viewBox",
@"viewtarget": @"viewTarget",
@"xchannelselector": @"xChannelSelector",
@"ychannelselector": @"yChannelSelector",
@"zoomandpan": @"zoomAndPan"
};
HTMLOrderedDictionary *adjusted = [HTMLOrderedDictionary new];
for (id key in token.attributes) {
@@ -99,43 +101,44 @@ NS_INLINE void AdjustSVGAttributes(HTMLTagToken *token)
NS_INLINE void AdjustSVGNameCase(HTMLTagToken *token)
{
NSDictionary *replacements = @{
@"altglyph": @"altGlyph",
@"altglyphdef": @"altGlyphDef",
@"altglyphitem": @"altGlyphItem",
@"animatecolor": @"animateColor",
@"animatemotion": @"animateMotion",
@"animatetransform": @"animateTransform",
@"clippath": @"clipPath",
@"feblend": @"feBlend",
@"fecolormatrix": @"feColorMatrix",
@"fecomponenttransfer": @"feComponentTransfer",
@"fecomposite": @"feComposite",
@"feconvolvematrix": @"feConvolveMatrix",
@"fediffuselighting": @"feDiffuseLighting",
@"fedisplacementmap": @"feDisplacementMap",
@"fedistantlight": @"feDistantLight",
@"fedropshadow": @"feDropShadow",
@"feflood": @"feFlood",
@"fefunca": @"feFuncA",
@"fefuncb": @"feFuncB",
@"fefuncg": @"feFuncG",
@"fefuncr": @"feFuncR",
@"fegaussianblur": @"feGaussianBlur",
@"feimage": @"feImage",
@"femerge": @"feMerge",
@"femergenode": @"feMergeNode",
@"femorphology": @"feMorphology",
@"feoffset": @"feOffset",
@"fepointlight": @"fePointLight",
@"fespecularlighting": @"feSpecularLighting",
@"fespotlight": @"feSpotLight",
@"fetile": @"feTile",
@"feturbulence": @"feTurbulence",
@"foreignobject": @"foreignObject",
@"glyphref": @"glyphRef",
@"lineargradient": @"linearGradient",
@"radialgradient": @"radialGradient",
@"textpath": @"textPath"};
@"altglyph": @"altGlyph",
@"altglyphdef": @"altGlyphDef",
@"altglyphitem": @"altGlyphItem",
@"animatecolor": @"animateColor",
@"animatemotion": @"animateMotion",
@"animatetransform": @"animateTransform",
@"clippath": @"clipPath",
@"feblend": @"feBlend",
@"fecolormatrix": @"feColorMatrix",
@"fecomponenttransfer": @"feComponentTransfer",
@"fecomposite": @"feComposite",
@"feconvolvematrix": @"feConvolveMatrix",
@"fediffuselighting": @"feDiffuseLighting",
@"fedisplacementmap": @"feDisplacementMap",
@"fedistantlight": @"feDistantLight",
@"fedropshadow": @"feDropShadow",
@"feflood": @"feFlood",
@"fefunca": @"feFuncA",
@"fefuncb": @"feFuncB",
@"fefuncg": @"feFuncG",
@"fefuncr": @"feFuncR",
@"fegaussianblur": @"feGaussianBlur",
@"feimage": @"feImage",
@"femerge": @"feMerge",
@"femergenode": @"feMergeNode",
@"femorphology": @"feMorphology",
@"feoffset": @"feOffset",
@"fepointlight": @"fePointLight",
@"fespecularlighting": @"feSpecularLighting",
@"fespotlight": @"feSpotLight",
@"fetile": @"feTile",
@"feturbulence": @"feTurbulence",
@"foreignobject": @"foreignObject",
@"glyphref": @"glyphRef",
@"lineargradient": @"linearGradient",
@"radialgradient": @"radialGradient",
@"textpath": @"textPath"
};
NSString *replacement = replacements[token.tagName] ?: token.tagName;
token.tagName = replacement;
+5
View File
@@ -18,6 +18,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface HTMLTemplate : HTMLElement
/**
Decalration override for `NS_UNAVAILABLE` declared in `HTMLNode`
*/
- (instancetype)init;
/**
The content of the template.
+5
View File
@@ -15,6 +15,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface HTMLText : HTMLCharacterData
/**
Decalration override for `NS_UNAVAILABLE` declared in `HTMLNode`
*/
- (instancetype)init;
/**
Initializes a new HTML text node.
+1 -1
View File
@@ -51,7 +51,7 @@
[_cases addObject:_currentCase];
}
- (void)testCase:(XCTestCase *)testCase didFailWithDescription:(NSString *)description inFile:(NSString *)filePath atLine:(NSUInteger)lineNumber
- (void)testCase:(XCTestCase *)testCase didRecordIssue:(XCTIssue *)issue
{
_currentCase[@"status"] = @"Failed";
}
+1 -1
View File
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.braincookie.${PRODUCT_NAME:rfc1034identifier}</string>
<string>dev.iabudiab.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
@@ -28,7 +28,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
parent = [HTMLDocumentFragment new];
XCTAssertNoThrow([parent appendNode:element]);
parent = [HTMLElement new];
parent = [[HTMLElement alloc] initWithTagName:@"div"];
XCTAssertNoThrow([parent appendNode:element]);
parent = [HTMLTemplate new];
@@ -54,7 +54,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
parent = [HTMLDocumentFragment new];
XCTAssertNoThrow([parent insertNode:element beforeChildNode:nil]);
parent = [HTMLElement new];
parent = [[HTMLElement alloc] initWithTagName:@"div"];
XCTAssertNoThrow([parent insertNode:element beforeChildNode:nil]);
parent = [HTMLTemplate new];
@@ -115,9 +115,9 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
XCTAssertNoThrow([document appendNode:[HTMLDocumentFragment new]]);
XCTAssertNoThrow([document appendNode:[HTMLDocumentType new]]);
XCTAssertNoThrow([document appendNode:[HTMLElement new]]);
XCTAssertNoThrow([document appendNode:[[HTMLElement alloc] initWithTagName:@"div"]]);
HTMLElement *element = [HTMLElement new];
HTMLElement *element = [[HTMLElement alloc] initWithTagName:@"div"];
XCTAssertNoThrow([element appendNode:[HTMLTemplate new]]);
XCTAssertNoThrow([element appendNode:[HTMLComment new]]);
@@ -132,7 +132,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
XCTAssertThrows([[HTMLDocumentFragment new] appendNode:doctype]);
XCTAssertThrows([[HTMLDocumentType new] appendNode:doctype]);
XCTAssertThrows([[HTMLElement new] appendNode:doctype]);
XCTAssertThrows([[[HTMLElement alloc] initWithTagName:@"div"] appendNode:doctype]);
XCTAssertThrows([[HTMLTemplate new] appendNode:doctype]);
XCTAssertThrows([[HTMLComment new] appendNode:doctype]);
XCTAssertThrows([[HTMLText new] appendNode:doctype]);
@@ -148,7 +148,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
XCTAssertThrows([[HTMLText new] appendNode:text]);
XCTAssertNoThrow([[HTMLDocumentFragment new] appendNode:text]);
XCTAssertNoThrow([[HTMLElement new] appendNode:text]);
XCTAssertNoThrow([[[HTMLElement alloc] initWithTagName:@"div"] appendNode:text]);
XCTAssertNoThrow([[HTMLTemplate new] appendNode:text]);
}
@@ -172,8 +172,8 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
* Fragment has more than one Element child
*/
reset();
[fragment appendNode:[HTMLElement new]];
[fragment appendNode:[HTMLElement new]];
[fragment appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
[fragment appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
XCTAssertThrows([document appendNode:fragment]);
@@ -182,8 +182,8 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
* Document has an Element child
*/
reset();
[fragment appendNode:[HTMLElement new]];
[document appendNode:[HTMLElement new]];
[fragment appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
[document appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
XCTAssertThrows([document appendNode:fragment]);
/**
@@ -192,7 +192,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
*/
reset();
HTMLDocumentType *doctype = [HTMLDocumentType new];
[fragment appendNode:[HTMLElement new]];
[fragment appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
[document appendNode:doctype];
XCTAssertThrows([document insertNode:fragment beforeChildNode:doctype]);
@@ -202,7 +202,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
*/
reset();
HTMLComment *doctypePreviousSibling = [HTMLComment new];
[fragment appendNode:[HTMLElement new]];
[fragment appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
[document appendNode:doctypePreviousSibling];
[document appendNode:doctype];
XCTAssertThrows([document insertNode:fragment beforeChildNode:doctypePreviousSibling]);
@@ -211,7 +211,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
- (void)testValidElementInsertionIntoDocument
{
HTMLDocument *document = [HTMLDocument new];
HTMLElement *element = [HTMLElement new];
HTMLElement *element = [[HTMLElement alloc] initWithTagName:@"div"];
void (^ reset)(void) = ^ {
[element removeAllChildNodes];
@@ -221,7 +221,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
/**
* Document has an Element child
*/
[document appendNode:[HTMLElement new]];
[document appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
XCTAssertThrows([document appendNode:element]);
/**
@@ -262,7 +262,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
*/
reset();
HTMLComment *secondChild = [HTMLComment new];
[document appendNode:[HTMLElement new]];
[document appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
[document appendNode:secondChild];
XCTAssertThrows([document insertNode:doctype beforeChildNode:secondChild]);
@@ -270,7 +270,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
* Document has an Element child
*/
reset();
[document appendNode:[HTMLElement new]];
[document appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
XCTAssertThrows([document appendNode:doctype]);
}
@@ -296,8 +296,8 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
* Replacement Fragment has more than one Element child
*/
reset();
[replacement appendNode:[HTMLElement new]];
[replacement appendNode:[HTMLElement new]];
[replacement appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
[replacement appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
XCTAssertThrows([document replaceChildNode:child withNode:replacement]);
/**
@@ -305,8 +305,8 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
* Document has an Element child that is not the Replacement
*/
reset();
[replacement appendNode:[HTMLElement new]];
[document appendNode:[HTMLElement new]];
[replacement appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
[document appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
XCTAssertThrows([document replaceChildNode:child withNode:replacement]);
/**
@@ -315,7 +315,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
*/
reset();
HTMLDocumentType *doctype = [HTMLDocumentType new];
[replacement appendNode:[HTMLElement new]];
[replacement appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
[document appendNode:doctype];
XCTAssertThrows([document replaceChildNode:child withNode:replacement]);
}
@@ -324,7 +324,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
{
HTMLDocument *document = [HTMLDocument new];
HTMLComment *child = [HTMLComment new];
HTMLElement *replacement = [HTMLElement new];
HTMLElement *replacement = [[HTMLElement alloc] initWithTagName:@"div"];
void (^ reset)(void) = ^ {
[replacement removeAllChildNodes];
@@ -335,7 +335,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
/**
* Docment has an Element child that is not replacement
*/
[document appendNode:[HTMLElement new]];
[document appendNode:[[HTMLElement alloc] initWithTagName:@"div"]];
XCTAssertThrows([document replaceChildNode:child withNode:replacement]);
/**
@@ -369,7 +369,7 @@ extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
* An Element is preceding the child node
*/
reset();
[document insertNode:[HTMLElement new] beforeChildNode:child];
[document insertNode:[[HTMLElement alloc] initWithTagName:@"div"] beforeChildNode:child];
XCTAssertThrows([document replaceChildNode:child withNode:replacement]);
}
+9 -11
View File
@@ -53,8 +53,8 @@
XCTAssertEqual(element.childNodesCount, 1);
XCTAssertEqual(element.firstChild, comment);
HTMLElement *firstElement = [HTMLElement new];
HTMLElement *secondElement = [HTMLElement new];
HTMLElement *firstElement = [[HTMLElement alloc] initWithTagName:@"div"];
HTMLElement *secondElement = [[HTMLElement alloc] initWithTagName:@"div"];
NSArray *nodes = @[firstElement, secondElement];
[element appendNodes:nodes];
@@ -76,8 +76,8 @@
XCTAssertEqual(element.childNodesCount, 2);
XCTAssertEqual(element.firstChild, comment);
HTMLElement *firstElement = [HTMLElement new];
HTMLElement *secondElement = [HTMLElement new];
HTMLElement *firstElement = [[HTMLElement alloc] initWithTagName:@"div"];
HTMLElement *secondElement = [[HTMLElement alloc] initWithTagName:@"div"];
NSArray *nodes = @[firstElement, secondElement];
[element prependNodes:nodes];
@@ -94,8 +94,8 @@
[element appendNode:comment];
HTMLDocumentFragment *fragment = [HTMLDocumentFragment new];
HTMLElement *firstChild = [HTMLElement new];
HTMLElement *secondChild = [HTMLElement new];
HTMLElement *firstChild = [[HTMLElement alloc] initWithTagName:@"div"];
HTMLElement *secondChild = [[HTMLElement alloc] initWithTagName:@"div"];
[fragment appendNode:firstChild];
[fragment appendNode:secondChild];
@@ -494,10 +494,8 @@
XCTAssertTrue([paragraph compareDocumentPositionWithNode:paragraph] == HTMLDocumentPositionEquivalent);
HTMLElement *element = [HTMLElement new];
XCTAssertTrue([paragraph compareDocumentPositionWithNode:element] ==
(HTMLDocumentPositionDisconnected | HTMLDocumentPositionImplementationSpecific |
paragraph.hash < element.hash ? HTMLDocumentPositionPreceding: HTMLDocumentPositionFollowing));
HTMLElement *element = [[HTMLElement alloc] initWithTagName:@"div"];
XCTAssertTrue([paragraph compareDocumentPositionWithNode:element] == HTMLDocumentPositionPreceding);
XCTAssertTrue([paragraph compareDocumentPositionWithNode:image] == HTMLDocumentPositionPreceding);
XCTAssertTrue([anchor compareDocumentPositionWithNode:image] == HTMLDocumentPositionPreceding);
@@ -558,7 +556,7 @@
#pragma mark - Bug Fixes
- (void)testBugFix_Issue_20 {
HTMLElement *element = [HTMLElement new];
HTMLElement *element = [[HTMLElement alloc] initWithTagName:@"div"];
element.elementId = @"originalId";
HTMLElement *clone = [element cloneNodeDeep:YES];
+1 -1
View File
@@ -103,7 +103,7 @@
{
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:[[HTMLElement alloc] initWithTagName:@"div"] 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");
XCTAssertThrows([range setStartNode:_firstText startOffset:_firstText.length + 1], @"Offset is outside the boundary node");