WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Dec 2007 01:48:50 +0000 (01:48 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Dec 2007 01:48:50 +0000 (01:48 +0000)
        Reviewed by Sam Weinig.

        - fix http://bugs.webkit.org/show_bug.cgi?id=16348
          @font-face does not affect the default style

        Test: fast/css/font-face-default-font.html

        * dom/Document.cpp:
        (WebCore::Document::recalcStyle): Pass our font selector to
        Font::update() if we already have one.

LayoutTests:

        Reviewed by Sam Weinig.

        - test for http://bugs.webkit.org/show_bug.cgi?id=16348
          @font-face does not affect the default style

        * fast/css/font-face-default-font.html: Added.
        * platform/mac-leopard/fast/css: Added.
        * platform/mac-leopard/fast/css/font-face-default-font-expected.checksum: Added.
        * platform/mac-leopard/fast/css/font-face-default-font-expected.png: Added.
        * platform/mac/fast/css/font-face-default-font-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/css/font-face-default-font.html [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/css/font-face-default-font-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/css/font-face-default-font-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/font-face-default-font-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Document.cpp

index 30556cc..4f626f7 100644 (file)
@@ -1,3 +1,16 @@
+2007-12-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=16348
+          @font-face does not affect the default style
+
+        * fast/css/font-face-default-font.html: Added.
+        * platform/mac-leopard/fast/css: Added.
+        * platform/mac-leopard/fast/css/font-face-default-font-expected.checksum: Added.
+        * platform/mac-leopard/fast/css/font-face-default-font-expected.png: Added.
+        * platform/mac/fast/css/font-face-default-font-expected.txt: Added.
+
 2007-12-07  Darin Adler  <darin@apple.com>
 
         Reviewed by Adele.
diff --git a/LayoutTests/fast/css/font-face-default-font.html b/LayoutTests/fast/css/font-face-default-font.html
new file mode 100644 (file)
index 0000000..369680a
--- /dev/null
@@ -0,0 +1,17 @@
+<html>
+<head>
+    <style>
+        @font-face {
+            font-family: Times;
+            src: local("Arial");
+        }
+    </style>
+</head>
+<body>
+    <p>
+        Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=16348">http://bugs.webkit.org/show_bug.cgi?id=16348</a>
+        @font-face does not affect the default style</i>.
+    </p>
+    This text should be in Arial.
+</body>
+</html>
diff --git a/LayoutTests/platform/mac-leopard/fast/css/font-face-default-font-expected.checksum b/LayoutTests/platform/mac-leopard/fast/css/font-face-default-font-expected.checksum
new file mode 100644 (file)
index 0000000..55cadc5
--- /dev/null
@@ -0,0 +1 @@
+207d880b3dca0deef01a4339054c9151
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/fast/css/font-face-default-font-expected.png b/LayoutTests/platform/mac-leopard/fast/css/font-face-default-font-expected.png
new file mode 100644 (file)
index 0000000..5fb7475
Binary files /dev/null and b/LayoutTests/platform/mac-leopard/fast/css/font-face-default-font-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/font-face-default-font-expected.txt b/LayoutTests/platform/mac/fast/css/font-face-default-font-expected.txt
new file mode 100644 (file)
index 0000000..8895d0c
--- /dev/null
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 57x17
+          text run at (0,0) width 57: "Test for "
+        RenderInline {I} at (0,0) size 632x17
+          RenderInline {A} at (0,0) size 329x17 [color=#0000EE]
+            RenderText {#text} at (57,0) size 329x17
+              text run at (57,0) width 329: "http://bugs.webkit.org/show_bug.cgi?id=16348"
+          RenderText {#text} at (386,0) size 303x17
+            text run at (386,0) width 4: " "
+            text run at (390,0) width 299: "@font-face does not affect the default style"
+        RenderText {#text} at (689,0) size 4x17
+          text run at (689,0) width 4: "."
+      RenderBlock (anonymous) at (0,34) size 784x18
+        RenderText {#text} at (0,0) size 192x17
+          text run at (0,0) width 192: "This text should be in Arial."
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
index cae8f0b..254684c 100644 (file)
@@ -1,3 +1,16 @@
+2007-12-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=16348
+          @font-face does not affect the default style
+
+        Test: fast/css/font-face-default-font.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::recalcStyle): Pass our font selector to
+        Font::update() if we already have one.
+
 2007-12-07  Darin Adler  <darin@apple.com>
 
         - fix Windows build
index 4f66672..1cc5e60 100644 (file)
@@ -1083,7 +1083,7 @@ void Document::recalcStyle(StyleChange change)
         }
 
         _style->setFontDescription(fontDescription);
-        _style->font().update(0);
+        _style->font().update(m_styleSelector->fontSelector());
         if (inCompatMode())
             _style->setHtmlHacks(true); // enable html specific rendering tricks