Community
Participate
Working Groups
As noted in Bug 430848, there is currently no way to refer to inner classes as part of a CSS selector. For example, if we have a class Outer which contains a widget class InnerComposite, the computed CSS local name would be Outer$InnerComposite. If we want to select this in a CSS stylesheet, we would need to write Outer$InnerComposite { color: red; } But the CSS specification does not allow $ as part of the selector. Therefore we currently cannot write this CSS rule.
My proposal: The CSS specification does, in fact, allow a hyphen/minus sign as part of a selector, and since this character cannot be part of a Java class name, we could translate Outer$InnerCanvas to Outer-InnerCanvas and hence, write the following rule: Outer-InnerComposite { color: red; } I will upload a patch and test case demonstrating this to gerrit.
here it is: https://git.eclipse.org/r/24281
We also use that pattern to translate '.' in IDs. Will this interfere with that? PW
(In reply to Paul Webster from comment #3) > We also use that pattern to translate '.' in IDs. Will this interfere with > that? Not that I am aware of. The translation is applied when computing the local name of the element for the DOM. So only element names should be affected here.
Looks good to me. Thanks Stefan. Committed to master: https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=9564a09045e4238087997be55f9e6603f8e47806
Verified can access LayoutModifierToolControl-1 using the CSS Spy in I20140428-2000.