summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/WebView/WebFrame.mm
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/mac/WebView/WebFrame.mm')
-rw-r--r--WebKit/mac/WebView/WebFrame.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index b4169b6..7545bd8 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -541,7 +541,15 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
FrameView* view = _private->coreFrame->view();
- bool shouldFlatten = WKCGContextIsBitmapContext(ctx) && [getWebView(self) _includesFlattenedCompositingLayersWhenDrawingToBitmap];
+ bool shouldFlatten = false;
+ if (Frame* parentFrame = _private->coreFrame->tree()->parent()) {
+ // For subframes, we need to inherit the paint behavior from our parent
+ FrameView* parentView = parentFrame ? parentFrame->view() : 0;
+ if (parentView)
+ shouldFlatten = parentView->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
+ } else
+ shouldFlatten = WKCGContextIsBitmapContext(ctx) && [getWebView(self) _includesFlattenedCompositingLayersWhenDrawingToBitmap];
+
PaintBehavior oldBehavior = PaintBehaviorNormal;
if (shouldFlatten) {
oldBehavior = view->paintBehavior();