<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PUBLOG &#187; javascript</title>
	<atom:link href="http://blog.webkitchen.cz/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.webkitchen.cz</link>
	<description></description>
	<lastBuildDate>Wed, 16 Nov 2011 00:41:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Vylepšená náhrada textu obrázkem: acIR</title>
		<link>http://blog.webkitchen.cz/acir</link>
		<comments>http://blog.webkitchen.cz/acir#comments</comments>
		<pubDate>Fri, 08 May 2009 21:56:07 +0000</pubDate>
		<dc:creator>Jakub</dc:creator>
				<category><![CDATA[Česky]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://blog.webkitchen.cz/?p=343</guid>
		<description><![CDATA[Nemám rád sIFR, proto když mi můj oblíbený (dis)grafik nakreslil nový design pro mojí homepage s použitím moc hezkého, ale nestandradního, fontu, rozhodl jsem se najít jiné řešení pro jeho použití při zachování přístupnosti. Přístupností mám na mysli to, aby byl text v kódu skutečně jako text, byl vidět i při vypnutých obrázcích a šel [...]]]></description>
			<content:encoded><![CDATA[<p>Nemám rád <a href="http://www.mikeindustries.com/blog/sifr/">sIFR</a>, proto když mi můj <a href="http://disgrafik.eu/">oblíbený (dis)grafik</a> nakreslil nový design pro mojí homepage s použitím moc hezkého, ale nestandradního, fontu, rozhodl jsem se najít jiné řešení pro jeho použití při zachování přístupnosti. Přístupností mám na mysli to, aby byl text v kódu skutečně jako text, byl vidět i při vypnutých obrázcích a šel označit pomocí myši.</p>
<p><span id="more-343"></span></p>
<p>Řešení vychází z použití <a href="http://wellstyled.com/css-replace-text-by-image.html">Pixyho náhrady textu obrázkem</a>, které řeší požadavek na text v kódu a funkčnost při vypnutých obrázcích. Zbývalo tedy dořešit problém s označením pomocí myši. Toho jsem dosáhl kouskem JavaScriptu, který při pokusu o označení textu, jenž je ve skutečnosti obrázkem na pozadím elementu opravdový text překrývající, tento překrývající element skryje a po zrušení označení ho opět zobrazí. Malá ukázka (<a href="http://blog.webkitchen.cz/wp-content/uploads/2009/05/09/gifcast.gif">screencast</a>):</p>
<div id="acir">Lorem ipsum dolor sit amet,<br />
consectetur adipiscing elit<span id="acir-in"><!-- keep this WP please --></span></div>
<p><script src="http://blog.webkitchen.cz/js/acir.js?3" type="text/javascript"></script></p>
<p>Accesible Image Replacement neboli acIR, jak jsem toto řešení honosně nazval, vypadá takto:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> acIR <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    FF<span style="color: #339933;">:</span> <span style="color: #009966; font-style: italic;">/Firefox/i</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">navigator</span>.<span style="color: #660066;">userAgent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
    init<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> element<span style="color: #339933;">,</span> elements <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'span'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> elements.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            element <span style="color: #339933;">=</span> elements<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>element.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">tagName</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'A'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    acIR.<span style="color: #660066;">enableSelection</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
    enableSelection<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        acIR.<span style="color: #660066;">FF</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> element.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">insertBefore</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> element.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">firstChild</span><span style="color: #009900;">&#41;</span>
&nbsp;
        window.<span style="color: #660066;">opera</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>element.<span style="color: #660066;">style</span>.<span style="color: #660066;">cursor</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        element.<span style="color: #660066;">onmousedown</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// clean-up</span>
            document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmousedown</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmousedown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmouseup</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmouseup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// Left button is down, enable selection by hiding the picture</span>
            <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> e <span style="color: #339933;">||</span> window.<span style="color: #660066;">event</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">button</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> e.<span style="color: #660066;">button</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                acIR.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmouseup</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #006600; font-style: italic;">// ..released immediately without moving, cancel the process</span>
                    acIR.<span style="color: #660066;">end</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmousemove</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmousemove</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #006600; font-style: italic;">// ...cursor moved, init the re-appear process</span>
                    document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmouseup</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                    document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmousemove</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #006600; font-style: italic;">// Down-move-up means 'click' to some browsers, work it around</span>
                    document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmousedown</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">// The button is down again, we're going to show the pic again soon</span>
                        document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmousemove</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmouseup</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                        document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmouseup</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            <span style="color: #006600; font-style: italic;">// ...clicked, let's show it</span>
                            <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> e <span style="color: #339933;">||</span> window.<span style="color: #660066;">event</span><span style="color: #339933;">;</span>
                            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">button</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> e.<span style="color: #660066;">button</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                acIR.<span style="color: #660066;">end</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                                document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                                document.<span style="color: #660066;">body</span>.<span style="color: #660066;">onmousedown</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                            <span style="color: #009900;">&#125;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
    start<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>acIR.<span style="color: #660066;">FF</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            element.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            element.<span style="color: #660066;">style</span>.<span style="color: #660066;">visibility</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'hidden'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
    end<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>acIR.<span style="color: #660066;">FF</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            element.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'block'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            element.<span style="color: #660066;">style</span>.<span style="color: #660066;">visibility</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'visible'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Určitě by stálo za to kód přetvořit do podoby používající nějaký framework nebo alespoň DOM3 events, aby ho bylo možné použít i na stránkách již obsahujující JavaScript, se kterým by acIR v tuto chvíli kvůli způsobu zavěšování posluchačů událostí mohl kolidovat.</p>
<p>acIR bez problému funguje v Opeře, Google Chrome, Konqueroru, IE6, IE7. Ve Firefoxu funguje též, ale je tam menší nedostatek v tom, že <span style="text-decoration: line-through;">po skrytí překrývajícího elementu není text pod ním ihned vybrán &#8211; je potřeba pokus o výběr zopakovat</span> výběr začíná od začátku textu nikoliv přesně od místa, kde bylo kliknuto.</p>
<p>V akci lze acIR vidět také na <a href="http://www.webkitchen.cz/">WebKitchen.cz</a>.</p>
<p>Licence pro acIR: <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/cz/"><img style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/cz/88x31.png" alt="Creative Commons License" /></a></p>
<p><strong>Aktualizace:</strong> tento článek je již staršího data, v současné době samozřejmě <code>@font-face</code> rule them all</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webkitchen.cz/acir/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Implementation of CSS3 selectors in JavaScript</title>
		<link>http://blog.webkitchen.cz/css3-selectors-in-javascript</link>
		<comments>http://blog.webkitchen.cz/css3-selectors-in-javascript#comments</comments>
		<pubDate>Sat, 10 Jan 2009 13:39:46 +0000</pubDate>
		<dc:creator>Jakub</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://blog.webkitchen.cz/?p=266</guid>
		<description><![CDATA[ A couple of years ago, there was a need for an implementation of CSS3 selectors in JavaScript (as a part of a debugging tool I was working on). The implementation is ready and tested, but is not needed anymore so I&#8217;ve decided to publish it for free download.

The implementation is almost 100% complete. It [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-190" title="w3c_main" src="http://blog.webkitchen.cz/wp-content/uploads/2009/01/w3c_main.png" alt="" width="315" height="48" /> A couple of years ago, there was a need for an implementation of <a href="http://www.w3.org/TR/css3-selectors/">CSS3 selectors</a> in JavaScript (as a part of a debugging tool I was working on). The implementation is ready and tested, but is not needed anymore so I&#8217;ve decided to publish it for free download.</p>
<p><span id="more-266"></span></p>
<p>The implementation is almost 100% complete. It can even handle such things as unicode notations. For example, the following selector is processed exactly as per the spec:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">:</span>not<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">:</span>root<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">:</span>not<span style="color: #00AA00;">&#40;</span>form<span style="color: #00AA00;">&#41;</span><span style="color: #3333ff;">:first-child</span><span style="color: #00AA00;">:</span>not<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">:</span>lang<span style="color: #00AA00;">&#40;</span>en<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span> &amp;gt<span style="color: #00AA00;">;</span> div<span style="color: #3333ff;">:first-</span>child ~ div</pre></div></div>

<p>The library uses standard DOM methods only, which means that there isn&#8217;t any pre-conversion of CSS selectors to an XPath expressions as other such libraries usualy do.  The script hasn&#8217;t been much optimized in terms of speed and doesn&#8217;t work in IE. The main and only goal was to create an implementation that would follow the specification as much as possible and work in the Gecko family browsers.</p>
<p><strong><a href="https://github.com/jkbr/Selectors/">https://github.com/jkbr/Selectors/</a></strong></p>
<p>You can try the library directly from your browser (unless you are using IE) on a <a href="http://www.webkitchen.cz/lab/js/Selectors/test.html">demo page</a>.</p>
<p>An application to the official W3C&#8217;s CSS3 selectors test suit is also <a href="http://www.webkitchen.cz/lab/js/Selectors/W3C-tests">available</a>. Note that when performing those tests all <strong><em>!important</em> statements are being ignored.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webkitchen.cz/css3-selectors-in-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementace CSS3 selectorů v JavaScriptu</title>
		<link>http://blog.webkitchen.cz/selectors</link>
		<comments>http://blog.webkitchen.cz/selectors#comments</comments>
		<pubDate>Fri, 09 Jan 2009 20:36:25 +0000</pubDate>
		<dc:creator>Jakub</dc:creator>
				<category><![CDATA[Česky]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://blog.webkitchen.cz/?p=187</guid>
		<description><![CDATA[ Pro účely jedné, velice speciální a nakonec nikdy nedokončené, zakázky, bylo potřeba vytvořit implementaci CSS3 selectorů v JavaScriptu. Implementace je hotová, funkční a otestovaná, ale již není potřeba, tak se o ní podělím alespoň tady na blogu.

Jedná se o (v rámci možností) kompletní implementaci, která si poradí i s takovými záludnostmi, jako je zápis [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-190" title="w3c_main" src="http://blog.webkitchen.cz/wp-content/uploads/2009/01/w3c_main.png" alt="" width="315" height="48" /> Pro účely jedné, velice speciální a nakonec nikdy nedokončené, zakázky, bylo potřeba vytvořit implementaci <a href="http://www.w3.org/TR/css3-selectors/">CSS3 selectorů</a> v JavaScriptu. Implementace je hotová, funkční a otestovaná, ale již není potřeba, tak se o ní podělím alespoň tady na blogu.</p>
<p><span id="more-187"></span></p>
<p>Jedná se o (v rámci možností) kompletní implementaci, která si poradí i s takovými záludnostmi, jako je zápis pomocí unicode. Např. takovýto selector není problém:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">:</span>not<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">:</span>root<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">:</span>not<span style="color: #00AA00;">&#40;</span>form<span style="color: #00AA00;">&#41;</span><span style="color: #3333ff;">:first-child</span><span style="color: #00AA00;">:</span>not<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">:</span>lang<span style="color: #00AA00;">&#40;</span>en<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span> &amp;gt<span style="color: #00AA00;">;</span> div<span style="color: #3333ff;">:first-</span>child ~ div</pre></div></div>

<p>Při hledání elementů se využívají pouze standardní DOM metody (tudíž žádná konverze na XPath, jak je bežné pro podobné knihovny psané pro prostředí Internetu). Script nebyl příliš optimalizováno z hlediska rychlosti a ani IE nebyl brán v potaz, neb to nebylo v zadání. Důraz byl kladen především na věrnou implenetaci všech selectorů dle specifikace od W3C.</p>
<p><strong><a href="https://github.com/jkbr/Selectors">https://github.com/jkbr/Selectors</a></strong></p>
<p>Vyzkoušet možnosti knihovny je možné přímo z prohlížeče na speciální <a href="http://www.webkitchen.cz/lab/js/Selectors/test.html">testovací stránce</a>.</p>
<p>K dispozici je také <a href="http://www.webkitchen.cz/lab/js/Selectors/W3C-tests.php">aplikace na oficiální sadu testů</a> z dílny W3C. Při zkoušení těchto testů je potřeba mít na paměti, že při aplikování vlastností není brána v potaz priorita, takže i v případě, že např. barva nesedí, nemusí to nutně znamenat, že jde o chybu scriptu (a vice versa).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webkitchen.cz/selectors/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

