[jbosstools-issues] [JBoss JIRA] (JBIDE-10127) Resolve selector in open-on of style class in VPE

Viacheslav Kabanovich (JIRA) jira-events at lists.jboss.org
Thu Feb 16 14:51:36 EST 2012


    [ https://issues.jboss.org/browse/JBIDE-10127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667224#comment-12667224 ] 

Viacheslav Kabanovich commented on JBIDE-10127:
-----------------------------------------------

I have attached css specification. It contains a lot of features unknown to us yet. 
For example, compare:
{code}
div p
{code}
- <p> is some descendant of <div>

{code}
div * p
{code}
- <p> is a grandchild or later descendant of <div>

{code}
div > p
{code}
- <p> is a child of <div>

I could not find an exact algorithm of resolution at a first glance, only principle 'browser will always let the most specific style rule win'; but most important is that the 'fight' between rules goes for each style attribute. Let's modify our example:
{code}
div p input.styleA {color: #CC00FF; background: #0000FF}
[title="y"] p input.styleA {color: #00CCFF}
{code}

{code}
<div title="y">
  <div>
	<p>
		<input type="button" class="styleA" value="[title='y'] div p input.styleA {color: #00CCFF}"/>
	</p>
  </div>
</div>	
{code}
The second rule wins the battle for 'color' attribute, but it does not define 'background' attribute, and cannot fight for it, so that background will be taken from the first rule. That means, that open-on for style class may need to show more than one option.
                
> Resolve selector in open-on of style class in VPE
> -------------------------------------------------
>
>                 Key: JBIDE-10127
>                 URL: https://issues.jboss.org/browse/JBIDE-10127
>             Project: Tools (JBoss Tools)
>          Issue Type: Feature Request
>          Components: jsp/jsf/xml source editing
>    Affects Versions: 3.3.0.M3
>            Reporter: Viacheslav Kabanovich
>            Assignee: Victor Rubezhny
>             Fix For: 3.3.0.Beta1
>
>         Attachments: css2.pdf
>
>
> EXECUTE: Create style sheet:
> {code}
>     .styleA {color: #FF0000}
>     .styleA .styleB {color: #FF8000}
>     div.styleA {color: #FF0080}
>     div[title="x"].styleA {color: #0000FF}
>     p input.styleA {color: #CCAA00}
>     div p input.styleA {color: #CC00FF}
>     [title="y"] p input.styleA {color: #00CCFF}
> {code}
> EXECUTE: Create html:
> {code}
> <html>
> <head>
> 	<title>Hello!</title> 
> 	<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
> </head>
> <body>	
> 	<p class="styleA">
> 		.styleA {color: #FF0000}
> 	</p>	
> 	<p class="styleA">
> 		.styleA {color: #FF0000}
> 		<br/>
> 		<b class="styleB">.styleA .styleB {color: #FF8000}</b>
> 	</p>
> 	<div class="styleA">
> 		div.styleA {color: #FF0080}
> 	</div>	
> 	<div title="x" class="styleA">
> 		div[title="x"].styleA {color: #0000FF}
> 	</div>	
> 	<p>
> 		<input type="button" class="styleA" value="p input.styleA {color: #CCAA00}"/>
> 	</p>
> 	<div>
> 		<p>
> 			<input type="button" class="styleA" value="div p input.styleA {color: #CC00FF}"/>
> 		</p>
> 	</div>	
> 	<div title="y">
> 	  <div>
> 		<p>
> 			<input type="button" class="styleA" value="[title='y'] div p input.styleA {color: #00CCFF}"/>
> 		</p>
> 	  </div>
> 	</div>	
> </body>
> </html>
> {code}
> ASSERT: Style opened at each class="styleA" should be the same as text value in element.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list