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; } 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; 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 +} 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 } 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]; + }); } }