Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348471

Summary: [client] CSS syntax error caused by the use of XMLHttpRequest
Product: [ECD] Orion Reporter: Mihai Sucan <mihai.sucan>
Component: ClientAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, eclipse.felipe, mihai.sucan, Silenio_Quarti
Version: 0.2   
Target Milestone: 0.2   
Hardware: All   
OS: All   
URL: https://github.com/mihaisucan/orion.client/commit/093febb0fba58242a6c6e308469cf2dd620f9617
Whiteboard:

Description Mihai Sucan CLA 2011-06-06 16:20:21 EDT
Build Identifier: 

The Orion TextView script loads stylesheets with XMLHttpRequest. In the Mozilla codebase we provide the stylsheet URLs to these files from the chrome:// protocol - which means that they have no MIME type when they load. This makes our XHR code try to parse the CSS file (I presume as XML, or something). The parse error always shows up in the Error console.

We need to set overrideMimetype("text/css") on the XHR object in Orion, to avoid any errors from showing up.

Will provide a minimal patch.

Reproducible: Always
Comment 1 Mihai Sucan CLA 2011-06-06 16:32:42 EDT
Here's a pull request that fixes the syntax error in our integration of Orion:

https://github.com/eclipse/orion.client/pull/2

Please let me know if any further action is needed on my behalf before this change can land in the repo. Thank you!
Comment 2 Felipe Heidrich CLA 2011-06-06 17:03:30 EDT
Looks good to me, you could also update the license from
Mihai Sucan (Mozilla Foundation) - fix for Bug 334583
to
Mihai Sucan (Mozilla Foundation) - fix for Bugs 334583, 348471


What is the best way for me to apply your patch from github to my local repo (so I can commit and push to git.eclipse.org) ?

Notes:
-My origin is git.eclipse.org (not github.com)
-As far as I know, there is script that pushes the changes from git.eclipse.org to github.com, but not the othe way around. (Boris ?)
-Im afraid that will ask you to say "I confirm that I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use."
Comment 3 Boris Bokowski CLA 2011-06-06 20:02:24 EDT
git remote add mihai git://github.com/mihaisucan/orion.client.git
git fetch mihai
git cherry-pick 093febb0fba58242a6c6
git log --pretty=full

The commit id of "git cherry-pick" can be seen on the pull request page. The result of cherry-picking is a commit that has the author set to mihai but the committer set to the local user. You can confirm that everything looks correct using "git log --pretty=full".
Comment 4 Boris Bokowski CLA 2011-06-06 21:13:43 EDT
Obviously, my last comment was intended as an answer to:

> What is the best way for me to apply your patch from github to my local repo
> (so I can commit and push to git.eclipse.org) ?

Note that the "git remote add" command is only needed once, for subsequent pull requests you can just do "git fetch mihai" followed by git cherry-pick.
Comment 5 Boris Bokowski CLA 2011-06-06 21:31:23 EDT
One thing I noticed while trying out "git cherry-pick": We normally don't add directives for particular text editors to source files. Mihai, it would be good if you could remove the first line of the changed file:
+// vim:set noet:
Comment 6 Felipe Heidrich CLA 2011-06-07 10:43:34 EDT
Felipe@TP-FELIPEW7 ~/Desktop/Orion/repo/org.eclipse.orion.client (master)
$ git fetch mihai
github.com[0: 207.97.227.239]: errno=No error
fatal: unable to connect a socket (No error)

This what config shows:
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=ssh://fheidric@git.eclipse.org/gitroot/e4/org.eclipse.orion.client.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
remote.mihai.url=git://github.com/mihaisucan/orion.client.git
remote.mihai.fetch=+refs/heads/*:refs/remotes/mihai/*

I do have an account at github.com, it is fheidrich
Comment 7 Felipe Heidrich CLA 2011-06-07 10:56:18 EDT
very sorry, it was my firewall that stop git from connecting to github.com
I just noticed the little dialog behind several windows asking me if git.exe was allowed to connect to github...
Comment 8 Felipe Heidrich CLA 2011-06-07 11:14:18 EDT
Fixed
http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=f41d148a82b58f43e5256c10a6ac228716b8d041
http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=8d77f3e7a977cda7d4022d7b5012a9b457f3e327

Thank you Mihai for the patch.
Thank you Boris, cherry picking was more fun than copy'n'paste that I used last time ;-p
Comment 9 Mihai Sucan CLA 2011-06-08 08:47:18 EDT
(In reply to comment #2)
> -Im afraid that will ask you to say "I confirm that I wrote all this code and
> have the rights to contribute it to Eclipse under the eclipse.org web site
> terms of use."

No problem!

I confirm that I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use.


(In reply to comment #5)
> One thing I noticed while trying out "git cherry-pick": We normally don't add
> directives for particular text editors to source files. Mihai, it would be good
> if you could remove the first line of the changed file:
> +// vim:set noet:

Sure, I will no longer add that.

The reason I added it is because I work in different codebases with different coding styles. When I edit the Orion code I need to make sure tabs are not expanded, and there's legitimate use of having directives for particular text editors (vi/emacs) - it allows easier and quicker adjustments to different codebases with their different coding styles.


Felipe: thanks for your pull request merge! I apologize for the time it took me to get back to this patch.
Comment 10 Felipe Heidrich CLA 2011-06-08 12:16:22 EDT
(In reply to comment #9)
> Felipe: thanks for your pull request merge! 

Thank you, if you need any other changes just let me know.