Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit f7ae842

Browse files
WKPage's setBackgroundExtendsBeyondPage API should be exposed through WKView and
WKWebView https://bugs.webkit.org/show_bug.cgi?id=129120 Reviewed by Anders Carlsson. While we’re in this code, fix up the pageExtendedBackgroundColor to match. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/ios/WKViewIOS.mm: (-[WKView _pageExtendedBackgroundColor]): (-[WKView _setBackgroundExtendsBeyondPage:]): (-[WKView _backgroundExtendsBeyondPage]): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 4b0f13d commit f7ae842

File tree

5 files changed

+49
-5
lines changed

5 files changed

+49
-5
lines changed

Source/WebKit2/ChangeLog

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2014-02-20 Beth Dakin <[email protected]>
2+
3+
WKPage's setBackgroundExtendsBeyondPage API should be exposed through WKView and
4+
WKWebView
5+
https://bugs.webkit.org/show_bug.cgi?id=129120
6+
7+
Reviewed by Anders Carlsson.
8+
9+
While we’re in this code, fix up the pageExtendedBackgroundColor to match.
10+
* UIProcess/API/Cocoa/WKViewPrivate.h:
11+
* UIProcess/API/Cocoa/WKWebView.mm:
12+
(-[WKWebView _pageExtendedBackgroundColor]):
13+
(-[WKWebView _setBackgroundExtendsBeyondPage:]):
14+
(-[WKWebView _backgroundExtendsBeyondPage]):
15+
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
16+
* UIProcess/API/ios/WKViewIOS.mm:
17+
(-[WKView _pageExtendedBackgroundColor]):
18+
(-[WKView _setBackgroundExtendsBeyondPage:]):
19+
(-[WKView _backgroundExtendsBeyondPage]):
20+
121
2014-02-20 Dean Jackson <[email protected]>
222

323
Add an unresolved WebGLPolicy and an API to resolve it

Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
// Define the inset of the scrollview unusable by the web page.
4848
@property (nonatomic, setter=_setObscuredInsets:) UIEdgeInsets _obscuredInsets;
4949

50-
- (UIColor *)pageExtendedBackgroundColor;
50+
@property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage;
51+
@property (readonly) UIColor *_pageExtendedBackgroundColor;
5152

5253
- (void)_beginInteractiveObscuredInsetsChange;
5354
- (void)_endInteractiveObscuredInsetsChange;

Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ - (void)_setObscuredInsets:(UIEdgeInsets)obscuredInsets
596596
_obscuredInsets = obscuredInsets;
597597
}
598598

599-
- (UIColor *)pageExtendedBackgroundColor
599+
- (UIColor *)_pageExtendedBackgroundColor
600600
{
601601
WebCore::Color color = _page->pageExtendedBackgroundColor();
602602
if (!color.isValid())
@@ -605,6 +605,16 @@ - (UIColor *)pageExtendedBackgroundColor
605605
return [UIColor colorWithRed:(color.red() / 255.0) green:(color.green() / 255.0) blue:(color.blue() / 255.0) alpha:(color.alpha() / 255.0)];
606606
}
607607

608+
- (void)_setBackgroundExtendsBeyondPage:(BOOL)backgroundExtends
609+
{
610+
_page->setBackgroundExtendsBeyondPage(backgroundExtends);
611+
}
612+
613+
- (BOOL)_backgroundExtendsBeyondPage
614+
{
615+
return _page->backgroundExtendsBeyondPage();
616+
}
617+
608618
- (void)_beginInteractiveObscuredInsetsChange
609619
{
610620
ASSERT(!_isChangingObscuredInsetsInteractively);

Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ typedef NS_OPTIONS(NSUInteger, _WKRenderingProgressEvents) {
6969
// Define the inset of the scrollview unusable by the web page.
7070
@property (nonatomic, setter=_setObscuredInsets:) UIEdgeInsets _obscuredInsets;
7171

72-
- (UIColor *)pageExtendedBackgroundColor;
72+
@property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage;
73+
@property (readonly) UIColor *_pageExtendedBackgroundColor;
7374

7475
- (void)_beginInteractiveObscuredInsetsChange;
7576
- (void)_endInteractiveObscuredInsetsChange;

Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,26 @@ - (void)_endInteractiveObscuredInsetsChange
387387
_isChangingObscuredInsetsInteractively = NO;
388388
}
389389

390-
- (UIColor *)pageExtendedBackgroundColor
390+
- (UIColor *)_pageExtendedBackgroundColor
391391
{
392-
WebPageProxy *webPageProxy = toImpl([_contentView _pageRef]);
392+
WebPageProxy* webPageProxy = toImpl([_contentView _pageRef]);
393393
WebCore::Color color = webPageProxy->pageExtendedBackgroundColor();
394394
if (!color.isValid())
395395
return nil;
396396

397397
return [UIColor colorWithRed:(color.red() / 255.0) green:(color.green() / 255.0) blue:(color.blue() / 255.0) alpha:(color.alpha() / 255.0)];
398398
}
399399

400+
- (void)_setBackgroundExtendsBeyondPage:(BOOL)backgroundExtends
401+
{
402+
WebPageProxy* webPageProxy = toImpl([_contentView _pageRef]);
403+
webPageProxy->setBackgroundExtendsBeyondPage(backgroundExtends);
404+
}
405+
406+
- (BOOL)_backgroundExtendsBeyondPage
407+
{
408+
WebPageProxy* webPageProxy = toImpl([_contentView _pageRef]);
409+
return webPageProxy->backgroundExtendsBeyondPage();
410+
}
411+
400412
@end

0 commit comments

Comments
 (0)