Reviewed by Hyatt.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jun 2007 08:04:55 +0000 (08:04 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jun 2007 08:04:55 +0000 (08:04 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=6170
        CSS1: Properties for :first-letter aren't recalculated on color change

        Mark styles with first-letter as unique.

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

LayoutTests/ChangeLog
LayoutTests/fast/css/first-letter-recalculation-expected.checksum [new file with mode: 0644]
LayoutTests/fast/css/first-letter-recalculation-expected.png [new file with mode: 0644]
LayoutTests/fast/css/first-letter-recalculation-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/first-letter-recalculation.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/cssstyleselector.cpp

index 842ffa9..5724e25 100644 (file)
@@ -1,3 +1,16 @@
+2007-06-04  Rob Buis  <buis@kde.org>
+
+        Reviewed by Hyatt.
+
+        Test for:
+        http://bugs.webkit.org/show_bug.cgi?id=6170
+        CSS1: Properties for :first-letter aren't recalculated on color change
+
+        * fast/css/first-letter-recalculation-expected.checksum: Added.
+        * fast/css/first-letter-recalculation-expected.png: Added.
+        * fast/css/first-letter-recalculation-expected.txt: Added.
+        * fast/css/first-letter-recalculation.html: Added.
+
 2007-05-31  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Adam.
diff --git a/LayoutTests/fast/css/first-letter-recalculation-expected.checksum b/LayoutTests/fast/css/first-letter-recalculation-expected.checksum
new file mode 100644 (file)
index 0000000..8565bbb
--- /dev/null
@@ -0,0 +1 @@
+7d20283324bd4e8955998b33361157a1
\ No newline at end of file
diff --git a/LayoutTests/fast/css/first-letter-recalculation-expected.png b/LayoutTests/fast/css/first-letter-recalculation-expected.png
new file mode 100644 (file)
index 0000000..a2ed024
Binary files /dev/null and b/LayoutTests/fast/css/first-letter-recalculation-expected.png differ
diff --git a/LayoutTests/fast/css/first-letter-recalculation-expected.txt b/LayoutTests/fast/css/first-letter-recalculation-expected.txt
new file mode 100644 (file)
index 0000000..9fd32ba
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x84
+  RenderBlock {HTML} at (0,0) size 800x84
+    RenderBody {BODY} at (8,16) size 784x52
+      RenderBlock {P} at (0,0) size 784x18
+        RenderInline {A} at (0,0) size 29x18 [color=#0000FF]
+          RenderInline (generated) at (0,0) size 10x18
+            RenderText {#text} at (0,0) size 10x18
+              text run at (0,0) width 10: "F"
+          RenderText {#text} at (10,0) size 19x18
+            text run at (10,0) width 19: "irst"
+        RenderText {#text} at (29,0) size 190x18
+          text run at (29,0) width 190: " letter should be bold and blue"
+      RenderBlock {P} at (0,34) size 784x18
+        RenderInline (generated) at (0,0) size 12x18
+          RenderText {#text} at (0,0) size 12x18
+            text run at (0,0) width 12: "H"
+        RenderText {#text} at (12,0) size 616x18
+          text run at (12,0) width 616: "ere the first letter should be bold and black, but with Safari build 416.13 it is blue. See bug #6170."
diff --git a/LayoutTests/fast/css/first-letter-recalculation.html b/LayoutTests/fast/css/first-letter-recalculation.html
new file mode 100644 (file)
index 0000000..d94e093
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS 2.1 Test Suite: Testing first letter styles</title>
+  <link rel="help" href="http://www.w3.org/TR/CSS21/...#..."/>
+  <style type="text/css">
+   a
+{
+    color: blue;
+}
+
+p:first-letter
+{
+    font-weight: bold;
+}
+  </style>
+ </head>
+ <body>
+  <p><a href="test.html">First</a> letter should be bold and blue</p>
+  <p>Here the first letter should be bold and black, but with Safari build 416.13 it is blue. See bug #6170.</p>
+ </body>
+</html>
index e2f9de0..4c6a168 100644 (file)
@@ -1,3 +1,15 @@
+2007-06-04  Rob Buis  <buis@kde.org>
+
+        Reviewed by Hyatt.
+
+        http://bugs.webkit.org/show_bug.cgi?id=6170
+        CSS1: Properties for :first-letter aren't recalculated on color change
+
+        Mark styles with first-letter as unique.
+
+        * css/cssstyleselector.cpp:
+        (WebCore::CSSStyleSelector::styleForElement):
+
 2007-06-01  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by David Harrison.
index d187fc4..3182ddb 100644 (file)
@@ -918,6 +918,10 @@ RenderStyle* CSSStyleSelector::styleForElement(Element* e, RenderStyle* defaultP
     if (e->isLink())
         style->setPseudoState(pseudoState);
 
+    // If we have first-letter pseudo style, do not share this style
+    if (style->hasPseudoStyle(RenderStyle::FIRST_LETTER))
+        style->setUnique();
+
     // Now return the style.
     return style;
 }