码迷,mamicode.com
首页 > 其他好文 > 详细

浏览器应用开发常用知识

时间:2014-11-05 17:16:52      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:android   blog   io   os   使用   sp   div   on   2014   

1、浏览器生成默认UA

Android浏览器的UA的生成实在android.webview.WebSettingsClassic.getCurrentUserAgent()中,会根据Build.VERSION.RELEASE,Build.MODEL等来生成系统版本和机型等信息来组装生成UA

2、Android WebView打印dom树和render树

1、使用WebViewClassic.dumpDomTree(boolean toFile)、WebViewClassic.dumpRenderTree(boolean toFile)和WebViewClassic.dumpDisplayTree()
2、在Source/WebKit/android/AndroidLog.h中把ANDROID_DOM_LOGGING开关打开
3、调用WebViewClassic.fromWebView(webview).dumpDomTree(true)...
domTree.txt

*#document	0x77e3af80
	html	0x77b10650
	HTML	0x77e3c098
		HEAD	0x7816f850
		BODY	0x7816f8a8
			VIDEO	0x77e3b8b8
				#text	0x77afc0f8 "\nYour browser does not support the video tag.\n"

renderTree.txt

layer at (0,0) size 980x1325
  RenderView at (0,0) size 980x1325
layer at (0,0) size 980x220
  RenderBlock {HTML} at (0,0) size 980x220
    RenderBody {BODY} at (8,8) size 964x204
      RenderText {#text} at (0,0) size 0x0
layer at (8,8) size 320x200
  RenderVideo {VIDEO} at (0,0) size 320x200
layer at (8,8) size 320x200
  RenderBlock (relative positioned) {DIV} at (0,0) size 320x200
layer at (8,160) size 320x48
  RenderFlexibleBox (positioned) {DIV} at (0,152) size 320x48
    RenderButton {INPUT} at (0,0) size 48x48
    RenderFlexibleBox {DIV} at (48,0) size 224x48
      RenderSlider {INPUT} at (0,0) size 224x48
        RenderBlock {DIV} at (0,8) size 32x32
    RenderButton {INPUT} at (272,0) size 48x48


浏览器应用开发常用知识

标签:android   blog   io   os   使用   sp   div   on   2014   

原文地址:http://blog.csdn.net/heqiangflytosky/article/details/40657201

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!