littlestarry
火狐狸
火狐狸
  • UID35906
  • 注册日期2011-04-07
  • 最后登录2012-03-09
  • 发帖数117
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
120楼#
发布于:2011-12-27 13:45
minghegy:哦,我把中键做成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;
回到原帖


你的编译版能发我一份么  <!-- e --><a href="mailto:littlestarry@qq.com">littlestarry@qq.com</a><!-- e --> thx
minghegy
火狐狸
火狐狸
  • UID37982
  • 注册日期2011-12-17
  • 最后登录2014-02-24
  • 发帖数132
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
121楼#
发布于:2011-12-27 13:45
dongyuanxun:对了,Mozilla代码里对三角函数用的多么
如果很多的话,我看看能否直接SSE2化

这个只有频繁调用才有优势
回到原帖

这我就不清楚了
minghegy
火狐狸
火狐狸
  • UID37982
  • 注册日期2011-12-17
  • 最后登录2014-02-24
  • 发帖数132
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
122楼#
发布于:2011-12-27 13:45

你的编译版能发我一份么  <!-- e --><a href="mailto:littlestarry@qq.com">littlestarry@qq.com</a><!-- e --> thx

我的没跑pgo,也没打任何优化补丁
你用我的可能比官方的还慢,官方版好歹还跑了个pgo
我没有编译优化版的打算,如果dongyuanxun和Lawliet不做了,我就用tete009的去
dongyuanxun
非常火狐
非常火狐
  • UID28632
  • 注册日期2009-04-19
  • 最后登录2013-02-14
  • 发帖数898
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
123楼#
发布于:2011-12-27 13:45
minghegy
这我就不清楚了
回到原帖

我直接在他链接CRT之前链接了我自己的math优化库,貌似没有起到应用的效果,他在链接时还是绕过了我的库

抽空再研究一下
minghegy
火狐狸
火狐狸
  • UID37982
  • 注册日期2011-12-17
  • 最后登录2014-02-24
  • 发帖数132
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
124楼#
发布于:2011-12-27 13:45
估计用三角函数的地方很少吧,就画非方形图形的时候用得上?

能否把plugin-container.exe编译成64位的,让它调用64位插件?
因为大多数人只用flash player这一个插件,64位的理论上解码效率更高,看视频时CPU占用会更小
dongyuanxun
非常火狐
非常火狐
  • UID28632
  • 注册日期2009-04-19
  • 最后登录2013-02-14
  • 发帖数898
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
125楼#
发布于:2011-12-27 13:45
你可以把我64位版本里的plugin-container.exe复制到32位里覆盖即可,不过也只能用64位插件了

如果要通用的话,首先要在代码中加入检测本机系统的部分,这一块儿不难,难点在于怎么判定本机存在32位插件还是64位插件,然后调用哪个plugin-container.exe,所以我暂时不想做这件事,意义也不太大。
Lawliet
火狐狸
火狐狸
  • UID34414
  • 注册日期2010-11-03
  • 最后登录2017-04-02
  • 发帖数201
  • 经验13枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 社区居民
  • 忠实会员
126楼#
发布于:2011-12-27 13:45
minghegy:新年好!

似乎还有一个鼠标中键的问题,也是contenteditable引起的
https://bugzilla.mozilla.org/show_bug.cgi?id=674770
这个很好改,改三个文件就可以了(不算test文件的话)
在bugzilla上搜了,contenteditable应该就这三个bug,不会再有了
谁有三键鼠标?最好亲自试一下
回到原帖

這個中鍵問題是否就是那個在貼吧無法中鍵開新tab的問題?
如果是我就也打上再編譯一遍
dongyuanxun
非常火狐
非常火狐
  • UID28632
  • 注册日期2009-04-19
  • 最后登录2013-02-14
  • 发帖数898
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
127楼#
发布于:2011-12-27 13:45
dongyuanxun:你可以把我64位版本里的plugin-container.exe复制到32位里覆盖即可,不过也只能用64位插件了

如果要通用的话,首先要在代码中加入检测本机系统的部分,这一块儿不难,难点在于怎么判定本机存在32位插件还是64位插件,然后调用哪个plugin-container.exe,所以我暂时不想做这件事,意义也不太大。
回到原帖

修正一下,这个无法替换
因为要依赖其他组件

这个要改插件体系了,必须在可取的范围内编译2遍,时间太长,还是算了吧
littlestarry
火狐狸
火狐狸
  • UID35906
  • 注册日期2011-04-07
  • 最后登录2012-03-09
  • 发帖数117
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
128楼#
发布于:2011-12-27 13:45
Lawliet
這個中鍵問題是否就是那個在貼吧無法中鍵開新tab的問題?
如果是我就也打上再編譯一遍
回到原帖

貼吧無法中鍵開啟新分頁?我試過,可以的。

您要再編譯的話把minghegy兄 说的tete009补丁(\nsprpub\pr\src\io\prsocket.c)也打上吧
minghegy
火狐狸
火狐狸
  • UID37982
  • 注册日期2011-12-17
  • 最后登录2014-02-24
  • 发帖数132
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
129楼#
发布于:2011-12-27 13:45

修正一下,这个无法替换
因为要依赖其他组件

这个要改插件体系了,必须在可取的范围内编译2遍,时间太长,还是算了吧

我也试了,似乎这个要大改,不是几行能解决的
minghegy
火狐狸
火狐狸
  • UID37982
  • 注册日期2011-12-17
  • 最后登录2014-02-24
  • 发帖数132
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
130楼#
发布于:2011-12-27 13:45

貼吧無法中鍵開啟新分頁?我試過,可以的。

您要再編譯的話把minghegy兄 说的tete009补丁(\nsprpub\pr\src\io\prsocket.c)也打上吧

你用的是不是滚轮?我这里用滚轮也能正常打开
littlestarry
火狐狸
火狐狸
  • UID35906
  • 注册日期2011-04-07
  • 最后登录2012-03-09
  • 发帖数117
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
131楼#
发布于:2011-12-27 13:45

你用的是不是滚轮?我这里用滚轮也能正常打开

是的。是不是滚轮的那个键跟真正的中键不一样?
dongyuanxun
非常火狐
非常火狐
  • UID28632
  • 注册日期2009-04-19
  • 最后登录2013-02-14
  • 发帖数898
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
132楼#
发布于:2011-12-27 13:45
当时没有Flash 64位正式版时
fbuild就是用的类似的做法,直接使用了32位/64位混合的插件体系,基本上就是通过编译两遍得到的(因为首先需要编译plugin-container需要的其他组件……),后来fbuild作者也放弃了该做法,首要原因是64位Flash正式推出,第二个原因是编译时间太长了
minghegy
火狐狸
火狐狸
  • UID37982
  • 注册日期2011-12-17
  • 最后登录2014-02-24
  • 发帖数132
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
133楼#
发布于:2011-12-27 13:45
是的。是不是滚轮的那个键跟真正的中键不一样?
---------------------------
是的,只是定义的行为一样,本质上是不一样的

dongyuanxun:当时没有Flash 64位正式版时
fbuild就是用的类似的做法,直接使用了32位/64位混合的插件体系,基本上就是通过编译两遍得到的(因为首先需要编译plugin-container需要的其他组件……),后来fbuild作者也放弃了该做法,首要原因是64位Flash正式推出,第二个原因是编译时间太长了
回到原帖

太麻烦,算了
a6900507
小狐狸
小狐狸
  • UID38006
  • 注册日期2011-12-22
  • 最后登录2015-12-22
  • 发帖数5
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
134楼#
发布于:2011-12-27 13:45
Lawliet
這個中鍵問題是否就是那個在貼吧無法中鍵開新tab的問題?
如果是我就也打上再編譯一遍
回到原帖


10b2什么时候更新呀?
游客

返回顶部