Commit 98cb6be4 authored by benjamin@webkit.org's avatar benjamin@webkit.org

Add a minimalistic SPI to control the layout size outside of WKView

https://bugs.webkit.org/show_bug.cgi?id=127403

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-01-22
Reviewed by Sam Weinig.

The API lets a client of WKView force the layout size. Once the size
is set this way, default update is disabled and the client needs to
update the size systematically as needed. This is done to avoid double
layout or flickering.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView _frameOrBoundsChanged]):
(-[WKView overrideMinimumLayoutSize:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a59aad63
2014-01-22 Benjamin Poulain <bpoulain@apple.com>
Add a minimalistic SPI to control the layout size outside of WKView
https://bugs.webkit.org/show_bug.cgi?id=127403
Reviewed by Sam Weinig.
The API lets a client of WKView force the layout size. Once the size
is set this way, default update is disabled and the client needs to
update the size systematically as needed. This is done to avoid double
layout or flickering.
* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView _frameOrBoundsChanged]):
(-[WKView overrideMinimumLayoutSize:]):
2014-01-22 Jinwoo Song <jinwoo7.song@samsung.com>
[EFL][WK2] defaultTextEncodingName should be stored as a member variable of EwkSettings
......
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
* Copyright (C) 2011, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -40,7 +40,11 @@
- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage;
#endif
#if !TARGET_OS_IPHONE
#if TARGET_OS_IPHONE
@property (nonatomic) CGSize minimumLayoutSizeOverride;
#else
- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef;
- (BOOL)canChangeFrameLayout:(WKFrameRef)frameRef;
......
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
* Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -49,6 +49,7 @@ static struct _UIWebViewportConfiguration standardViewportConfiguration = { { UI
BOOL _userHasChangedPageScale;
RetainPtr<_UIWebViewportHandler> _viewportHandler;
BOOL _hasStaticMinimumLayoutSize;
}
- (id)initWithCoder:(NSCoder *)coder
......@@ -257,9 +258,11 @@ static struct _UIWebViewportConfiguration standardViewportConfiguration = { { UI
- (void)_frameOrBoundsChanged
{
CGRect bounds = [self bounds];
[_viewportHandler update:^{
[_viewportHandler setAvailableViewSize:bounds.size];
}];
if (!_hasStaticMinimumLayoutSize) {
[_viewportHandler update:^{
[_viewportHandler setAvailableViewSize:bounds.size];
}];
}
[_scrollView setFrame:bounds];
[_contentView setMinimumSize:bounds.size];
}
......@@ -298,4 +301,18 @@ static struct _UIWebViewportConfiguration standardViewportConfiguration = { { UI
return self;
}
- (CGSize)minimumLayoutSizeOverride
{
ASSERT(_hasStaticMinimumLayoutSize);
return [_viewportHandler availableViewSize];
}
- (void)setMinimumLayoutSizeOverride:(CGSize)minimumLayoutSizeOverride
{
_hasStaticMinimumLayoutSize = YES;
[_viewportHandler update:^{
[_viewportHandler setAvailableViewSize:minimumLayoutSizeOverride];
}];
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment