2014-08-30 44 views
2

在OS X的Chrome 37中,此HTML頁面的內容在滾動時沒有正確刷新 - 它只是空白。如果您嘗試選擇文字,您也可能觸發該問題 - 它將被清空。爲什麼OS X上的Chrome 37不能正確顯示此HTML?

但是:

  • 如果從CSS中刪除-webkit-font-feature-settings線, 它將正常工作。

  • 如果您從第一行刪除­(軟連字符),它將正常工作。

此顯示錯誤不會影響Windows上的Chrome 37,OS X以及OS X之前的版本(AFAIK)。

因此我的問題:

  1. 這到底是怎麼回事?

  2. 是否有解決方法,不涉及刪除軟連字符或OpenType功能?

謝謝。


這裏是the fiddle

下面是HTML,具有相同的段落重複5次(和在每個段落以供參考的端部的標號):

<!DOCTYPE html> 
<html> 
    <head> 
    <meta charset="UTF-8"> 
<title>here</title> 

<style type="text/css"> 

body { 
-webkit-font-feature-settings: 'kern' 1; 
} 

</style> 

</head> 
<body>hyphen&shy;ated 

But, in a larger sense, we can not dedicate, we can not consecrate, we can not hallow this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us—that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion—that we here highly resolve that these dead shall not have died in vain—that this nation, under God, shall have a new birth of freedom—and that government of the people, by the people, for the people, shall not perish from the earth. 

But, in a larger sense, we can not dedicate, we can not consecrate, we can not hallow this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us—that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion—that we here highly resolve that these dead shall not have died in vain—that this nation, under God, shall have a new birth of freedom—and that government of the people, by the people, for the people, shall not perish from the earth2. 

But, in a larger sense, we can not dedicate, we can not consecrate, we can not hallow this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us—that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion—that we here highly resolve that these dead shall not have died in vain—that this nation, under God, shall have a new birth of freedom—and that government of the people, by the people, for the people, shall not perish from the earth3. 

But, in a larger sense, we can not dedicate, we can not consecrate, we can not hallow this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us—that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion—that we here highly resolve that these dead shall not have died in vain—that this nation, under God, shall have a new birth of freedom—and that government of the people, by the people, for the people, shall not perish from the earth4. 

But, in a larger sense, we can not dedicate, we can not consecrate, we can not hallow this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us—that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion—that we here highly resolve that these dead shall not have died in vain—that this nation, under God, shall have a new birth of freedom—and that government of the people, by the people, for the people, shall not perish from the earth5. 

</body> 
</html> 

PS。這裏的a codepen以稍微不同的方式顯示相同的問題。

+1

鉻問題open reference這篇文章https://code.google.com/p/chromium/issues/detail?id=391515 – jedierikb 2014-09-02 13:23:02

+0

我知道,我把鏈接放在那裏。請注意,Chromium開發人員並未將其視爲錯誤,因爲他們無法在OS X上使用Chrome 38進行復制(= true AFAICT:錯誤不在v38中,僅爲v37) – 2014-09-03 02:03:26

回答

1

我偶然發現了一個解決方案,因爲它在chrome 38 mac中仍然有錯誤。

article h1, article h2, article p, article li, article blockquote { 
    white-space: pre-line; 
} 

其中p是容器&害羞;

0

這裏發生了什麼?

這是在Chrome 37

一個錯誤是有不涉及刪除無論是軟連字符或OpenType功能一個解決方法嗎?

避免滾動內容。

1

這是一個錯誤。該錯誤還會影響OS X上的Opera 24(因爲它基於有問題的Chrome 37代碼)。

解決方法是刪除文本中的軟連字符或刪除webkit的字體特徵(即所有出現的CSS屬性-webkit-font-feature-settings)。請注意,此屬性必須是已刪除 - 您無法鏈接第二個僅反轉設置的CSS文件,例如* {-webkit-font-feature-settings: inherit}。無論出於何種原因,只要有故障的瀏覽器讀取此屬性,就會出現錯誤。

當然,這個解決方法的問題在於它是過度包含的:它會在所有版本的Chrome和Opera中禁用-webkit-font-feature-settings,而不僅僅是錯誤的。爲了避免這個後果,我把styles.css分成了第二個版本,剝去了-webkit-font-feature-settings。然後我使用JavaScript來檢測有問題的瀏覽器並加載剝離的CSS。我知道,一種令人皺眉的技術,但最簡單的解決方法是最有效的方法(不要懲罰使用其他瀏覽器的人)。

相關問題