Diff
Modified: trunk/LayoutTests/ChangeLog (186808 => 186809)
--- trunk/LayoutTests/ChangeLog 2015-07-14 17:37:55 UTC (rev 186808)
+++ trunk/LayoutTests/ChangeLog 2015-07-14 19:50:37 UTC (rev 186809)
@@ -1,3 +1,13 @@
+2015-07-14 Antti Koivisto <[email protected]>
+
+ REGRESSION (r177876): store.apple.com profile and cart icons are missing
+ https://bugs.webkit.org/show_bug.cgi?id=146894
+
+ Reviewed by Myles C. Maxfield.
+
+ * fast/css/font-face-multiple-missing-glyphs-expected.html: Added.
+ * fast/css/font-face-multiple-missing-glyphs.html: Added.
+
2015-07-14 Alex Christensen <[email protected]>
[Content Extensions] Fix if-domain and unless-domain when loading main documents.
Added: trunk/LayoutTests/fast/css/font-face-multiple-missing-glyphs-expected.html (0 => 186809)
--- trunk/LayoutTests/fast/css/font-face-multiple-missing-glyphs-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css/font-face-multiple-missing-glyphs-expected.html 2015-07-14 19:50:37 UTC (rev 186809)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test makes sure we search through all font-face declarations in order to find a working font.
+<div style="font: 200px 'Heiti SC'; -webkit-line-box-contain: font;">汉</div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/css/font-face-multiple-missing-glyphs.html (0 => 186809)
--- trunk/LayoutTests/fast/css/font-face-multiple-missing-glyphs.html (rev 0)
+++ trunk/LayoutTests/fast/css/font-face-multiple-missing-glyphs.html 2015-07-14 19:50:37 UTC (rev 186809)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: WebFont;
+ /* Any font which has a smaller ascent than Heiti SC can be used here */
+ src: local("Palatino-Roman");
+}
+
+@font-face {
+ font-family: WebFont;
+ /* This font must not be the default fallback font for U+6c49 */
+ src: local("Heiti SC");
+}
+
+@font-face {
+ font-family: WebFont;
+ src: local("Palatino-Roman");
+}
+</style>
+</head>
+<body>
+This test makes sure we search through all font-face declarations in order to find a working font.
+<div style="font: 200px WebFont; -webkit-line-box-contain: font;">汉</div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (186808 => 186809)
--- trunk/Source/WebCore/ChangeLog 2015-07-14 17:37:55 UTC (rev 186808)
+++ trunk/Source/WebCore/ChangeLog 2015-07-14 19:50:37 UTC (rev 186809)
@@ -1,3 +1,34 @@
+2015-07-14 Antti Koivisto <[email protected]>
+
+ REGRESSION (r177876): store.apple.com profile and cart icons are missing
+ https://bugs.webkit.org/show_bug.cgi?id=146894
+
+ Reviewed by Myles C. Maxfield.
+
+ If we had several @font-face rules for the same face covering overlapping ranges we
+ would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
+ try the other ones.
+
+ Test: fast/css/font-face-multiple-missing-glyphs.html
+
+ * platform/graphics/FontCascadeFonts.cpp:
+ (WebCore::FontCascadeFonts::glyphDataForVariant):
+ (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
+
+ Get GlyphData with one call.
+
+ * platform/graphics/FontRanges.cpp:
+ (WebCore::FontRanges::~FontRanges):
+ (WebCore::FontRanges::glyphDataForCharacter):
+
+ Check that we actually have a glyph in the font for the character before returning it.
+
+ (WebCore::FontRanges::fontForCharacter):
+ (WebCore::FontRanges::fontForFirstRange):
+ * platform/graphics/FontRanges.h:
+ (WebCore::FontRanges::size):
+ (WebCore::FontRanges::rangeAt):
+
2015-07-14 Alex Christensen <[email protected]>
[Content Extensions] Fix if-domain and unless-domain when loading main documents.
Modified: trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp (186808 => 186809)
--- trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp 2015-07-14 17:37:55 UTC (rev 186808)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp 2015-07-14 19:50:37 UTC (rev 186809)
@@ -295,8 +295,7 @@
auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex++);
if (fontRanges.isNull())
break;
- auto* font = fontRanges.fontForCharacter(c);
- GlyphData data = "" ? font->glyphDataForCharacter(c) : GlyphData();
+ GlyphData data = ""
if (data.font) {
// The variantFont function should not normally return 0.
// But if it does, we will just render the capital letter big.
@@ -313,17 +312,11 @@
GlyphData FontCascadeFonts::glyphDataForNormalVariant(UChar32 c, const FontDescription& description)
{
- const unsigned pageNumber = c / GlyphPage::size;
-
- for (unsigned fallbackIndex = 0; true; ++fallbackIndex) {
+ for (unsigned fallbackIndex = 0; ; ++fallbackIndex) {
auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex);
if (fontRanges.isNull())
break;
- auto* font = fontRanges.fontForCharacter(c);
- auto* page = font ? font->glyphPage(pageNumber) : nullptr;
- if (!page)
- continue;
- GlyphData data = ""
+ GlyphData data = ""
if (data.font) {
if (data.font->platformData().orientation() == Vertical && !data.font->isTextOrientationFallback()) {
if (!FontCascade::isCJKIdeographOrSymbol(c))
@@ -339,7 +332,6 @@
return glyphDataForCJKCharacterWithoutSyntheticItalic(c, data);
#endif
}
-
return data;
}
}
Modified: trunk/Source/WebCore/platform/graphics/FontRanges.cpp (186808 => 186809)
--- trunk/Source/WebCore/platform/graphics/FontRanges.cpp 2015-07-14 17:37:55 UTC (rev 186808)
+++ trunk/Source/WebCore/platform/graphics/FontRanges.cpp 2015-07-14 19:50:37 UTC (rev 186809)
@@ -46,15 +46,23 @@
{
}
-const Font* FontRanges::fontForCharacter(UChar32 c) const
+GlyphData FontRanges::glyphDataForCharacter(UChar32 character) const
{
for (auto& range : m_ranges) {
- if (range.from() <= c && c <= range.to())
- return &range.font();
+ if (range.from() <= character && character <= range.to()) {
+ auto glyphData = range.font().glyphDataForCharacter(character);
+ if (glyphData.glyph)
+ return glyphData;
+ }
}
- return nullptr;
+ return GlyphData();
}
+const Font* FontRanges::fontForCharacter(UChar32 character) const
+{
+ return glyphDataForCharacter(character).font;
+}
+
const Font& FontRanges::fontForFirstRange() const
{
return m_ranges[0].font();
Modified: trunk/Source/WebCore/platform/graphics/FontRanges.h (186808 => 186809)
--- trunk/Source/WebCore/platform/graphics/FontRanges.h 2015-07-14 17:37:55 UTC (rev 186808)
+++ trunk/Source/WebCore/platform/graphics/FontRanges.h 2015-07-14 19:50:37 UTC (rev 186809)
@@ -62,6 +62,7 @@
unsigned size() const { return m_ranges.size(); }
const Range& rangeAt(unsigned i) const { return m_ranges[i]; }
+ GlyphData glyphDataForCharacter(UChar32) const;
WEBCORE_EXPORT const Font* fontForCharacter(UChar32) const;
WEBCORE_EXPORT const Font& fontForFirstRange() const;
bool isLoading() const;
Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (186808 => 186809)
--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp 2015-07-14 17:37:55 UTC (rev 186808)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp 2015-07-14 19:50:37 UTC (rev 186809)
@@ -82,16 +82,17 @@
}
return true;
}
-
+/*
static bool canUseForText(const RenderText& textRenderer, const Font& font)
{
if (textRenderer.is8Bit())
return canUseForText(textRenderer.characters8(), textRenderer.textLength(), font);
return canUseForText(textRenderer.characters16(), textRenderer.textLength(), font);
}
-
-bool canUseFor(const RenderBlockFlow& flow)
+*/
+bool canUseFor(const RenderBlockFlow&)
{
+ return false; /*
if (!flow.frame().settings().simpleLineLayoutEnabled())
return false;
if (!flow.firstChild())
@@ -211,6 +212,7 @@
return false;
}
return true;
+ */
}
static float computeLineLeft(ETextAlign textAlign, float availableWidth, float committedWidth, float logicalLeftOffset)