Title: [201906] trunk
Revision
201906
Author
[email protected]
Date
2016-06-09 22:24:46 -0700 (Thu, 09 Jun 2016)

Log Message

Unreviewed, rolling out r201887.
https://bugs.webkit.org/show_bug.cgi?id=158610

This change caused LayoutTest crashes under GuardMalloc and
ASan (Requested by ryanhaddad on #webkit).

Reverted changeset:

"Deleting a CSSOM style rule invalidates any previously-added
FontFaces"
https://bugs.webkit.org/show_bug.cgi?id=158450
http://trac.webkit.org/changeset/201887

Patch by Commit Queue <[email protected]> on 2016-06-09

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201905 => 201906)


--- trunk/LayoutTests/ChangeLog	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/LayoutTests/ChangeLog	2016-06-10 05:24:46 UTC (rev 201906)
@@ -1,3 +1,18 @@
+2016-06-09  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r201887.
+        https://bugs.webkit.org/show_bug.cgi?id=158610
+
+        This change caused LayoutTest crashes under GuardMalloc and
+        ASan (Requested by ryanhaddad on #webkit).
+
+        Reverted changeset:
+
+        "Deleting a CSSOM style rule invalidates any previously-added
+        FontFaces"
+        https://bugs.webkit.org/show_bug.cgi?id=158450
+        http://trac.webkit.org/changeset/201887
+
 2016-06-09  Zalan Bujtas  <[email protected]>
 
         Add testing support for 3x device scale factor.

Deleted: trunk/LayoutTests/fast/text/font-face-set-cssom-expected.txt (201905 => 201906)


--- trunk/LayoutTests/fast/text/font-face-set-cssom-expected.txt	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/LayoutTests/fast/text/font-face-set-cssom-expected.txt	2016-06-10 05:24:46 UTC (rev 201906)
@@ -1,48 +0,0 @@
-This test makes sure that the CSS Font Loading API plays nicely with modifying @font-face rules with the CSSOM.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS item1.getBoundingClientRect().width is 48
-PASS item2.getBoundingClientRect().width is not 48
-PASS item3.getBoundingClientRect().width is not 48
-PASS item4.getBoundingClientRect().width is not 48
-PASS item5.getBoundingClientRect().width is not 48
-PASS item6.getBoundingClientRect().width is not 48
-PASS item1.getBoundingClientRect().width is 48
-PASS item2.getBoundingClientRect().width is 48
-PASS item3.getBoundingClientRect().width is not 48
-PASS item4.getBoundingClientRect().width is not 48
-PASS item5.getBoundingClientRect().width is not 48
-PASS item6.getBoundingClientRect().width is not 48
-PASS item1.getBoundingClientRect().width is 48
-PASS item2.getBoundingClientRect().width is 48
-PASS item3.getBoundingClientRect().width is 48
-PASS item4.getBoundingClientRect().width is not 48
-PASS item5.getBoundingClientRect().width is not 48
-PASS item6.getBoundingClientRect().width is not 48
-PASS item1.getBoundingClientRect().width is 48
-PASS item2.getBoundingClientRect().width is 48
-PASS item3.getBoundingClientRect().width is not 48
-PASS item4.getBoundingClientRect().width is not 48
-PASS item5.getBoundingClientRect().width is not 48
-PASS item6.getBoundingClientRect().width is not 48
-PASS connectedFontFace.family is "WebFont2"
-PASS connectedFontFace.family is "WebFont5"
-PASS item1.getBoundingClientRect().width is 48
-PASS item2.getBoundingClientRect().width is not 48
-PASS item3.getBoundingClientRect().width is not 48
-PASS item4.getBoundingClientRect().width is not 48
-PASS item5.getBoundingClientRect().width is 48
-PASS item6.getBoundingClientRect().width is not 48
-PASS styleSheet.cssRules[0].style.fontFamily is "WebFont6"
-PASS item1.getBoundingClientRect().width is 48
-PASS item2.getBoundingClientRect().width is not 48
-PASS item3.getBoundingClientRect().width is not 48
-PASS item4.getBoundingClientRect().width is not 48
-PASS item5.getBoundingClientRect().width is not 48
-PASS item6.getBoundingClientRect().width is 48
-PASS successfullyParsed is true
-
-TEST COMPLETE
-l l l l l l

Deleted: trunk/LayoutTests/fast/text/font-face-set-cssom.html (201905 => 201906)


--- trunk/LayoutTests/fast/text/font-face-set-cssom.html	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/LayoutTests/fast/text/font-face-set-cssom.html	2016-06-10 05:24:46 UTC (rev 201906)
@@ -1,92 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<style id="styleElement">
-</style>
-</head>
-<body>
-<span id="item1" style="font: 48px WebFont;">l</span>
-<span id="item2" style="font: 48px WebFont2;">l</span>
-<span id="item3" style="font: 48px WebFont3;">l</span>
-<span id="item4" style="font: 48px WebFont4;">l</span>
-<span id="item5" style="font: 48px WebFont5;">l</span>
-<span id="item6" style="font: 48px WebFont6;">l</span>
-<script>
-description("This test makes sure that the CSS Font Loading API plays nicely with modifying @font-face rules with the CSSOM.");
-
-var item1 = document.getElementById("item1");
-var item2 = document.getElementById("item2");
-var item3 = document.getElementById("item3");
-var item4 = document.getElementById("item4");
-var item5 = document.getElementById("item5");
-var item6 = document.getElementById("item6");
-
-var fontFace = new FontFace("WebFont", "local('Ahem')", {});
-document.fonts.add(fontFace);
-fontFace.load();
-
-shouldBe("item1.getBoundingClientRect().width", "48");
-shouldNotBe("item2.getBoundingClientRect().width", "48");
-shouldNotBe("item3.getBoundingClientRect().width", "48");
-shouldNotBe("item4.getBoundingClientRect().width", "48");
-shouldNotBe("item5.getBoundingClientRect().width", "48");
-shouldNotBe("item6.getBoundingClientRect().width", "48");
-
-var styleSheet = document.getElementById("styleElement").sheet;
-styleSheet.insertRule("@font-face { font-family: 'WebFont2'; src: local('Ahem'); }", 0);
-
-shouldBe("item1.getBoundingClientRect().width", "48");
-shouldBe("item2.getBoundingClientRect().width", "48");
-shouldNotBe("item3.getBoundingClientRect().width", "48");
-shouldNotBe("item4.getBoundingClientRect().width", "48");
-shouldNotBe("item5.getBoundingClientRect().width", "48");
-shouldNotBe("item6.getBoundingClientRect().width", "48");
-
-styleSheet.insertRule("@font-face { font-family: 'WebFont3'; src: local('Ahem'); }", 0);
-
-shouldBe("item1.getBoundingClientRect().width", "48");
-shouldBe("item2.getBoundingClientRect().width", "48");
-shouldBe("item3.getBoundingClientRect().width", "48");
-shouldNotBe("item4.getBoundingClientRect().width", "48");
-shouldNotBe("item5.getBoundingClientRect().width", "48");
-shouldNotBe("item6.getBoundingClientRect().width", "48");
-
-styleSheet.deleteRule(0);
-
-shouldBe("item1.getBoundingClientRect().width", "48");
-shouldBe("item2.getBoundingClientRect().width", "48");
-shouldNotBe("item3.getBoundingClientRect().width", "48");
-shouldNotBe("item4.getBoundingClientRect().width", "48");
-shouldNotBe("item5.getBoundingClientRect().width", "48");
-shouldNotBe("item6.getBoundingClientRect().width", "48");
-
-var connectedFontFace = document.fonts.keys().next().value;
-shouldBeEqualToString("connectedFontFace.family", "WebFont2");
-
-styleSheet.cssRules[0].style.fontFamily = "WebFont5";
-
-shouldBeEqualToString("connectedFontFace.family", "WebFont5");
-
-shouldBe("item1.getBoundingClientRect().width", "48");
-shouldNotBe("item2.getBoundingClientRect().width", "48");
-shouldNotBe("item3.getBoundingClientRect().width", "48");
-shouldNotBe("item4.getBoundingClientRect().width", "48");
-shouldBe("item5.getBoundingClientRect().width", "48");
-shouldNotBe("item6.getBoundingClientRect().width", "48");
-
-connectedFontFace.family = "WebFont6";
-
-shouldBeEqualToString("styleSheet.cssRules[0].style.fontFamily", "WebFont6");
-
-shouldBe("item1.getBoundingClientRect().width", "48");
-shouldNotBe("item2.getBoundingClientRect().width", "48");
-shouldNotBe("item3.getBoundingClientRect().width", "48");
-shouldNotBe("item4.getBoundingClientRect().width", "48");
-shouldNotBe("item5.getBoundingClientRect().width", "48");
-shouldBe("item6.getBoundingClientRect().width", "48");
-
-</script>
-<script src=""
-</body>
-<html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (201905 => 201906)


--- trunk/Source/WebCore/ChangeLog	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/ChangeLog	2016-06-10 05:24:46 UTC (rev 201906)
@@ -1,3 +1,18 @@
+2016-06-09  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r201887.
+        https://bugs.webkit.org/show_bug.cgi?id=158610
+
+        This change caused LayoutTest crashes under GuardMalloc and
+        ASan (Requested by ryanhaddad on #webkit).
+
+        Reverted changeset:
+
+        "Deleting a CSSOM style rule invalidates any previously-added
+        FontFaces"
+        https://bugs.webkit.org/show_bug.cgi?id=158450
+        http://trac.webkit.org/changeset/201887
+
 2016-06-09  Chris Dumez  <[email protected]>
 
         Address Darin's review comment on r201898.

Modified: trunk/Source/WebCore/css/CSSFontFace.cpp (201905 => 201906)


--- trunk/Source/WebCore/css/CSSFontFace.cpp	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/css/CSSFontFace.cpp	2016-06-10 05:24:46 UTC (rev 201906)
@@ -94,7 +94,6 @@
     , m_cssConnection(cssConnection)
     , m_wrapper(wrapper ? wrapper->createWeakPtr() : WeakPtr<FontFace>())
     , m_isLocalFallback(isLocalFallback)
-    , m_mayBePurged(!wrapper)
 {
 }
 
@@ -114,9 +113,6 @@
     RefPtr<CSSValueList> oldFamilies = m_families;
     m_families = &familyList;
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontFamily, &family);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this, oldFamilies.get());
     });
@@ -147,9 +143,6 @@
     if (auto mask = calculateStyleMask(style)) {
         m_traitsMask = static_cast<FontTraitsMask>((static_cast<unsigned>(m_traitsMask) & (~FontStyleMask)) | mask.value());
 
-        if (m_cssConnection)
-            m_cssConnection->mutableProperties().setProperty(CSSPropertyFontStyle, &style);
-
         iterateClients(m_clients, [&](Client& client) {
             client.fontPropertyChanged(*this);
         });
@@ -199,9 +192,6 @@
     if (auto mask = calculateWeightMask(weight)) {
         m_traitsMask = static_cast<FontTraitsMask>((static_cast<unsigned>(m_traitsMask) & (~FontWeightMask)) | mask.value());
 
-        if (m_cssConnection)
-            m_cssConnection->mutableProperties().setProperty(CSSPropertyFontWeight, &weight);
-
         iterateClients(m_clients, [&](Client& client) {
             client.fontPropertyChanged(*this);
         });
@@ -224,9 +214,6 @@
         m_ranges.append({ range.from(), range.to() });
     }
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyUnicodeRange, &unicodeRange);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this);
     });
@@ -243,9 +230,6 @@
     m_variantSettings.historicalLigatures = ligatures.historicalLigatures;
     m_variantSettings.contextualAlternates = ligatures.contextualAlternates;
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantLigatures, &variantLigatures);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this);
     });
@@ -260,9 +244,6 @@
 
     m_variantSettings.position = downcast<CSSPrimitiveValue>(variantPosition);
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantPosition, &variantPosition);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this);
     });
@@ -277,9 +258,6 @@
 
     m_variantSettings.caps = downcast<CSSPrimitiveValue>(variantCaps);
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantCaps, &variantCaps);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this);
     });
@@ -297,9 +275,6 @@
     m_variantSettings.numericOrdinal = numeric.ordinal;
     m_variantSettings.numericSlashedZero = numeric.slashedZero;
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantNumeric, &variantNumeric);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this);
     });
@@ -314,9 +289,6 @@
 
     m_variantSettings.alternates = downcast<CSSPrimitiveValue>(variantAlternates);
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantAlternates, &variantAlternates);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this);
     });
@@ -332,9 +304,6 @@
     m_variantSettings.eastAsianWidth = eastAsian.width;
     m_variantSettings.eastAsianRuby = eastAsian.ruby;
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontVariantEastAsian, &variantEastAsian);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this);
     });
@@ -362,9 +331,6 @@
 
     m_featureSettings = WTFMove(settings);
 
-    if (m_cssConnection)
-        m_cssConnection->mutableProperties().setProperty(CSSPropertyFontFeatureSettings, &featureSettings);
-
     iterateClients(m_clients, [&](Client& client) {
         client.fontPropertyChanged(*this);
     });
@@ -415,47 +381,35 @@
     m_clients.remove(&client);
 }
 
-void CSSFontFace::initializeWrapper()
+Ref<FontFace> CSSFontFace::wrapper()
 {
+    if (m_wrapper)
+        return Ref<FontFace>(*m_wrapper.get());
+
+    Ref<FontFace> wrapper = FontFace::create(*this);
     switch (m_status) {
     case Status::Pending:
         break;
     case Status::Loading:
-        m_wrapper->fontStateChanged(*this, Status::Pending, Status::Loading);
+        wrapper->fontStateChanged(*this, Status::Pending, Status::Loading);
         break;
     case Status::TimedOut:
-        m_wrapper->fontStateChanged(*this, Status::Pending, Status::Loading);
-        m_wrapper->fontStateChanged(*this, Status::Loading, Status::TimedOut);
+        wrapper->fontStateChanged(*this, Status::Pending, Status::Loading);
+        wrapper->fontStateChanged(*this, Status::Loading, Status::TimedOut);
         break;
     case Status::Success:
-        m_wrapper->fontStateChanged(*this, Status::Pending, Status::Loading);
-        m_wrapper->fontStateChanged(*this, Status::Pending, Status::Success);
+        wrapper->fontStateChanged(*this, Status::Pending, Status::Loading);
+        wrapper->fontStateChanged(*this, Status::Pending, Status::Success);
         break;
     case Status::Failure:
-        m_wrapper->fontStateChanged(*this, Status::Pending, Status::Loading);
-        m_wrapper->fontStateChanged(*this, Status::Pending, Status::Failure);
+        wrapper->fontStateChanged(*this, Status::Pending, Status::Loading);
+        wrapper->fontStateChanged(*this, Status::Pending, Status::Failure);
         break;
     }
-}
-
-Ref<FontFace> CSSFontFace::wrapper()
-{
-    if (m_wrapper)
-        return *m_wrapper.get();
-
-    auto wrapper = FontFace::create(*this);
     m_wrapper = wrapper->createWeakPtr();
-    initializeWrapper();
-    m_mayBePurged = false;
     return wrapper;
 }
 
-void CSSFontFace::setWrapper(FontFace& newWrapper)
-{
-    m_wrapper = newWrapper.createWeakPtr();
-    initializeWrapper();
-}
-
 void CSSFontFace::adoptSource(std::unique_ptr<CSSFontFaceSource>&& source)
 {
     m_sources.append(WTFMove(source));
@@ -598,17 +552,6 @@
     return nullptr;
 }
 
-bool CSSFontFace::purgeable() const
-{
-    return cssConnection() && m_mayBePurged;
-}
-
-void CSSFontFace::updateStyleIfNeeded()
-{
-    if (m_fontSelector && m_fontSelector->document())
-        m_fontSelector->document()->updateStyleIfNeeded();
-}
-
 #if ENABLE(SVG_FONTS)
 bool CSSFontFace::hasSVGFontFaceSource() const
 {

Modified: trunk/Source/WebCore/css/CSSFontFace.h (201905 => 201906)


--- trunk/Source/WebCore/css/CSSFontFace.h	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/css/CSSFontFace.h	2016-06-10 05:24:46 UTC (rev 201906)
@@ -135,15 +135,9 @@
 
     // We don't guarantee that the FontFace wrapper will be the same every time you ask for it.
     Ref<FontFace> wrapper();
-    void setWrapper(FontFace&);
-    FontFace* existingWrapper() { return m_wrapper.get(); }
 
     bool webFontsShouldAlwaysFallBack() const;
 
-    bool purgeable() const;
-
-    void updateStyleIfNeeded();
-
 #if ENABLE(SVG_FONTS)
     bool hasSVGFontFaceSource() const;
 #endif
@@ -155,8 +149,6 @@
     void setStatus(Status);
     void notifyClientsOfFontPropertyChange();
 
-    void initializeWrapper();
-
     void fontLoadEventOccurred();
     void timeoutFired();
 
@@ -174,7 +166,6 @@
     Status m_status { Status::Pending };
     bool m_isLocalFallback { false };
     bool m_sourcesPopulated { false };
-    bool m_mayBePurged { true };
 };
 
 }

Modified: trunk/Source/WebCore/css/CSSFontFaceSet.cpp (201905 => 201906)


--- trunk/Source/WebCore/css/CSSFontFaceSet.cpp	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/css/CSSFontFaceSet.cpp	2016-06-10 05:24:46 UTC (rev 201906)
@@ -95,10 +95,9 @@
     return false;
 }
 
-void CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered(const String& familyName)
+void CSSFontFaceSet::registerLocalFontFacesForFamily(const String& familyName)
 {
-    if (m_locallyInstalledFacesLookupTable.contains(familyName))
-        return;
+    ASSERT(!m_locallyInstalledFacesLookupTable.contains(familyName));
 
     Vector<FontTraitsMask> traitsMasks = FontCache::singleton().getTraitsInFamily(familyName);
     if (traitsMasks.isEmpty())
@@ -161,7 +160,7 @@
         if (addResult.isNewEntry) {
             // m_locallyInstalledFontFaces grows without bound, eventually encorporating every font installed on the system.
             // This is by design.
-            ensureLocalFontFacesForFamilyRegistered(familyName);
+            registerLocalFontFacesForFamily(familyName);
             familyFontFaces = { };
         }
 
@@ -188,11 +187,6 @@
 
     if (face.status() == CSSFontFace::Status::Loading || face.status() == CSSFontFace::Status::TimedOut)
         incrementActiveCount();
-
-    if (face.cssConnection()) {
-        auto addResult = m_constituentCSSConnections.add(face.cssConnection(), &face);
-        ASSERT_UNUSED(addResult, addResult.isNewEntry);
-    }
 }
 
 void CSSFontFaceSet::removeFromFacesLookupTable(const CSSFontFace& face, const CSSValueList& familiesToSearchFor)
@@ -228,11 +222,6 @@
     if (face.families())
         removeFromFacesLookupTable(face, *face.families());
 
-    if (face.cssConnection()) {
-        bool removed = m_constituentCSSConnections.remove(face.cssConnection());
-        ASSERT_UNUSED(removed, removed);
-    }
-
     for (size_t i = 0; i < m_faces.size(); ++i) {
         if (m_faces[i].ptr() == &face) {
             if (i < m_facesPartitionIndex)
@@ -247,23 +236,6 @@
     ASSERT_NOT_REACHED();
 }
 
-CSSFontFace* CSSFontFaceSet::lookupByCSSConnection(StyleRuleFontFace& target)
-{
-    return m_constituentCSSConnections.get(&target);
-}
-
-void CSSFontFaceSet::purge()
-{
-    Vector<std::reference_wrapper<CSSFontFace>> toRemove;
-    for (auto& face : m_faces) {
-        if (face->purgeable())
-            toRemove.append(face.get());
-    }
-
-    for (auto& item : toRemove)
-        remove(item.get());
-}
-
 void CSSFontFaceSet::clear()
 {
     for (auto& face : m_faces)
@@ -272,7 +244,6 @@
     m_facesLookupTable.clear();
     m_locallyInstalledFacesLookupTable.clear();
     m_cache.clear();
-    m_constituentCSSConnections.clear();
     m_facesPartitionIndex = 0;
     m_status = Status::Loaded;
 }

Modified: trunk/Source/WebCore/css/CSSFontFaceSet.h (201905 => 201906)


--- trunk/Source/WebCore/css/CSSFontFaceSet.h	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/css/CSSFontFaceSet.h	2016-06-10 05:24:46 UTC (rev 201906)
@@ -60,12 +60,9 @@
     size_t faceCount() const { return m_faces.size(); }
     void add(CSSFontFace&);
     void remove(const CSSFontFace&);
-    void purge();
     void clear();
     CSSFontFace& operator[](size_t i);
 
-    CSSFontFace* lookupByCSSConnection(StyleRuleFontFace&);
-
     bool check(const String& font, const String& text, ExceptionCode&);
 
     CSSSegmentedFontFace* getFontFace(FontTraitsMask, const AtomicString& family);
@@ -94,7 +91,7 @@
     void fontStateChanged(CSSFontFace&, CSSFontFace::Status oldState, CSSFontFace::Status newState) override;
     void fontPropertyChanged(CSSFontFace&, CSSValueList* oldFamilies = nullptr) override;
 
-    void ensureLocalFontFacesForFamilyRegistered(const String&);
+    void registerLocalFontFacesForFamily(const String&);
 
     static String familyNameFromPrimitive(const CSSPrimitiveValue&);
 
@@ -103,7 +100,6 @@
     HashMap<String, Vector<Ref<CSSFontFace>>, ASCIICaseInsensitiveHash> m_facesLookupTable;
     HashMap<String, Vector<Ref<CSSFontFace>>, ASCIICaseInsensitiveHash> m_locallyInstalledFacesLookupTable;
     HashMap<String, HashMap<unsigned, RefPtr<CSSSegmentedFontFace>>, ASCIICaseInsensitiveHash> m_cache;
-    HashMap<StyleRuleFontFace*, CSSFontFace*> m_constituentCSSConnections;
     size_t m_facesPartitionIndex { 0 }; // All entries in m_faces before this index are CSS-connected.
     Status m_status { Status::Loaded };
     HashSet<CSSFontFaceSetClient*> m_clients;

Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (201905 => 201906)


--- trunk/Source/WebCore/css/CSSFontSelector.cpp	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp	2016-06-10 05:24:46 UTC (rev 201906)
@@ -45,7 +45,6 @@
 #include "Document.h"
 #include "Font.h"
 #include "FontCache.h"
-#include "FontFace.h"
 #include "FontFaceSet.h"
 #include "FontSelectorClient.h"
 #include "FontVariantBuilder.h"
@@ -102,17 +101,7 @@
 void CSSFontSelector::buildStarted()
 {
     m_buildIsUnderway = true;
-    m_stagingArea.clear();
-    m_cssFontFaceSet->purge();
     ++m_version;
-
-    m_cssConnectionsPossiblyToRemove.clear();
-    m_cssConnectionsEncounteredDuringBuild.clear();
-    for (size_t i = 0; i < m_cssFontFaceSet->faceCount(); ++i) {
-        CSSFontFace& face = m_cssFontFaceSet.get()[i];
-        if (face.cssConnection())
-            m_cssConnectionsPossiblyToRemove.add(&face);
-    }
 }
 
 void CSSFontSelector::buildCompleted()
@@ -122,13 +111,7 @@
 
     m_buildIsUnderway = false;
 
-    // Some font faces weren't re-added during the build process.
-    for (auto& face : m_cssConnectionsPossiblyToRemove) {
-        auto* connection = face->cssConnection();
-        ASSERT(connection);
-        if (!m_cssConnectionsEncounteredDuringBuild.contains(connection))
-            m_cssFontFaceSet->remove(*face);
-    }
+    m_cssFontFaceSet->clear();
 
     for (auto& item : m_stagingArea)
         addFontFaceRule(item.styleRuleFontFace, item.isInitiatingElementInUserAgentShadowTree);
@@ -138,7 +121,6 @@
 void CSSFontSelector::addFontFaceRule(StyleRuleFontFace& fontFaceRule, bool isInitiatingElementInUserAgentShadowTree)
 {
     if (m_buildIsUnderway) {
-        m_cssConnectionsEncounteredDuringBuild.add(&fontFaceRule);
         m_stagingArea.append({fontFaceRule, isInitiatingElementInUserAgentShadowTree});
         return;
     }
@@ -205,12 +187,6 @@
     if (fontFace->allSourcesFailed())
         return;
 
-    if (RefPtr<CSSFontFace> existingFace = m_cssFontFaceSet->lookupByCSSConnection(fontFaceRule)) {
-        m_cssFontFaceSet->remove(*existingFace);
-        if (auto* existingWrapper = existingFace->existingWrapper())
-            existingWrapper->adopt(fontFace.get());
-    }
-
     m_cssFontFaceSet->add(fontFace.get());
     m_creatingFont = false;
     ++m_version;

Modified: trunk/Source/WebCore/css/CSSFontSelector.h (201905 => 201906)


--- trunk/Source/WebCore/css/CSSFontSelector.h	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/css/CSSFontSelector.h	2016-06-10 05:24:46 UTC (rev 201906)
@@ -105,8 +105,6 @@
     HashSet<FontSelectorClient*> m_clients;
 
     Vector<CachedResourceHandle<CachedFont>> m_fontsToBeginLoading;
-    HashSet<RefPtr<CSSFontFace>> m_cssConnectionsPossiblyToRemove;
-    HashSet<RefPtr<StyleRuleFontFace>> m_cssConnectionsEncounteredDuringBuild;
     Timer m_beginLoadingTimer;
 
     unsigned m_uniqueId;

Modified: trunk/Source/WebCore/css/FontFace.cpp (201905 => 201906)


--- trunk/Source/WebCore/css/FontFace.cpp	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/css/FontFace.cpp	2016-06-10 05:24:46 UTC (rev 201906)
@@ -270,13 +270,11 @@
 
 String FontFace::family() const
 {
-    const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
     return m_backing->families()->cssText();
 }
 
 String FontFace::style() const
 {
-    const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
     switch (m_backing->traitsMask() & FontStyleMask) {
     case FontStyleNormalMask:
         return String("normal", String::ConstructFromLiteral);
@@ -289,7 +287,6 @@
 
 String FontFace::weight() const
 {
-    const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
     switch (m_backing->traitsMask() & FontWeightMask) {
     case FontWeight100Mask:
         return String("100", String::ConstructFromLiteral);
@@ -321,7 +318,6 @@
 
 String FontFace::unicodeRange() const
 {
-    const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
     if (!m_backing->ranges().size())
         return "U+0-10FFFF";
     RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
@@ -332,13 +328,11 @@
 
 String FontFace::variant() const
 {
-    const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
     return computeFontVariant(m_backing->variantSettings())->cssText();
 }
 
 String FontFace::featureSettings() const
 {
-    const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
     if (!m_backing->featureSettings().size())
         return "normal";
     RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
@@ -365,15 +359,6 @@
     return LoadStatus::Error;
 }
 
-void FontFace::adopt(CSSFontFace& newFace)
-{
-    m_promise = Nullopt;
-    m_backing->removeClient(*this);
-    m_backing = newFace;
-    m_backing->addClient(*this);
-    newFace.setWrapper(*this);
-}
-
 void FontFace::fontStateChanged(CSSFontFace& face, CSSFontFace::Status, CSSFontFace::Status newState)
 {
     ASSERT_UNUSED(face, &face == m_backing.ptr());

Modified: trunk/Source/WebCore/css/FontFace.h (201905 => 201906)


--- trunk/Source/WebCore/css/FontFace.h	2016-06-10 05:17:48 UTC (rev 201905)
+++ trunk/Source/WebCore/css/FontFace.h	2016-06-10 05:24:46 UTC (rev 201906)
@@ -69,8 +69,6 @@
     Optional<Promise>& promise() { return m_promise; }
     void registerLoaded(Promise&&);
 
-    void adopt(CSSFontFace&);
-
     void load();
 
     CSSFontFace& backing() { return m_backing; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to