          nil]);
    }
    return validAttributesForMarkedText_.get();
-@@ -3431,6 +3453,10 @@ - (BOOL)readSelectionFromPasteboard:(NSPasteboard*)pboard {
+@@ -3221,6 +3241,10 @@ - (BOOL)readSelectionFromPasteboard:(NSPasteboard*)pboard {
  }
  
  - (BOOL)isOpaque {

   [cocoa_view_ setLayer:background_layer_];
   [cocoa_view_ setWantsLayer:YES];
 
@@ -669,6 +677,8 @@ float FlipYFromRectToScreen(float y, float rect_height) {
     browser_compositor_->Unsuspend();
     browser_compositor_state_ = BrowserCompositorActive;
   }
+  if (![cocoa_view() isOpaque])
+    root_layer_->GetCompositor()->SetHostHasTransparentBackground(true);
 }
 
 void RenderWidgetHostViewMac::SuspendBrowserCompositorView() {
@@ -1914,6 +1924,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
 }
 
 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {

 // These are not documented, so use only after checking -respondsToSelector:.
 @interface NSApplication (UndocumentedSpeechMethods)
 - (void)speakString:(NSString*)string;
@@ -506,7 +512,9 @@ float FlipYFromRectToScreen(float y, float rect_height) {
   background_layer_.reset([[CALayer alloc] init]);
   // Set the default color to be white. This is the wrong thing to do, but many
   // UI components expect this view to be opaque.
