From 859814d8a6f5e8054b3408574e84e0eb8a10a7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=93=8D?= Date: Mon, 10 Oct 2016 16:11:10 +0800 Subject: [PATCH 1/5] fixing bugs (iOS7 __NSCFString containsString:]: unrecognized selector sent to instance) iOS7 __NSCFString containsString:]: unrecognized selector sent to instance --- Core/Source/DTCSSStylesheet.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Source/DTCSSStylesheet.m b/Core/Source/DTCSSStylesheet.m index ad6f9dc81..0b363863e 100644 --- a/Core/Source/DTCSSStylesheet.m +++ b/Core/Source/DTCSSStylesheet.m @@ -826,7 +826,7 @@ - (NSMutableArray *)matchingComplexCascadingSelectorsForElement:(DTHTMLElement * for (NSString *selector in _orderedSelectors) { // We only process the selector if our selector has more than 1 part to it (e.g. ".foo" would be skipped and ".foo .bar" would not) - if (![selector containsString:@" "]) { + if (![selector rangeOfString:@" "].length) { continue; } From 7ceb48e6e523bdb0635369325b317fcd25918539 Mon Sep 17 00:00:00 2001 From: ChiHo Date: Mon, 10 Oct 2016 17:22:00 +0800 Subject: [PATCH 2/5] Fixed DTLazyImageView memory leak Fixed DTLazyImageView memory leak --- Core/Source/DTLazyImageView.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Core/Source/DTLazyImageView.m b/Core/Source/DTLazyImageView.m index 1c4e5c47a..401f56d2a 100644 --- a/Core/Source/DTLazyImageView.m +++ b/Core/Source/DTLazyImageView.m @@ -324,6 +324,13 @@ -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data - (void)removeFromSuperview { [super removeFromSuperview]; + +#if DTCORETEXT_USES_NSURLSESSION + [_dataTask cancel]; + [_session invalidateAndCancel]; +#else + [_connection cancel]; +#endif } #if DTCORETEXT_USES_NSURLSESSION @@ -349,6 +356,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection } #if DTCORETEXT_USES_NSURLSESSION + [_session finishTasksAndInvalidate]; _dataTask = nil; #else _connection = nil; @@ -367,6 +375,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { #if DTCORETEXT_USES_NSURLSESSION + [_session invalidateAndCancel]; _dataTask = nil; #else _connection = nil; From 377266fd638bdbb0a9d2e4b542a4515fc68c8527 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Tue, 11 Oct 2016 16:49:40 +0200 Subject: [PATCH 3/5] Do relayout after lazy loaded image on next run loop #994 --- Demo/Source/DemoTextViewController.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Demo/Source/DemoTextViewController.m b/Demo/Source/DemoTextViewController.m index d8f6f020b..33d4d220b 100644 --- a/Demo/Source/DemoTextViewController.m +++ b/Demo/Source/DemoTextViewController.m @@ -753,7 +753,10 @@ - (void)lazyImageView:(DTLazyImageView *)lazyImageView didChangeImageSize:(CGSiz if (didUpdate) { // layout might have changed due to image sizes - [_textView relayoutText]; + // do it on next run loop because a layout pass might be going on + dispatch_async(dispatch_get_main_queue(), ^{ + [_textView relayoutText]; + }); } } From f966ea5e5f0dd93cf4c251b4ef653d5cb7a18364 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Tue, 11 Oct 2016 16:51:08 +0200 Subject: [PATCH 4/5] Removed (previously ignored) margin before paragraphs #1016 --- Core/Source/default.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/Source/default.css b/Core/Source/default.css index b468de5de..b6c5fe4c4 100644 --- a/Core/Source/default.css +++ b/Core/Source/default.css @@ -42,7 +42,6 @@ article,aside,footer,header,hgroup,nav,section p { display:block; - -webkit-margin-before:1em; -webkit-margin-after:1em; -webkit-margin-start:0; -webkit-margin-end:0; @@ -267,4 +266,4 @@ table { border-collapse: separate; border-spacing: 2px; border-color: gray; -} \ No newline at end of file +} From cd43be62fde2dc69f8e0c1f88fe33b10942cb7c2 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Tue, 11 Oct 2016 18:22:05 +0200 Subject: [PATCH 5/5] Updated podspec --- DTCoreText.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DTCoreText.podspec b/DTCoreText.podspec index 2c9e4d1ea..162d847c7 100644 --- a/DTCoreText.podspec +++ b/DTCoreText.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'DTCoreText' - spec.version = '1.6.18' + spec.version = '1.6.19' spec.platforms = {:ios => '4.3', :tvos => '9.0' } spec.license = 'BSD' spec.source = { :git => 'https://github.com/Cocoanetics/DTCoreText.git', :tag => spec.version.to_s }