WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2007 07:04:30 +0000 (07:04 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2007 07:04:30 +0000 (07:04 +0000)
        Reviewed by Oliver Hunt.

        - fix <rdar://problem/5074620> text with font:initial; fails to appear (causes fast/text/font-initial.html to fail)

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::applyProperty): When the font property is
        set to 'initial', set the font size to its initial value, 'medium',
        and the font family to the standard family.

LayoutTests:

        Reviewed by Oliver Hunt.

        - updated results and skipped tests file for
          <rdar://problem/5074620> text with font:initial; fails to appear (causes fast/text/font-initial.html to fail)

        * platform/mac-leopard/fast/text/font-initial-expected.checksum: Copied from LayoutTests/platform/mac/fast/text/font-initial-expected.checksum.
        * platform/mac-leopard/fast/text/font-initial-expected.png: Copied from LayoutTests/platform/mac/fast/text/font-initial-expected.png.
        * platform/mac/fast/text/font-initial-expected.checksum: Removed.
        * platform/mac/fast/text/font-initial-expected.png: Removed.
        * platform/mac/fast/text/font-initial-expected.txt:
        * platform/win/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28671 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-leopard/fast/text/font-initial-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/text/font-initial-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/font-initial-expected.checksum [deleted file]
LayoutTests/platform/mac/fast/text/font-initial-expected.png [deleted file]
LayoutTests/platform/mac/fast/text/font-initial-expected.txt
LayoutTests/platform/win/Skipped
WebCore/ChangeLog
WebCore/css/CSSStyleSelector.cpp

index 24a97993e72f0a2953f1c79500e355c04ab42b0b..37b4b1bd13d917c135fb6485ea548f3a5840fbc6 100644 (file)
@@ -1,3 +1,17 @@
+2007-12-12  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        - updated results and skipped tests file for
+          <rdar://problem/5074620> text with font:initial; fails to appear (causes fast/text/font-initial.html to fail)
+
+        * platform/mac-leopard/fast/text/font-initial-expected.checksum: Copied from LayoutTests/platform/mac/fast/text/font-initial-expected.checksum.
+        * platform/mac-leopard/fast/text/font-initial-expected.png: Copied from LayoutTests/platform/mac/fast/text/font-initial-expected.png.
+        * platform/mac/fast/text/font-initial-expected.checksum: Removed.
+        * platform/mac/fast/text/font-initial-expected.png: Removed.
+        * platform/mac/fast/text/font-initial-expected.txt:
+        * platform/win/Skipped:
+
 2007-12-12  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/platform/mac-leopard/fast/text/font-initial-expected.checksum b/LayoutTests/platform/mac-leopard/fast/text/font-initial-expected.checksum
new file mode 100644 (file)
index 0000000..27ea1b8
--- /dev/null
@@ -0,0 +1 @@
+e0963738ee2234b4bcc8a4ccbc8ed628
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/fast/text/font-initial-expected.png b/LayoutTests/platform/mac-leopard/fast/text/font-initial-expected.png
new file mode 100644 (file)
index 0000000..17225a4
Binary files /dev/null and b/LayoutTests/platform/mac-leopard/fast/text/font-initial-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/text/font-initial-expected.checksum b/LayoutTests/platform/mac/fast/text/font-initial-expected.checksum
deleted file mode 100644 (file)
index 470a598..0000000
+++ /dev/null
@@ -1 +0,0 @@
-3d0e669d85afdb5d41be12ad3ca34834
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/text/font-initial-expected.png b/LayoutTests/platform/mac/fast/text/font-initial-expected.png
deleted file mode 100644 (file)
index 34f2722..0000000
Binary files a/LayoutTests/platform/mac/fast/text/font-initial-expected.png and /dev/null differ
index 9afd4f39ae1acc06bbe5d2431aa041589ecb6fdd..7ece91e3449d185f106d4cffd37973e89b0fe15f 100644 (file)
@@ -15,9 +15,9 @@ layer at (0,0) size 800x600
             text run at (358,0) width 315: "Assertion failure in WebCore::Font::primaryFont"
         RenderText {#text} at (673,0) size 4x18
           text run at (673,0) width 4: "."
-      RenderBlock (anonymous) at (0,34) size 784x14
-        RenderInline {SPAN} at (0,0) size 30x14
-          RenderText {#text} at (0,0) size 30x14
-            text run at (0,0) width 30: "PASS"
+      RenderBlock (anonymous) at (0,34) size 784x18
+        RenderInline {SPAN} at (0,0) size 39x18
+          RenderText {#text} at (0,0) size 39x18
+            text run at (0,0) width 39: "PASS"
         RenderText {#text} at (0,0) size 0x0
         RenderText {#text} at (0,0) size 0x0
index a6da0a3bd9548a936009ecc091c5f54f9a182c4f..e35cb9947facf3767733e4c775c881094e3c3435 100644 (file)
@@ -59,7 +59,6 @@ fast/forms/select-writing-direction-natural.html
 fast/forms/visual-hebrew-text-field.html
 fast/lists/drag-into-marker.html
 fast/lists/w3-list-styles.html
-fast/text/font-initial.html
 fast/text/international/bidi-neutral-run.html
 fast/xsl/xslt-text.xml
 svg/W3C-SVG-1.1/animate-elem-03-t.svg
index 373845a6fe2334180bca2ff744a58f5a880e4a7f..3d3cca27cd5972b6b08ff5e8ed9287e19ecdab18 100644 (file)
@@ -1,3 +1,14 @@
+2007-12-12  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        - fix <rdar://problem/5074620> text with font:initial; fails to appear (causes fast/text/font-initial.html to fail)
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty): When the font property is
+        set to 'initial', set the font size to its initial value, 'medium',
+        and the font family to the standard family.
+
 2007-12-12  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Darin Adler.
index 777b7a4d952a2235af1d2bdf0e9ff1a6201ebef3..3e77151f28fb77cffbdd855272a2585ac14d9650 100644 (file)
@@ -3341,6 +3341,13 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
         } else if (isInitial) {
             FontDescription fontDescription;
             fontDescription.setGenericFamily(FontDescription::StandardFamily);
+            const AtomicString& standardFontFamily = m_document->settings()->standardFontFamily();
+            if (!standardFontFamily.isEmpty()) {
+                fontDescription.firstFamily().setFamily(standardFontFamily);
+                fontDescription.firstFamily().appendFamily(0);
+            }
+            fontDescription.setKeywordSize(CSS_VAL_MEDIUM - CSS_VAL_XX_SMALL + 1);
+            setFontSize(fontDescription, fontSizeForKeyword(CSS_VAL_MEDIUM, style->htmlHacks(), false));
             style->setLineHeight(RenderStyle::initialLineHeight());
             m_lineHeightValue = 0;
             if (style->setFontDescription(fontDescription))