| This test checks text editor token highlight functionality. |
| |
| =========== TextEditor text ========== |
| function findElement(collection, elem) { |
| // length |
| for(var i = 0; i < collection.length; ++i) |
| if (collection[i] === elem) |
| return i; |
| return null; |
| } |
| =========== Before selecting element =========== |
| |
| <div class="inner-container text-editor-editable" tabindex="0"> |
| <div class="webkit-line-content"><span>function findElement(collection, elem) {</span></div> |
| <div class="webkit-line-content"><span> // length</span></div> |
| <div class="webkit-line-content"><span> for(var i = 0; i </span><span class="webkit-html-tag"><</span><span> </span><span class="webkit-html-tag">collection.length;</span><span> </span><span class="webkit-html-attribute-name">++i)</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-name">if</span><span> </span><span class="webkit-html-attribute-name">(collection</span><span>[</span><span class="webkit-html-attribute-name">i</span><span>] === </span><span class="webkit-html-attribute-value">elem)</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">return</span><span> </span><span class="webkit-html-attribute-value">i;</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">return</span><span> </span><span class="webkit-html-attribute-value">null;</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">}</span></div></div> |
| =========== After selecting 'collection' =========== |
| |
| <div class="inner-container text-editor-editable" tabindex="0"> |
| <div class="webkit-line-content"><span>function findElement(collection, elem) {</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 147px; width: 70px; height: <number>px;"></span></div> |
| <div class="webkit-line-content"><span> // length</span></div> |
| <div class="webkit-line-content"><span> for(var i = 0; i </span><span class="webkit-html-tag"><</span><span> </span><span class="webkit-html-tag">collection.length;</span><span> </span><span class="webkit-html-attribute-name">++i)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 189px; width: 70px; height: <number>px;"></span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-name">if</span><span> </span><span class="webkit-html-attribute-name">(collection</span><span>[</span><span class="webkit-html-attribute-name">i</span><span>] === </span><span class="webkit-html-attribute-value">elem)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 112px; width: 70px; height: <number>px;"></span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">return</span><span> </span><span class="webkit-html-attribute-value">i;</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">return</span><span> </span><span class="webkit-html-attribute-value">null;</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">}</span></div></div> |
| =========== After selecting 'elem' =========== |
| |
| <div class="inner-container text-editor-editable" tabindex="0"> |
| <div class="webkit-line-content"><span>function findElement(collection, elem) {</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 231px; width: 28px; height: <number>px;"></span></div> |
| <div class="webkit-line-content"><span> // length</span></div> |
| <div class="webkit-line-content"><span> for(var i = 0; i </span><span class="webkit-html-tag"><</span><span> </span><span class="webkit-html-tag">collection.length;</span><span> </span><span class="webkit-html-attribute-name">++i)</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-name">if</span><span> </span><span class="webkit-html-attribute-name">(collection</span><span>[</span><span class="webkit-html-attribute-name">i</span><span>] === </span><span class="webkit-html-attribute-value">elem)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 238px; width: 28px; height: <number>px;"></span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">return</span><span> </span><span class="webkit-html-attribute-value">i;</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">return</span><span> </span><span class="webkit-html-attribute-value">null;</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">}</span></div></div> |
| =========== After selecting 'length' =========== |
| |
| <div class="inner-container text-editor-editable" tabindex="0"> |
| <div class="webkit-line-content"><span>function findElement(collection, elem) {</span></div> |
| <div class="webkit-line-content"><span> // length</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 77px; width: 42px; height: <number>px;"></span></div> |
| <div class="webkit-line-content"><span> for(var i = 0; i </span><span class="webkit-html-tag"><</span><span> </span><span class="webkit-html-tag">collection.length;</span><span> </span><span class="webkit-html-attribute-name">++i)</span><span class="text-editor-token-highlight text-editor-overlay-highlight" style="left: 266px; width: 42px; height: <number>px;"></span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-name">if</span><span> </span><span class="webkit-html-attribute-name">(collection</span><span>[</span><span class="webkit-html-attribute-name">i</span><span>] === </span><span class="webkit-html-attribute-value">elem)</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">return</span><span> </span><span class="webkit-html-attribute-value">i;</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">return</span><span> </span><span class="webkit-html-attribute-value">null;</span></div> |
| <div class="webkit-line-content"><span> </span><span class="webkit-html-attribute-value">}</span></div></div> |
| |