您的位置:首页 > 其它

设置 webkit 背景透明的几种办法

2014-11-18 21:59 344 查看
void
FrameLoaderClient::transitionToCommittedForNewPage()


02.
{


03.
WebKitWebView*
 containingWindow = getViewFromFrame(m_frame);


04.
IntSize
 size = IntSize(GTK_WIDGET(containingWindow)->allocation.width,


05.
GTK_WIDGET(containingWindow)->allocation.height);


06.
bool
transparent
 = webkit_web_view_get_transparent(containingWindow);
//modify
 by raulli 20110922


07.
Color
 backgroundColor = transparent ? WebCore::Color::transparent : WebCore::Color::white;


08.
Frame*
 frame = core(m_frame);


09.
ASSERT(frame);


10.


11.
frame->createView(size,
 backgroundColor, transparent, IntSize(),
false
);


12.


13.
//
 We need to do further manipulation on the FrameView if it was the mainFrame


14.
if
(frame
 != frame->page()->mainFrame())


15.
return
;


16.


17.
postCommitFrameViewSetup(m_frame,
 frame->view(),
true
);


18.
}


19.


20.
2.


21.


22.
FrameView.cpp


23.
void
FrameView::setBaseBackgroundColor(Color
 bc)


24.
{


25.
printf
(
"######
 %s:%s:%d bc=0x%0x m_baseBackgroundColor=0x%0x\n"
,__FILE__,__FUNCTION__,__LINE__,bc.rgb(),m_baseBackgroundColor.rgb());


26.
if
(!bc.isValid())


27.
{


28.
printf
(
"######
 %s:%s:%d bc=0x%0x m_baseBackgroundColor=0x%0x\n"
,__FILE__,__FUNCTION__,__LINE__,bc.rgb(),m_baseBackgroundColor.rgb());


29.
bc
 = Color::white;


30.
}


31.
printf
(
"######
 %s:%s:%d bc=0x%0x m_baseBackgroundColor=0x%0x\n"
,__FILE__,__FUNCTION__,__LINE__,bc.rgb(),m_baseBackgroundColor.rgb());


32.
m_baseBackgroundColor
 = bc;


33.
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: