Title: [186932] branches/safari-601.1-branch

Diff

Modified: branches/safari-601.1-branch/LayoutTests/ChangeLog (186931 => 186932)


--- branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-07-17 05:32:31 UTC (rev 186931)
+++ branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-07-17 05:32:36 UTC (rev 186932)
@@ -1,5 +1,19 @@
 2015-07-16  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186827. rdar://problem/21736723
+
+    2015-07-14  Antti Koivisto  <an...@apple.com>
+
+            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-16  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186807. rdar://problem/21782350
 
     2015-07-14  Alex Christensen  <achristen...@webkit.org>

Added: branches/safari-601.1-branch/LayoutTests/fast/css/font-face-multiple-missing-glyphs-expected.html (0 => 186932)


--- branches/safari-601.1-branch/LayoutTests/fast/css/font-face-multiple-missing-glyphs-expected.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/fast/css/font-face-multiple-missing-glyphs-expected.html	2015-07-17 05:32:36 UTC (rev 186932)
@@ -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;">&#x6c49;</div>
+</body>
+</html>

Added: branches/safari-601.1-branch/LayoutTests/fast/css/font-face-multiple-missing-glyphs.html (0 => 186932)


--- branches/safari-601.1-branch/LayoutTests/fast/css/font-face-multiple-missing-glyphs.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/fast/css/font-face-multiple-missing-glyphs.html	2015-07-17 05:32:36 UTC (rev 186932)
@@ -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;">&#x6c49;</div>
+</body>
+</html>

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (186931 => 186932)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-17 05:32:31 UTC (rev 186931)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-17 05:32:36 UTC (rev 186932)
@@ -1,5 +1,40 @@
 2015-07-16  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186827. rdar://problem/21736723
+
+    2015-07-14  Antti Koivisto  <an...@apple.com>
+
+            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-16  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186807. rdar://problem/21782350
 
     2015-07-14  Alex Christensen  <achristen...@webkit.org>

Modified: branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontCascadeFonts.cpp (186931 => 186932)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontCascadeFonts.cpp	2015-07-17 05:32:31 UTC (rev 186931)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontCascadeFonts.cpp	2015-07-17 05:32:36 UTC (rev 186932)
@@ -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: branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontRanges.cpp (186931 => 186932)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontRanges.cpp	2015-07-17 05:32:31 UTC (rev 186931)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontRanges.cpp	2015-07-17 05:32:36 UTC (rev 186932)
@@ -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: branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontRanges.h (186931 => 186932)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontRanges.h	2015-07-17 05:32:31 UTC (rev 186931)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/FontRanges.h	2015-07-17 05:32:36 UTC (rev 186932)
@@ -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;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to