Orion upstream update (with debugger ruler support code)

RESOLVED FIXED in Firefox 13

Status

()

Firefox
Developer Tools
P1
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: msucan, Assigned: msucan)

Tracking

Trunk
Firefox 13
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sourceeditor][orion][fixed-in-fx-team])

Attachments

(1 attachment, 4 obsolete attachments)

(Assignee)

Description

5 years ago
We need to update Orion from upstream. This time we will include the upsream debugger ruler support code needed to fix bug 707987.

Please note that this patch will include only the orion.js file changes and minimal (or no) changes for the Source Editor's usage of Orion. The actual Source Editor changes to add the debugger ruler API will happen in bug 707987.
(Assignee)

Comment 1

5 years ago
Created attachment 591753 [details] [diff] [review]
proposed patch

Proposed patch. Please note that the diff churn is quite greater than the *actual* number of changes. If you check with a visual diff tool you'll see there have been only minor changes. I had to reorder the orion.js code (see the change in Makefile.dryice.js), plus there was a change in upstream newlines for global.js. There's also a change in the Orion async init code, but I haven't noticed any breakage, so hopefully it's fine.

The code reorder is the only required change for bug 707987.
Attachment #591753 - Flags: review?(rcampbell)
(Assignee)

Comment 2

5 years ago
Created attachment 592225 [details] [diff] [review]
updated patch

Updated patch with more fixes from upstream. This also includes the fix from Alex.
Attachment #591753 - Attachment is obsolete: true
Attachment #591753 - Flags: review?(rcampbell)
Attachment #592225 - Flags: review?(rcampbell)
(Assignee)

Comment 3

5 years ago
Created attachment 595743 [details] [diff] [review]
more fixes

Rebased patch and included more fixes:

- fix for bug 717631 - selection now behaves correctly, please test to confirm. Works fine on my system.

- context menu-related fix. When you select some text the cut/copy/paste/delete menu items will be updated correctly in the context menu.

- undo/redo bug fixes: deletions that start at offset 0 were broken. UndoStack had problems managing such kinds of actions. Also fixed a case where the TextModel incorrectly generated ModelChanged events for empty changes (no added/removed chars).

- fix for the Source Editor: the undo (ctrl-z) and redo (ctrl-shift-z) keyboard shortcuts incorrectly generated two calls to the same function (ouch).

Please note that the fix for bug 717631 caused a minor visual change: padding is no longer applied within the line div, it is applied to the whole view, which means the selection is also moved 4px to the right. This is a minor inconvenience compared to the bug we are fixing.

The Orion team has submitted a fix to allow paddings on line divs, but that code change might cause regressions, so I'm postponing that change for a future Orion update.

Looking forward to your review. Thank you!
Attachment #592225 - Attachment is obsolete: true
Attachment #592225 - Flags: review?(rcampbell)
Attachment #595743 - Flags: review?(rcampbell)
(Assignee)

Updated

5 years ago
Blocks: 717631
(Assignee)

Updated

5 years ago
Blocks: 701347
Comment on attachment 595743 [details] [diff] [review]
more fixes

rejiggered define().

in orion.js

+		/** @ignore */
+		_binarySearch: function (array, offset) {

I can't @ignore! :)

Annotation bits moved around.

 		_handleBlur: function (e) {
 			if (!e) { e = window.event; }
 			if (this._ignoreBlur) { return; }
@@ -4515,16 +4555,24 @@ define(['orion/textview/textModel', 'ori
 			if (!e) { e = window.event; }
 			this._dropTarget = false;
 			this._dragOffset = -1;
 			if (this.isListening("DragEnd")) {

...
+				if (e.dataTransfer.dropEffect === "none" && !e.dataTransfer.mozUserCancelled) {
+					this._fixCaret();
+				}

wonder if we should file a bug to investigate this further? Could be an editor bug. Have you tried reproducing this?

...

* Feature in Firefox. When a key is held down the browser sends 

I like that these are features.

+		_isDocumentReady: function() {
+			var frameDocument = this._frameDocument;
+			if (!frameDocument) { return false; }
+			if (frameDocument.readyState === "complete") {
+				return true;
+			} else if (frameDocument.readyState === "interactive" && isFirefox) {
+				/*
+				* Bug in Firefox. Firefox does not change the document ready state to complete 
+				* all the time. The fix is to wait for the ready state to be "interactive" and check that 
+				* all css rules are initialized.
+				*/

wonder if that's something that we should investigate deeper as well? Do you know if there's a bug on file for this and is it reproducible?

+		_isLinkURL: function(string) {
+			return string.toLowerCase().lastIndexOf(".css") === string.length - 4;
+		},

I am not sure what the purpose of this is, but it doesn't look like it's testing if that's actually a "Link URL". Stylesheet? I guess this is just to exclude certain stylesheets from being processed, but it doesn't really seem to be validating it other than checking the file suffix.

Nothing jumps out at me as unreasonable here.

How's our testsuite coming along?
Attachment #595743 - Flags: review?(rcampbell) → review+
(Assignee)

Comment 5

5 years ago
(In reply to Rob Campbell [:rc] (robcee) from comment #4)
> @@ -4515,16 +4555,24 @@ define(['orion/textview/textModel', 'ori
>  			if (!e) { e = window.event; }
>  			this._dropTarget = false;
>  			this._dragOffset = -1;
>  			if (this.isListening("DragEnd")) {
> 
> ...
> +				if (e.dataTransfer.dropEffect === "none" &&
> !e.dataTransfer.mozUserCancelled) {
> +					this._fixCaret();
> +				}
> 
> wonder if we should file a bug to investigate this further? Could be an
> editor bug. Have you tried reproducing this?

We play a lot with the draggable and contenteditable booleans of the elements inside Orion, to work around worse bugs in Firefox, hence we have these problems. We need the fix for bug 614974 then we can remove the major workaround we have for it. I expect caret will render properly after that.

I didn't see any bug filed for this. Plus, this is something on the fringe of "don't do this at all! it's obvious you get unexpected/broken/weird behavior!" (this = the workaround for bug 614974). Do you think we should file the bug about such breakage after a workaround, nonetheless?


> * Feature in Firefox. When a key is held down the browser sends 
> 
> I like that these are features.
> 
> +		_isDocumentReady: function() {
> +			var frameDocument = this._frameDocument;
> +			if (!frameDocument) { return false; }
> +			if (frameDocument.readyState === "complete") {
> +				return true;
> +			} else if (frameDocument.readyState === "interactive" && isFirefox) {
> +				/*
> +				* Bug in Firefox. Firefox does not change the document ready state to
> complete 
> +				* all the time. The fix is to wait for the ready state to be
> "interactive" and check that 
> +				* all css rules are initialized.
> +				*/
> 
> wonder if that's something that we should investigate deeper as well? Do you
> know if there's a bug on file for this and is it reproducible?

I didn't see if they filed any bug report about this specific issue. Shall I email them to ask nicely for that?


> How's our testsuite coming along?

As you have noticed, I didn't take the bug, yet. Shall I do that?


Thanks for your review+!
(Assignee)

Comment 6

5 years ago
Created attachment 598360 [details] [diff] [review]
rebase
Attachment #595743 - Attachment is obsolete: true
(In reply to Mihai Sucan [:msucan] from comment #5)
> (In reply to Rob Campbell [:rc] (robcee) from comment #4)
[...]
> > How's our testsuite coming along?
> 
> As you have noticed, I didn't take the bug, yet. Shall I do that?

Yes please!

> Thanks for your review+!

thank you. This is landable?
(Assignee)

Comment 8

5 years ago
This is landable, but I prefer to land it together with the entire patch queue. I keep the patch in my queue to notice any potential breakage or regressions.
(Assignee)

Comment 9

5 years ago
Comment on attachment 598360 [details] [diff] [review]
rebase

Landed:
https://hg.mozilla.org/integration/fx-team/rev/a9d68fc52703
Attachment #598360 - Attachment description: rebase → [in-fx-team] rebase
(Assignee)

Updated

5 years ago
Whiteboard: [sourceeditor][orion] → [sourceeditor][orion][fixed-in-fx-team]
(Assignee)

Comment 10

5 years ago
Comment on attachment 598360 [details] [diff] [review]
rebase

backedout due to test failure:
https://hg.mozilla.org/integration/fx-team/rev/9bbb35269c58

WinXP machines have:

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/sourceeditor/test/browser_bug725388_mouse_events.js | Test timed out
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/sourceeditor/test/browser_bug725388_mouse_events.js | Found a after previous test timed out

See: https://tbpl.mozilla.org/?tree=Fx-Team&rev=00bce5149395
Attachment #598360 - Attachment description: [in-fx-team] rebase → rebase
(Assignee)

Updated

5 years ago
Whiteboard: [sourceeditor][orion][fixed-in-fx-team] → [sourceeditor][orion][backedout]
(Assignee)

Comment 11

5 years ago
Created attachment 599238 [details] [diff] [review]
[in-fx-team] improved test fix

Improved the test fix.

Try server shows no failures after a good number of runs:

https://tbpl.mozilla.org/?tree=Try&rev=ba187e35fd4a

Going to land the patch queue.
Attachment #598360 - Attachment is obsolete: true
(Assignee)

Comment 12

5 years ago
Comment on attachment 599238 [details] [diff] [review]
[in-fx-team] improved test fix

Landed:
https://hg.mozilla.org/integration/fx-team/rev/f6a20bf85118
Attachment #599238 - Attachment description: improved test fix → [in-fx-team] improved test fix
(Assignee)

Updated

5 years ago
Whiteboard: [sourceeditor][orion][backedout] → [sourceeditor][orion][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/f6a20bf85118
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
You need to log in before you can comment on or make changes to this bug.