Chrome中的错误与window.getSelection()和:first-letter - 任何解决方法?

时间:2013-07-30 16:22:40

标签: google-chrome

该错误仅发生在chrome中(在linux 64 bit / ubuntu 13.04下的chrome版本28.0.1500.71中测试),而不是在firefox(版本22.0)中。

问题是chrome中的Window.getSelection()不正确,它报告选择索引-1,因此在第一个和第二个字符之间用鼠标单击会导致位置0.它似乎处理:第一个字母的样式字符作为内部不同的dom元素。请参阅http://jsfiddle.net/c66kk/1/以了解此Chrome错误:

<p class="initial">1234567890</p>

.initial:first-letter {
float: left;
font-size: 1.5em;
font-weight: bold;
}

$('p').click(function(){
    console.log(window.getSelection());
});

有没有已知的解决方法?

上下文:我尝试为aloha编辑器修复此错误。我还报告了一个铬虫:https://code.google.com/p/chromium/issues/detail?id=266334

0 个答案:

没有答案
相关问题