什么是blockwebkit boxDraw的含义及如何解决

Android 4.3 和 PhoneGap,不能点击链接
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.
我在银河注 3 上使用 PhoneGap 2.9。我有一种布局类似于 Facebook 移动。它有一个导航栏,从左边滑出。我有的问题是,当用于导航栏按钮超过屏幕的大小和需要滚动,他们不能被窃听。也就是说,它们不会执行其预期的职能,和水龙头/click 事件不会触发。导航栏仍响应刷,并且虽然正常滚动。
它几乎就像按钮,一个 HTML 的父元素 nav 元素,正在接收的触摸事件,但某种假想的墙保持儿童元素从被监听。任何指针将不胜感激。
编辑: 在 eclipse 中我注意到我得到一些我不能与 4.2.1 或 Android 4.2.2 的输出
WebViewInputDispatcher blockWebkitDraw
WebViewInputDispatcher blockWebkitDraw lockedfalse
blockWebkitViewMessage = false
编辑: 我注意到在我 navbar 上非常最上端的按钮是 tappable,但只有在其上部边缘/边境地区。
解决方法 1:
原来这是由老似乎治愈所有的机器人 web 视图弊病的 CSS 变换把戏很容易解决的。我只是向滚动导航栏上添加此 css 类:
.androidpaintfix {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0, 0, 0);WebKit2 - High Level Document
WebKit2 is a new API layer for WebKit designed from the ground up to support a split process model, where the web content (JavaScript, HTML, layout, etc) lives in a separate process from the application UI. This model is very similar to what Google Chrome offers, with the major difference being that we have built the process split model directly into the framework, allowing other clients of WebKit to use it.
Why is it named WebKit2?
The somewhat pedestrian reason is that it's an incompatible API change from the original WebKit, so it will probably be installed as something like /System/Library/WebKit2.framework on Mac.
WebKit2 provides a stable C-based non-blocking API that is mostly platform agnostic.
In order to achieve the goal of a non-blocking API, several techniques are used to make the API usable while still providing a comprehensive set of features to the embedder. These techniques include:
Notification style client callbacks (e.g. didFinishLoadForFrame)
These inform the embedder that something has happened, but do not give
them the chance to do anything about it.
Policy style clients callbacks (e.g. decidePolicyForNavigationAction)
These allow the embedder to decide on an action at their leisure,
notifying the page through a listener object.
Policy settings (e.g. WKContextSetCacheModel, WKContextSetPopupPolicy)
These allow the embedder to opt into a predefined policy without any
callbacks into the UIProcess. These can either be an enumerated set of
specific policies, or something more fine-grained, such as a list of
strings with wildcards.
Injected code (e.g. WebBundle)
Code can be loaded into the WebProcess for cases where all the other
options fail. This can useful when access to the DOM is required.
[Planned, but not currently implemented]
The major API classes are:
WKContextRef
Encapsulates all pages related to specific use of WebKit. All pages in
this context share the same visited link set, local storage set, and
preferences.
WKPageNamespaceRef
Encapsulates all pages that can script each other.
Basic unit of browsing. Stays the same as the main frame changes.
WKView[Ref]
Native view that hooks into the platform's toolkit. On Windows, this wraps
a HWND. On the Mac, it inherits from NSView.
Note that the requirement to be fully non-blocking requires an incompatible API break - many features of most existing WebKit APIs cannot be fulfilled in a non-blocking manner. Since we needed the API break anyway, we also took advantage of the opportunity to clean up and simplify the API.
Port-Specific APIs
The Mac port provides a fully non-blocking Objective-C API as a wrapper on top of the C API.
The GTK+ port provides also a stable and non-blocking API:
We believe a similar approach may be viable for other ports. We are also not removing or obsoleting any of the existing port-specific APIs. WebCore will remain as-is, and all current APIs will continue to work and be fully supported. Thus, WebKit development and existing ports of WebKit will not be disrupted.
Process Architecture
WebKit2 changes the WebKit stack to build a process management mechanism inside the WebKit API layer.
Here is what the architecture of a traditional WebKit port looks like:
Everything is in one process, and there is an API boundary between the application and the WebKit API. This is a simple model, and typically it's pretty easy for applications to reuse the WebKit API.
Here is what we are going for with WebKit2:
Notice that there is now a process boundary, and it sits *below* the API boundary. Part of WebKit operates in the UI process, where the application logic also lives. The rest of WebKit, along with WebCore and the JS engine, lives in the web process. The web process is isolated from the UI process. This can deliver benefits in responsiveness, robustness, security (through the potential to sandbox the web process) and better use of multicore CPUs. There is a straightforward API that takes care of all the process management details for you.
How is This Different from Chromium WebKit?
Chromium takes a different approach to multiprocess:
Notice that in this case, the the process boundary is *above* the API boundary. Chromium WebKit does not directly provide a multiprocess framework, rather, it is optimized for use as a component of a multiprocess application, which does all the proxying and process management itself. The Chrome team at Google did a great job at trailblazing multiprocess browsing with Chrome. But it's difficult to reuse their work, because the critical logic for process management, proxying between processes and sandboxing is all part of the Chrome application, rather than part of the API layer. So if another WebKit-based application or another port wanted to do multiprocess based on Chromium WebKit, it would be necessary to reinvent or cut & paste a great deal of code.
That was an understandable choice for Google - Chrome was developed as a secret project for many years, and is deeply invested in this approach. Also, there are not any other significant API clients. There is Google Chrome, and then there is the closely related Chrome Frame.
WebKit2 has a different goal - we want process management to be part of what is provided by WebKit itself, so that it is easy for any application to use. We would like chat clients, mail clients, twitter clients, and all the creative applications that people build with WebKit to be able to take advantage of this technology. We believe this is fundamentally part of what a web content engine should provide.
There are two key subsystems that support the process division :
CoreIPC - an abstraction for general message passing, including event handling. The current implementations use mach messages on Mac OS X, and named pipes on Windows.
DrawingArea - an abstraction for a cross-process drawing area. Multiple drawing strategies are possible, the simplest is just a shared memory bitmap.
There are two other important abstractions, which may be pushed down to WebCore or WTF over time:
Work Queues
Current Status
WebKit2 is production ready and stable. Different browsers are already using it like GNOME's Epiphany.
How to try it Out
build-webkit on Mac OS X or Windows now builds WebKit2 by default. WebKit2 will not work with the shipping version of Safari. Because WebKit2 is an incompatible API break, it requires a custom testbed to run it.
A basic web browser application suitable for testing WebKit2 is available in Tools/MiniBrowser.
How to run layout tests
You can run layout tests in WebKit2 by passing "-2" (or "--webkit-test-runner") to run-webkit-tests, like:
run-webkit-tests --debug -2
Many tests are skipped for WebKit2 (via the LayoutTests/platform/mac-wk2/Skipped file), but that number is decreasing as DumpRenderTree API is implemented for WebKitTestRunner.
Attachments
(38.5 KB) -
mac-webkit-stack
(61.8 KB) -
webkit2-stack
(62.0 KB) -
Download in other formats:Android(2)
平时没用到,今天突然说要做个用webview的js来调用Android里的方法,所以整理下大概的内容来共同学习,方法可以直接使用了,如果写的不好请指出
我这里调用的是本地的html所以用的加载地址是loadUrl(&file:///android_asset/test.html&);
打开本地sd卡内的test.html文件loadUrl(&content://com.android.htmlfileprovider/sdcard/test.html&)
指定的URLloadUrl(& &);
在我调试的时候一直在报错
11-05 14:30:09.375: V/WebViewInputDispatcher(21783): blockWebkitDraw lockedfalse
11-05 14:35:32.935: D/webview(23148): blockWebkitViewMessage= false
找了下资料说是API17以上需要添加注释
webView调用JS需要引用&@JavascriptInterface
&所以我在showResult()的方法前引用了一下问题解决
代码中的webView.addJavascriptInterface(new test(getApplicationContext()), &android&);这句话中的Android相当于test()方法的对象,js通过他来找到对应的方法如下:
javascript:android.showResult(str)
首先在assets下创建一个html文件内容如下
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:30562次
排名:千里之外
原创:25篇
转载:46篇
(1)(3)(9)(1)(2)(1)(2)(1)(7)(10)(2)(4)(2)(6)(7)(11)(2)

我要回帖

更多关于 block循环引用的解决 的文章

 

随机推荐