Text is rendered with other page's webfont with the same family name
Reported by
wilf...@gmail.com,
Jan 20 2017
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Steps to reproduce the problem: 1. unzip chrome-fontbug2.zip 2. start static web server. document root is chrome-fontbug2 folder. 3. open secret windown and access to chrome-fontbug2/index.html via this web server. 4. click "ipafont" link and see a text in canvas. 5. click browser back. 6. click "mplus" link and see a text in canvas. 7. click browser back. 8. do 4 to 6 agein. What is the expected behavior? "mplus" page set "mplus-1m-regular.ttf" font for rendering, not "ipa ex mincho" font. So the page will render "mplus-1m-regular.ttf" font or default font text. What went wrong? "mplus" page render "ipa ex mincho" font text at second time the page opened. Font-face style settings passed over pages. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 55.0.2883.87 Channel: stable OS Version: 6.1 (Windows 7) Flash Version: Shockwave Flash 24.0 r0
,
Jan 20 2017
Yes.
,
Jan 23 2017
,
Jan 23 2017
+ksakamoto: Could you take a look?
,
Jan 23 2017
Looking.
,
Jan 24 2017
Cached shaping result created by previous document was used. The global FallbackListShapeCache is keyed by FallbackListCompositeKey which is created from family names and FontDescription. In this case, the new document has the same custom font-family name as previous document (but source urls are different), so it generates the same cache key as previous document. ShapeCache has logic to clear cached entries if FontSelector version has changed, but in this case, the two document has the same FontSelector version (1), because they both have one @font-face rule.
,
Jan 24 2017
This is not canvas specific.
,
Jan 24 2017
Possible fix: https://codereview.chromium.org/2653773006/
,
Jan 24 2017
,
Jan 24 2017
Re #6, very good analysis, thanks for fixing this.
,
Jan 24 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f2bb61c5104755025adb0f1c5327de420311d32e commit f2bb61c5104755025adb0f1c5327de420311d32e Author: ksakamoto <ksakamoto@chromium.org> Date: Tue Jan 24 16:55:34 2017 Make FontFaceCache::version return unique number across all instances The global FallbackListShapeCache may contain entries created in multiple documents that have different @font-face rules. Those entries are versioned by FontFaceCache version, but entries from different FontFaceCache instances can have same version number. This patch makes sure that ShapeCache is invalidated when cached data is created within the context of different FontFaceCache instance. BUG= 682999 Review-Url: https://codereview.chromium.org/2653773006 Cr-Commit-Position: refs/heads/master@{#445744} [add] https://crrev.com/f2bb61c5104755025adb0f1c5327de420311d32e/third_party/WebKit/LayoutTests/fast/css/font-face-cache-version.html [add] https://crrev.com/f2bb61c5104755025adb0f1c5327de420311d32e/third_party/WebKit/LayoutTests/fast/css/resources/font-face-cache-version-frame1.html [add] https://crrev.com/f2bb61c5104755025adb0f1c5327de420311d32e/third_party/WebKit/LayoutTests/fast/css/resources/font-face-cache-version-frame2.html [modify] https://crrev.com/f2bb61c5104755025adb0f1c5327de420311d32e/third_party/WebKit/Source/core/css/FontFaceCache.cpp [modify] https://crrev.com/f2bb61c5104755025adb0f1c5327de420311d32e/third_party/WebKit/Source/core/css/FontFaceCache.h
,
Jan 24 2017
Thank you ksakamoto! |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by hajimehoshi@chromium.org
, Jan 20 2017Labels: OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)