Title: [184911] branches/safari-601.1.32-branch

Diff

Modified: branches/safari-601.1.32-branch/LayoutTests/ChangeLog (184910 => 184911)


--- branches/safari-601.1.32-branch/LayoutTests/ChangeLog	2015-05-27 18:37:28 UTC (rev 184910)
+++ branches/safari-601.1.32-branch/LayoutTests/ChangeLog	2015-05-27 18:39:07 UTC (rev 184911)
@@ -1,5 +1,9 @@
 2015-05-27  Matthew Hanson  <[email protected]>
 
+        Roll out r184894. rdar://problem/21097484
+
+2015-05-27  Matthew Hanson  <[email protected]>
+
         Merge r184894. rdar://problem/21097484
 
     2015-05-26  Andreas Kling  <[email protected]>

Deleted: branches/safari-601.1.32-branch/LayoutTests/fast/dom/HTMLFontElement/face-attribute-expected.txt (184910 => 184911)


--- branches/safari-601.1.32-branch/LayoutTests/fast/dom/HTMLFontElement/face-attribute-expected.txt	2015-05-27 18:37:28 UTC (rev 184910)
+++ branches/safari-601.1.32-branch/LayoutTests/fast/dom/HTMLFontElement/face-attribute-expected.txt	2015-05-27 18:39:07 UTC (rev 184911)
@@ -1,37 +0,0 @@
-HTMLFontElement face attribute test
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS fontFaceAttributeEffect("") is null
-PASS fontFaceAttributeEffect(" ") is null
-PASS fontFaceAttributeEffect(",") is null
-PASS fontFaceAttributeEffect(" ,") is null
-PASS fontFaceAttributeEffect(" , ") is null
-PASS fontFaceAttributeEffect(",,") is null
-PASS fontFaceAttributeEffect("serif") is "serif"
-PASS fontFaceAttributeEffect("serif ") is "serif"
-PASS fontFaceAttributeEffect(",serif,") is null
-PASS fontFaceAttributeEffect(" serif ") is "serif"
-PASS fontFaceAttributeEffect(" serif") is "serif"
-PASS fontFaceAttributeEffect("serif ,") is null
-PASS fontFaceAttributeEffect("serif , ") is null
-PASS fontFaceAttributeEffect("serif,,") is null
-PASS fontFaceAttributeEffect("Serif") is "serif"
-PASS fontFaceAttributeEffect(" Serif") is "serif"
-PASS fontFaceAttributeEffect(" Serif ") is "serif"
-PASS fontFaceAttributeEffect(",Serif ") is null
-PASS fontFaceAttributeEffect("Inherited") is "Inherited"
-PASS fontFaceAttributeEffect("Initial") is "Initial"
-PASS fontFaceAttributeEffect("foo + foo") is "'foo + foo'"
-PASS fontFaceAttributeEffect(" foo + foo") is "'foo + foo'"
-PASS fontFaceAttributeEffect(" foo + foo ") is "'foo + foo'"
-PASS fontFaceAttributeEffect("foo + foo ") is "'foo + foo'"
-PASS fontFaceAttributeEffect("foo + foo,serif") is "'foo + foo', serif"
-PASS fontFaceAttributeEffect("serif,foo + foo,serif") is "serif, 'foo + foo', serif"
-PASS fontFaceAttributeEffect(",foo + foo,serif") is null
-PASS fontFaceAttributeEffect("serif,foo + foo,") is null
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: branches/safari-601.1.32-branch/LayoutTests/fast/dom/HTMLFontElement/face-attribute.html (184910 => 184911)


--- branches/safari-601.1.32-branch/LayoutTests/fast/dom/HTMLFontElement/face-attribute.html	2015-05-27 18:37:28 UTC (rev 184910)
+++ branches/safari-601.1.32-branch/LayoutTests/fast/dom/HTMLFontElement/face-attribute.html	2015-05-27 18:39:07 UTC (rev 184911)
@@ -1,63 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src=""
-</head>
-<body>
-<script>
-
-description("HTMLFontElement face attribute test");
-
-function fontFaceAttributeEffect(value)
-{
-    var element = document.createElement("font");
-    element.setAttribute("face", value);
-    var outerElement = document.createElement("p");
-    outerElement.setAttribute("style", "font-family: whatever");
-    document.body.appendChild(outerElement);
-    outerElement.appendChild(element);
-    var computedStyle = getComputedStyle(element, "");
-    var result = computedStyle.fontFamily;
-    document.body.removeChild(outerElement);
-    return result === "whatever" ? null : result;
-}
-
-shouldBe('fontFaceAttributeEffect("")', 'null');
-shouldBe('fontFaceAttributeEffect(" ")', 'null');
-shouldBe('fontFaceAttributeEffect(",")', 'null');
-shouldBe('fontFaceAttributeEffect(" ,")', 'null');
-shouldBe('fontFaceAttributeEffect(" , ")', 'null');
-shouldBe('fontFaceAttributeEffect(",,")', 'null');
-
-shouldBe('fontFaceAttributeEffect("serif")', '"serif"');
-shouldBe('fontFaceAttributeEffect("serif ")', '"serif"');
-shouldBe('fontFaceAttributeEffect(",serif,")', 'null');
-shouldBe('fontFaceAttributeEffect(" serif ")', '"serif"');
-shouldBe('fontFaceAttributeEffect(" serif")', '"serif"');
-shouldBe('fontFaceAttributeEffect("serif ,")', 'null');
-shouldBe('fontFaceAttributeEffect("serif , ")', 'null');
-shouldBe('fontFaceAttributeEffect("serif,,")', 'null');
-
-shouldBe('fontFaceAttributeEffect("Serif")', '"serif"');
-shouldBe('fontFaceAttributeEffect(" Serif")', '"serif"');
-shouldBe('fontFaceAttributeEffect(" Serif ")', '"serif"');
-shouldBe('fontFaceAttributeEffect(",Serif ")', 'null');
-
-shouldBe('fontFaceAttributeEffect("Inherited")', '"Inherited"');
-shouldBe('fontFaceAttributeEffect("Initial")', '"Initial"');
-
-shouldBe('fontFaceAttributeEffect("foo + foo")', '"\'foo + foo\'"');
-shouldBe('fontFaceAttributeEffect(" foo + foo")', '"\'foo + foo\'"');
-shouldBe('fontFaceAttributeEffect(" foo + foo ")', '"\'foo + foo\'"');
-shouldBe('fontFaceAttributeEffect("foo + foo ")', '"\'foo + foo\'"');
-
-shouldBe('fontFaceAttributeEffect("foo + foo,serif")', '"\'foo + foo\', serif"');
-shouldBe('fontFaceAttributeEffect("serif,foo + foo,serif")', '"serif, \'foo + foo\', serif"');
-shouldBe('fontFaceAttributeEffect(",foo + foo,serif")', 'null');
-shouldBe('fontFaceAttributeEffect("serif,foo + foo,")', 'null');
-
-</script>
-<script src=""
-</body>
-</html>

Modified: branches/safari-601.1.32-branch/Source/WebCore/ChangeLog (184910 => 184911)


--- branches/safari-601.1.32-branch/Source/WebCore/ChangeLog	2015-05-27 18:37:28 UTC (rev 184910)
+++ branches/safari-601.1.32-branch/Source/WebCore/ChangeLog	2015-05-27 18:39:07 UTC (rev 184911)
@@ -1,5 +1,9 @@
 2015-05-27  Matthew Hanson  <[email protected]>
 
+        Roll out r184894. rdar://problem/21097484
+
+2015-05-27  Matthew Hanson  <[email protected]>
+
         Merge r184894. rdar://problem/21097484
 
     2015-05-26  Andreas Kling  <[email protected]>

Modified: branches/safari-601.1.32-branch/Source/WebCore/css/CSSParser.cpp (184910 => 184911)


--- branches/safari-601.1.32-branch/Source/WebCore/css/CSSParser.cpp	2015-05-27 18:37:28 UTC (rev 184910)
+++ branches/safari-601.1.32-branch/Source/WebCore/css/CSSParser.cpp	2015-05-27 18:39:07 UTC (rev 184911)
@@ -1282,30 +1282,15 @@
 {
     if (string.isEmpty())
         return nullptr;
+    RefPtr<MutableStyleProperties> dummyStyle = MutableStyleProperties::create();
 
-    Ref<CSSValueList> valueList = CSSValueList::createCommaSeparated();
+    if (parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, false, CSSQuirksMode, nullptr) == ParseResult::Error)
+        return nullptr;
 
-    Vector<String> familyNames;
-    string.string().split(',', true, familyNames);
-
-    for (auto& familyName : familyNames) {
-        String stripped = stripLeadingAndTrailingHTMLSpaces(familyName);
-        if (stripped.isEmpty())
-            return nullptr;
-
-        RefPtr<CSSValue> value;
-        for (auto propertyID : { CSSValueSerif, CSSValueSansSerif, CSSValueCursive, CSSValueFantasy, CSSValueMonospace, CSSValueWebkitBody }) {
-            if (equalIgnoringCase(stripped, getValueName(propertyID))) {
-                value = cssValuePool().createIdentifierValue(propertyID);
-                break;
-            }
-        }
-        if (!value)
-            value = cssValuePool().createFontFamilyValue(stripped);
-        valueList->append(value.releaseNonNull());
-    }
-
-    return WTF::move(valueList);
+    RefPtr<CSSValue> fontFamily = dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily);
+    if (!fontFamily->isValueList())
+        return nullptr; // FIXME: "initial" and "inherit" should be parsed as font names in the face attribute.
+    return static_pointer_cast<CSSValueList>(fontFamily.release());
 }
 
 CSSParser::ParseResult CSSParser::parseValue(MutableStyleProperties* declaration, CSSPropertyID propertyID, const String& string, bool important, CSSParserMode cssParserMode, StyleSheetContents* contextStyleSheet)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to