You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Gary Frederick <ga...@jsoft.com> on 2003/12/27 15:57:20 UTC

CSS2's dynamic pseudo-class :hover

Howdy all,

Does Batik/Squiggle support hover?

Here are two simple tests that do not 'hover':

hoverCSS.svg

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" height="5cm" viewBox="0 0 1000 500"
      xmlns="http://www.w3.org/2000/svg" version="1.1">
   <defs>
     <style type="text/css"><![CDATA[
       rect {
         fill: red;
         stroke: blue;
         stroke-width: 6
       }
       rect:hover {
         stroke:green; stroke-width:10; fill-opacity:0.2;
       }
     ]]></style>
   </defs>
   <rect x="200" y="100" width="600" height="300"/>
</svg>


and
externalCSS.svg

<?xml version="1.0" standalone="no"?>
<?xml-stylesheet href="mystyle.css" type="text/css"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" height="5cm" viewBox="0 0 1000 500"
      xmlns="http://www.w3.org/2000/svg" version="1.1">
   <rect x="200" y="100" width="600" height="300"/>
</svg>


mystyle.css for externalCSS.svg

rect {
   fill: red;
   stroke: blue;
   stroke-width: 6
}

rect:hover {
   stroke:green; stroke-width:10; fill-opacity:0.2;
}


I was looking here
   http://www.w3.org/TR/SVG11/styling.html#StyleElementExample
and started playing. The other CSS stuff works.

I'll file a bug if it's a bug :-)

Thanks,

Gary


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: CSS2's dynamic pseudo-class :hover

Posted by Gary Frederick <ga...@jsoft.com>.
Thomas DeWeese wrote:

> Gary Frederick wrote:
> 
>> Howdy all,
>>
>> Does Batik/Squiggle support hover?
> 
> 
>    No, as far as I know Batik does not support any of the
> CSS pseudo classes.
> 

Thanks.

FWIW

I looked a bit more and as I understand it, there is nothing in the SVG 
standard that requires Batik to support CSS. A Conforming SVG Viewer 
should support hover and all sorts of stuff. I briefly tested 
Mozilla/SVG, Amaya and IE/Adobe and all failed to completely support 
SVG, some more that others :-)

Here are the parts of the W3 SVG recomendation I was looking at:



"If the user agent includes a CSS2 capability, a Conforming SVG Viewer 
must support CSS styling of SVG content and must support all features 
from CSS2 (Cascading Style Sheets, level 2 CSS2 Specification) that are 
described in this specification as applying to SVG (see properties 
shared with CSS and XSL, Styling with CSS and Facilities from CSS and 
XSL used by SVG). The supported features from CSS2 must be implemented 
in accordance with the conformance definitions from the CSS2 specification."
   http://www.w3.org/TR/SVG11/conform.html


and Styling with CSS includes:


"In an SVG user agent that supports CSS style sheets, the following 
facilities from [CSS2] must be supported:

     * CSS2 selectors within style sheets (reference: [Selectors]). 
Because SVG is intended to be used as one component in a multiple 
namespace XML application and CSS2 is not namespace aware, type 
selectors will only match against the local part of the element's 
qualified name.
...
     * CSS2's  dynamic pseudo-classes :hover, :active and :focus and 
pseudo-classes  :first-child, :visited, :link and :lang. The remaining 
CSS2 pseudo-classes, including those having to do with generated 
content, are not part of the SVG language definition. (Note: an SVG 
element gains focus when it is selected. See Text selection.)"
   http://www.w3.org/TR/SVG11/styling.html#StylingWithCSS




anyhow...

I got started on looking at how much CSS is supported in Batik because I 
am about to work on an editor that uses SVG. I was comparing Mozilla's 
SVG support to Batik's Squiggle. I like Squiggle and was hoping to use 
Batik as my starting point. My application is XML that includes XSLT 
that transforms the XML into SVG. I was hoping I could come up with a 
plugin for jEdit that gave me an editor for various languages and 
included SVG. It is not critical I have hover, and I may still be able 
to go that way.

Thanks again, Batik is great.

> 
> 
>> Here are two simple tests that do not 'hover':
>>
>> hoverCSS.svg
>>
>> <?xml version="1.0" standalone="no"?>
>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>>   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
>> <svg width="10cm" height="5cm" viewBox="0 0 1000 500"
>>      xmlns="http://www.w3.org/2000/svg" version="1.1">
>>   <defs>
>>     <style type="text/css"><![CDATA[
>>       rect {
>>         fill: red;
>>         stroke: blue;
>>         stroke-width: 6
>>       }
>>       rect:hover {
>>         stroke:green; stroke-width:10; fill-opacity:0.2;
>>       }
>>     ]]></style>
>>   </defs>
>>   <rect x="200" y="100" width="600" height="300"/>
>> </svg>
>>
>>
>> and
>> externalCSS.svg
>>
>> <?xml version="1.0" standalone="no"?>
>> <?xml-stylesheet href="mystyle.css" type="text/css"?>
>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>>   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
>> <svg width="10cm" height="5cm" viewBox="0 0 1000 500"
>>      xmlns="http://www.w3.org/2000/svg" version="1.1">
>>   <rect x="200" y="100" width="600" height="300"/>
>> </svg>
>>
>>
>> mystyle.css for externalCSS.svg
>>
>> rect {
>>   fill: red;
>>   stroke: blue;
>>   stroke-width: 6
>> }
>>
>> rect:hover {
>>   stroke:green; stroke-width:10; fill-opacity:0.2;
>> }
>>
>>
>> I was looking here
>>   http://www.w3.org/TR/SVG11/styling.html#StyleElementExample
>> and started playing. The other CSS stuff works.
>>
>> I'll file a bug if it's a bug :-)
>>
>> Thanks,
>>
>> Gary
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: batik-users-help@xml.apache.org
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: CSS2's dynamic pseudo-class :hover

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gary Frederick wrote:

> Howdy all,
> 
> Does Batik/Squiggle support hover?

    No, as far as I know Batik does not support any of the
CSS pseudo classes.



> Here are two simple tests that do not 'hover':
> 
> hoverCSS.svg
> 
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
> <svg width="10cm" height="5cm" viewBox="0 0 1000 500"
>      xmlns="http://www.w3.org/2000/svg" version="1.1">
>   <defs>
>     <style type="text/css"><![CDATA[
>       rect {
>         fill: red;
>         stroke: blue;
>         stroke-width: 6
>       }
>       rect:hover {
>         stroke:green; stroke-width:10; fill-opacity:0.2;
>       }
>     ]]></style>
>   </defs>
>   <rect x="200" y="100" width="600" height="300"/>
> </svg>
> 
> 
> and
> externalCSS.svg
> 
> <?xml version="1.0" standalone="no"?>
> <?xml-stylesheet href="mystyle.css" type="text/css"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
> <svg width="10cm" height="5cm" viewBox="0 0 1000 500"
>      xmlns="http://www.w3.org/2000/svg" version="1.1">
>   <rect x="200" y="100" width="600" height="300"/>
> </svg>
> 
> 
> mystyle.css for externalCSS.svg
> 
> rect {
>   fill: red;
>   stroke: blue;
>   stroke-width: 6
> }
> 
> rect:hover {
>   stroke:green; stroke-width:10; fill-opacity:0.2;
> }
> 
> 
> I was looking here
>   http://www.w3.org/TR/SVG11/styling.html#StyleElementExample
> and started playing. The other CSS stuff works.
> 
> I'll file a bug if it's a bug :-)
> 
> Thanks,
> 
> Gary
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org