It's an issue with NativeViewHost and it becomes problematic when the same setup of views gives you different visual results.
Assuming you have following view structure:
+ View0 (size:50x50)
|
+ View1 (size:200x200) with established layer
|
+ NativeViewHost (a WebView for example) (size:200x200)
+ Button (size:200x200)
With such structure the View1 is not clipped by the View0 because it establishes a separate layer. The Button descendant contributes to the View1's layer and it is not clipped by the View0 as well. However, unlike the button the NativeViewHost clips itself to the size of View0 (by setting the hosted NativeView's bounds) as this is what GetVisibleBounds returns. OTOH, if you explicitly apply a clip path to the View1 it will clip the view itself including the button descendant but not the NativeView hosted by the NativeViewHost as the rect recturned by GetVisibleBounds ignores view's clip settings. In the end we have sibling views where one is clipped by its incestor and the other one is not.
Here's the example code and the visual output:
auto* outer = container->AddChildView(std::make_unique<views::View>());
outer->SetBounds(0, 0, 200, 200);
outer->SetBorder(views::CreateSolidBorder(1, SK_ColorMAGENTA));
auto* inner = outer->AddChildView(std::make_unique<views::View>());
inner->SetBounds(0, 0, 400, 400);
inner->SetBackground(views::CreateSolidBackground(SK_ColorYELLOW));
inner->SetPaintToLayer();
webview_ = inner->AddChildView(std::make_unique<WebView>(browser_context_));
webview_->GetWebContents()->SetDelegate(this);
webview_->SetBounds(0, 0, 400, 400);
auto* b = inner->AddChildView(std::make_unique<views::MdTextButton>());
b->SetText(u"Test");
b->SetBounds(300, 300, 50, 50);
webview_->LoadInitialURL(GURL("http://www.google.com/"));
/K