Created attachment 128113 [details] insert-css-link.html (test case) 1. Open the attached insert-css-link.html. 2. Observe both "Felipa" and "Arial" are rendered with Arial, where "Felipa" must be rendered with Felipa. This issue has been observed for: - WebKit r108205 + Safari 5.1.2 on OS X 10.6.8 - Chrome 19.0.1041.0 dev on OS X 10.6.8 This issue has *NOT* been observed for: - Safari 5.1.2 (6534.52.7) on OS X 10.6.8 - Firefox 10.0.2 on OS X 10.6.8 - Opera 11.61 on OS X 10.6.8 insert-css-link.html: <head> <style> * { font-size: 24px; } .princess { font-family: 'Felipa', 'Arial'; } </style> </head> <div class="princess">Felipa</div> <div style="font-family:Arial">Arial</div> <script> window.setTimeout( function() { var link = document.createElement("link"); link.setAttribute("href", "http://fonts.googleapis.com/css?family=Felipa"); link.setAttribute("rel", "stylesheet"); link.setAttribute("type", "text/css"); document.head.appendChild(link); }, 1); </script>
This can be related to http://wkb.ug/79021
Created attachment 128115 [details] Actual image
Created attachment 128116 [details] Expected image
Hi Annti, Can you take a look? I confirmed that r104060 shows this issue http://trac.webkit.org/changeset/104060/ Analyze stylesheet scope to minimize style recalcs while 104052 doesn't.
Sorry, Antti, not Annti.
I've confirmed that applying the following patch fixes the issue. Document::analyzeStylesheetChange(...) is likely to have a bug. diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index 5125bbb..ac2b283 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -3273,7 +3273,6 @@ void Document::analyzeStylesheetChange(StyleSelectorUpdateFlag updateFlag, const if (m_styleSheets->item(i) != newStylesheets[i]) return; } - requiresStyleSelectorReset = false; // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs. if (!body() || m_hasNodesWithPlaceholderStyle)
<rdar://problem/10911246>
Created attachment 128311 [details] patch
Comment on attachment 128311 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=128311&action=review > Source/WebCore/ChangeLog:3 > + https://bugs.webkit.org/show_bug.cgi?id=79186 URL should show up before the summary.
Comment on attachment 128311 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=128311&action=review > Source/WebCore/ChangeLog:8 > + Test: fast/css/font-face-insert-link.html This doesn't seem to be included in the patch.
Created attachment 128323 [details] now with the test case included
Comment on attachment 128323 [details] now with the test case included View in context: https://bugs.webkit.org/attachment.cgi?id=128323&action=review r=me. > LayoutTests/fast/css/font-face-insert-link.html:23 > + link.setAttribute("href", "resources/ahem.css"); If we were feeling maximally fancy, this could probably be done with a data: URL. > LayoutTests/fast/css/font-face-insert-link.html:34 > + 500 Long setTimeout() interval is long.
http://trac.webkit.org/changeset/108574
> Long setTimeout() interval is long. Font loading is unpredictable across platforms and I don't know of any good way to observe it.
*** Bug 79312 has been marked as a duplicate of this bug. ***