|
105楼#
发布于:2011-12-27 13:45
|
|
|
106楼#
发布于:2011-12-27 13:45
我下了,二位晚安
|
|
|
107楼#
发布于:2011-12-27 13:45
編譯成功了,改好的patch放在我的項目主頁上
|
|
|
108楼#
发布于:2011-12-27 13:45
用上了,谢谢
如果官方在12里修复这两个bug,那个补丁还能用四个月左右 tete009有个补丁(\nsprpub\pr\src\io\prsocket.c)以后也可以打上,您看一下 如果打上了会影响windows nt 4.0(1996年的系统,估计没人用了),但在其它win32系统上会更好一点点 |
|
|
109楼#
发布于:2011-12-27 13:45
剛看了一下,那兩個補丁稍微作些修改
就可以在10上用了 tete009的那個補丁具體是什麼作用? 在其它win32系統會好一點點是好在哪方面的體驗? |
|
|
110楼#
发布于:2011-12-27 13:45
就是省一句代码
这个用在套接字编程上,NT中Select后无法及时返回相应的名称,就来这个变通了 不过sleep(0)有的编译器会忽略的说…… |
|
|
111楼#
发布于:2011-12-27 13:45
这个写法最早追溯到Netscape的代码
|
|
|
112楼#
发布于:2011-12-27 13:45
可以参见此文,http://support.microsoft.com/kb/165989
windows nt 4.0有一个bug,firefox为了迁就这个bug,在所有win32系统上都要sleep(0)一下 那个系统太老了,还在运行它的电脑肯定没有sse2,所以不用再考虑它 |
|
|
113楼#
发布于:2011-12-27 13:45
謝謝,我懂了
我明天編譯10b2就這麼做 我先出門去台北101看煙火了 祝大家2012年新年快樂!! |
|
|
114楼#
发布于:2011-12-27 13:45
Mozilla方面估计会在未来的版本对内部第三方组件进行升级
我就懒的做这件事了,下个版本不会再费心去升级相关组件,否则还得先测试是否安全 BetterPGO在我最近的升级后已经较为稳定,目前只是缺少一个测试框架,我瞧瞧是否有成熟的代码借用 如果有测试框架后,我还想加入alexa top 100的网站…… 我想想是否还有其他方面的性能可以得到较大提升(在使用vc2010的情况下) |
|
|
115楼#
发布于:2011-12-27 13:45
新年好!
似乎还有一个鼠标中键的问题,也是contenteditable引起的 https://bugzilla.mozilla.org/show_bug.cgi?id=674770 这个很好改,改三个文件就可以了(不算test文件的话) 在bugzilla上搜了,contenteditable应该就这三个bug,不会再有了 谁有三键鼠标?最好亲自试一下 |
|
|
116楼#
发布于:2011-12-27 13:45
dongyuanxun:Mozilla方面估计会在未来的版本对内部第三方组件进行升级 新浪新闻中心有吗?那个有一定代表性 |
|
|
117楼#
发布于:2011-12-27 13:45
没有,不过我加入了msn,这个应该比sina还通用些
这俩应该都是alexa top 10的网站 |
|
|
118楼#
发布于:2011-12-27 13:45
哦,我把中键做成patch了(没包括那几个test文件)
如果自己打的话,别忘了把true、false改一下 文件名bug674770.patch diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp
--- a/editor/libeditor/base/nsEditor.cpp 2011-12-21 07:28:16 +0800
+++ b/editor/libeditor/base/nsEditor.cpp 2012-01-01 14:25:09 +0800
@@ -5392,12 +5392,29 @@
nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aEvent);
NS_ENSURE_TRUE(NSEvent, PR_FALSE);
+ // If this is mouse event but this editor doesn't have focus, we shouldn't
+ // handle it.
+ nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
+ if (mouseEvent) {
+ nsCOMPtr<nsIContent> focusedContent = GetFocusedContent();
+ if (!focusedContent) {
+ return PR_FALSE;
+ }
+ }
+
+
PRBool isTrusted;
nsresult rv = NSEvent->GetIsTrusted(&isTrusted);
NS_ENSURE_SUCCESS(rv, PR_FALSE);
if (isTrusted) {
return PR_TRUE;
}
+
+ // Ignore untrusted mouse event.
+ // XXX Why are we handling other untrusted input events?
+ if (mouseEvent) {
+ return PR_FALSE;
+ }
// Otherwise, we shouldn't handle any input events when we're not an active
// element of the DOM window.
return IsActiveInDOMWindow();
diff --git a/editor/libeditor/base/nsEditorEventListener.cpp b/editor/libeditor/base/nsEditorEventListener.cpp
--- a/editor/libeditor/base/nsEditorEventListener.cpp 2011-12-21 07:28:16 +0800
+++ b/editor/libeditor/base/nsEditorEventListener.cpp 2012-01-01 14:27:22 +0800
@@ -179,6 +179,7 @@
NS_LITERAL_STRING("drop"),
NS_EVENT_FLAG_BUBBLE |
NS_EVENT_FLAG_SYSTEM_EVENT);
+
elmP->AddEventListenerByType(this,
NS_LITERAL_STRING("mousedown"),
NS_EVENT_FLAG_CAPTURE);
@@ -514,14 +515,16 @@
NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
- nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aMouseEvent);
+ NS_ENSURE_TRUE(mouseEvent, NS_OK);
PRBool isTrusted = PR_FALSE;
- if (!mouseEvent || !nsevent ||
- NS_FAILED(nsevent->GetIsTrusted(&isTrusted)) || !isTrusted) {
- // Non-ui or non-trusted event passed in. Bad things.
- return NS_OK;
+if (mEditor->IsReadonly() || mEditor->IsDisabled() ||
+ !mEditor->IsAcceptableInputEvent(aMouseEvent)) {
+ return NS_OK;
}
+ nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aMouseEvent);
+ NS_ASSERTION(nsevent, "nsevent must not be NULL here");
+
PRBool preventDefault;
nsresult rv = nsevent->GetPreventDefault(&preventDefault);
if (NS_FAILED(rv) || preventDefault) {
diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp
--- a/editor/libeditor/html/nsHTMLEditor.cpp 2011-12-21 07:28:16 +0800
+++ b/editor/libeditor/html/nsHTMLEditor.cpp 2012-01-01 14:28:25 +0800
@@ -6004,6 +6004,40 @@
// editable or not.
nsCOMPtr<nsIContent> targetContent = do_QueryInterface(target);
NS_ENSURE_TRUE(targetContent, PR_FALSE);
+ // If the event is a mouse event, we need to check if the target content is
+ // the focused editing host or its descendant.
+ nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
+ if (mouseEvent) {
+ nsIContent* editingHost = GetActiveEditingHost();
+ // If there is no active editing host, we cannot handle the mouse event
+ // correctly.
+ if (!editingHost) {
+ return PR_FALSE;
+ }
+ // If clicked on non-editable root element but the body element is the
+ // active editing host, we should assume that the click event is targetted.
+ if (targetContent == document->GetRootElement() &&
+ !targetContent->HasFlag(NODE_IS_EDITABLE) &&
+ editingHost == document->GetBodyElement()) {
+ targetContent = editingHost;
+ }
+ // If the target element is neither the active editing host nor a descendant
+ // of it, we may not be able to handle the event.
+ if (!nsContentUtils::ContentIsDescendantOf(targetContent, editingHost)) {
+ return PR_FALSE;
+ }
+ // If the clicked element has an independent selection, we shouldn't
+ // handle this click event.
+ if (targetContent->HasIndependentSelection()) {
+ return PR_FALSE;
+ }
+ // If the target content is editable, we should handle this event.
+ return targetContent->HasFlag(NODE_IS_EDITABLE);
+ }
+
+ // If the target of the other events which target focused element isn't
+ // editable or has an independent selection, this editor shouldn't handle the
+ // event.
if (!targetContent->HasFlag(NODE_IS_EDITABLE) ||
targetContent->HasIndependentSelection()) {
return PR_FALSE; |
|
|
119楼#
发布于:2011-12-27 13:45
对了,Mozilla代码里对三角函数用的多么
如果很多的话,我看看能否直接SSE2化 这个只有频繁调用才有优势 |
|