Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 263184 - [CSS] Need Shell:active pseudo class
Summary: [CSS] Need Shell:active pseudo class
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 4.1   Edit
Assignee: Kevin McGuire CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-01 18:44 EST by Kevin McGuire CLA
Modified: 2011-05-17 16:23 EDT (History)
1 user (show)

See Also:


Attachments
shell: active now works (6.82 KB, patch)
2009-02-20 10:25 EST, Aghiles Abdesselam CLA
no flags Details | Diff
junit for shell:active (1.60 KB, patch)
2009-02-25 10:51 EST, Aghiles Abdesselam CLA
no flags Details | Diff
shell: active & junits (9.69 KB, patch)
2009-03-06 09:36 EST, Aghiles Abdesselam CLA
no flags Details | Diff
shell: active & junits (9.07 KB, patch)
2009-03-06 12:28 EST, Aghiles Abdesselam CLA
no flags Details | Diff
shell: active & junits (9.02 KB, patch)
2009-03-09 11:47 EDT, Aghiles Abdesselam CLA
no flags Details | Diff
fix in the junit test (1.01 KB, patch)
2009-03-10 16:26 EDT, Aghiles Abdesselam CLA
john.arthorne: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin McGuire CLA 2009-02-01 18:44:32 EST
We need a Shell:active pseudo class so that we can properly describe the CTabFolder styling behaviour you see in Eclipse 3.x, ie:

Shell:active CTabFolder:focus CTabItem:selected {
 ...
}
Comment 1 Aghiles Abdesselam CLA 2009-02-20 10:25:30 EST
Created attachment 126305 [details]
shell: active now works

styles such as the following won't work:

Shell:active CTabFolder{
(whatever styling)
}
Comment 2 Kevin McGuire CLA 2009-02-20 10:34:51 EST
(In reply to comment #1)
> Created an attachment (id=126305) [details]
> shell: active now works

Great!

> styles such as the following won't work:
> 
> Shell:active CTabFolder{
> (whatever styling)
> }

Do we understand why not?  ie. is this just an incorrect expectation of what we can do in CSS, or something missing or bug in our support? 

Comment 3 Aghiles Abdesselam CLA 2009-02-20 11:04:14 EST
(In reply to comment #2)

> Do we understand why not?  ie. is this just an incorrect expectation of what we
> can do in CSS, or something missing or bug in our support? 

Like you said, I think it may be an incorrect expectation of our CSS Engine. 

Comment 4 Kevin McGuire CLA 2009-02-20 11:42:24 EST
(In reply to comment #3)
> (In reply to comment #2)
> 
> > Do we understand why not?  ie. is this just an incorrect expectation of what we
> > can do in CSS, or something missing or bug in our support? 
> 
> Like you said, I think it may be an incorrect expectation of our CSS Engine. 

Sorry, I'm asking if:

A) You could never write something like this in CSS for a web browser, it's the wrong format in CSS.

B) Our engine isn't handling it correctly.

Comment 5 Kevin McGuire CLA 2009-02-23 23:18:15 EST
Please add junit test to patch (or separate patch).

Note that you will likely need to open() the shell for this test to work.  Therefore, it should be a new test.  Try using forceActive() to get it in the active state.

To test the non-active state will require more cleverness.  Perhaps make/open a second shell and make *it* active, thus ensuring the test shell isn't.
Comment 6 Aghiles Abdesselam CLA 2009-02-25 10:51:34 EST
Created attachment 126735 [details]
junit for shell:active
Comment 7 Kevin McGuire CLA 2009-03-03 23:24:11 EST
Test doesn't seem to work.  Note that the patch didn't included adding the test to the test suite so maybe you thought it ran successfully when in fact it was never run?  I'm on Vista so maybe that also makes a difference? 

I tried adding
  shell.forceActive() 
but that didn't help.

It may not be possible to automate the testing for all platforms.

Can you confirm that by adding this test to the suite that it in fact passes?
Comment 8 Aghiles Abdesselam CLA 2009-03-04 10:25:33 EST
(In reply to comment #)
> Can you confirm that by adding this test to the suite that it in fact passes?

Test runs and passes for me.

> It may not be possible to automate the testing for all platforms.

Perhaps that may be the issue since I am using XP.
Comment 9 Kevin McGuire CLA 2009-03-04 11:34:06 EST
(In reply to comment #8)
> (In reply to comment #)
> > Can you confirm that by adding this test to the suite that it in fact passes?
> 
> Test runs and passes for me.
> 
> > It may not be possible to automate the testing for all platforms.
> 
> Perhaps that may be the issue since I am using XP.

Thanks for verifying. 

I'm not sure what to do with these tests then.  It appears that you can't modify the Vista shell. Might be an SWT bug or a platform limitation.
Comment 10 Kevin McGuire CLA 2009-03-05 23:01:26 EST
I tried this test on XP and it doesn't work, even with the addition of shell.forceActive().  I don't understand how it could work for you and not for me.
Comment 11 Aghiles Abdesselam CLA 2009-03-06 09:36:24 EST
Created attachment 127816 [details]
shell: active &  junits

I created a new patch, perhaps I made a mistake in my previous one. I tested this one in a new workspace, and the tests passed. Please let me know if there are still issues. Thanks!
Comment 12 Kevin McGuire CLA 2009-03-06 12:15:18 EST
Thanks. 

1) The patch contains changes for CTabFolder-CTabItem. I believe this is a separate bug.  Did you mean to include it? (I assume no)

2) When adding new classes the copyright should say IBM. DynamicPseudoClassesSWTActiveHandler has a copy of the copyright showing Angelo as the contributor.  Please correct to specify IBM.

After removing the change in (1) I reran the tests and you're right it now passes on XP.  I will try later on Vista. Please resubmit patch with (1) and (2) addressed.
Comment 13 Aghiles Abdesselam CLA 2009-03-06 12:28:32 EST
(In reply to comment #12)
> Thanks. 
> 
> 1) The patch contains changes for CTabFolder-CTabItem. I believe this is a
> separate bug.  Did you mean to include it? (I assume no)

Sorry, my mistake, I forgot I made changes for another bug. The new patch should be fine. Thanks.
Comment 14 Aghiles Abdesselam CLA 2009-03-06 12:28:56 EST
Created attachment 127839 [details]
shell: active &  junits
Comment 15 Kevin McGuire CLA 2009-03-06 12:47:21 EST
You still forgot to fix the copyrights :)

I fixed it (and added one for the test), released the patch to HEAD.

I'm going to test it on Vista before closing.
Comment 16 Aghiles Abdesselam CLA 2009-03-06 12:51:28 EST
(In reply to comment #15)
> You still forgot to fix the copyrights :)
> 

I wans't sure if I should change the contributors or not :S I only changed the top part beside "Copyright (c) 2008" . Well as long as the patch is working now :)

Comment 17 Kevin McGuire CLA 2009-03-06 12:56:09 EST
(In reply to comment #16)

> I wans't sure if I should change the contributors or not :S I only changed the
> top part beside "Copyright (c) 2008" . 

Why? (e.g. because you copied code which had Angelo in the copyright?)
Comment 18 Aghiles Abdesselam CLA 2009-03-06 13:06:14 EST
(In reply to comment #17)

> Why? (e.g. because you copied code which had Angelo in the copyright?)
> 

Because it says "inital API and implementation" and I figured if Angelo's name was there, and the new class uses the same API as the other ones, that it would make sense to include him. If not, I'll make sure to change it in the future.
Comment 19 Kevin McGuire CLA 2009-03-06 13:17:25 EST
(In reply to comment #18)

> Because it says "inital API and implementation" and I figured if Angelo's name
> was there, and the new class uses the same API as the other ones, that it would
> make sense to include him. If not, I'll make sure to change it in the future.

Ah I see. It was a good catch (good that you're thinking of such things). I think it's ok in this case - we're conforming to an API, not making a new one that's a copy of one.

Comment 20 Aghiles Abdesselam CLA 2009-03-09 11:47:07 EDT
Created attachment 128045 [details]
shell: active &  junits

I was going through some junits and noticed that I forgot to remove a "System.out" that I used in the code ... this patch no longer has it.
Comment 21 Kevin McGuire CLA 2009-03-10 16:10:34 EDT
This patch is all conflicts for me against latest source.  I assume it's because your workspace is out of date vs. HEAD.

Note that I *had* committed the previous work (comment #15).
Any new patches should be deltas from that, from what's in HEAD.
Comment 22 Kevin McGuire CLA 2009-03-10 16:11:16 EDT
(I can't make sense of it as is, you will need to get caught up and submit a new patch).
Comment 23 Aghiles Abdesselam CLA 2009-03-10 16:26:12 EDT
Created attachment 128268 [details]
fix in the junit test

Sorry, I forgot you committed it to HEAD. It was just a simple System.out I forgot to remove. This should fix it.
Comment 24 Kevin McGuire CLA 2009-03-10 16:30:55 EDT
Thanks.  I should've spotted it when I reviewed the patch.
Released this update to HEAD>
Comment 25 Kevin McGuire CLA 2009-03-12 00:07:04 EDT
Test passes on Vista, closing bug.