[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

eric at webkit.org eric at webkit.org
Fri Feb 26 22:23:39 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit b5e7d98d7b988b50ae375e02ddbb2ace3077ef48
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 18 05:14:59 2010 +0000

    2010-02-17  Yuzo Fujishima  <yuzo at google.com>
    
            Reviewed by Eric Seidel.
    
            In diffing render styles, consider all pseudo style changes.
            Without this patch, only :before and :after are considered. This is the cause of the following bug.
            https://bugs.webkit.org/show_bug.cgi?id=32187
    
            * fast/css/first-letter-first-line-hover.html: Added.
            * platform/mac/fast/css/first-letter-first-line-hover-expected.checksum: Added.
            * platform/mac/fast/css/first-letter-first-line-hover-expected.png: Added.
            * platform/mac/fast/css/first-letter-first-line-hover-expected.txt: Added.
    2010-02-17  Yuzo Fujishima  <yuzo at google.com>
    
            Reviewed by Eric Seidel.
    
            In diffing render styles, consider all pseudo style changes.
            Without this patch, only :before and :after are considered. This is the cause of the following bug.
            https://bugs.webkit.org/show_bug.cgi?id=32187
    
            Test: fast/css/first-letter-first-line-hover.html
    
            * dom/Node.cpp:
            (WebCore::Node::diff):
            * rendering/style/RenderStyle.cpp:
            (WebCore::RenderStyle::hasAnyPublicPseudoStyles):
            * rendering/style/RenderStyle.h:
            * rendering/style/RenderStyleConstants.h:
            (WebCore::):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7cbdec5..c31f093 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-17  Yuzo Fujishima  <yuzo at google.com>
+
+        Reviewed by Eric Seidel.
+
+        In diffing render styles, consider all pseudo style changes.
+        Without this patch, only :before and :after are considered. This is the cause of the following bug.
+        https://bugs.webkit.org/show_bug.cgi?id=32187
+
+        * fast/css/first-letter-first-line-hover.html: Added.
+        * platform/mac/fast/css/first-letter-first-line-hover-expected.checksum: Added.
+        * platform/mac/fast/css/first-letter-first-line-hover-expected.png: Added.
+        * platform/mac/fast/css/first-letter-first-line-hover-expected.txt: Added.
+
 2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/css/first-letter-first-line-hover.html b/LayoutTests/fast/css/first-letter-first-line-hover.html
new file mode 100644
index 0000000..9b96373
--- /dev/null
+++ b/LayoutTests/fast/css/first-letter-first-line-hover.html
@@ -0,0 +1,44 @@
+<html>
+<head>
+<title></title>
+<style type="text/css">
+* {
+    color:red;
+    font-size:48px;
+}
+.description {
+    color:black;
+    font-size:16px;
+}
+p:first-line {
+    color:green;
+}
+p:first-letter {
+    background-color:pink;
+}
+p:hover {
+  /* empty */
+}
+</style>
+
+<script type="text/javascript">
+function test()
+{
+    if (!window.eventSender)
+        return;
+    document.body.offsetTop; // Force layout. The mouse is not tracked before first layout.
+    eventSender.mouseMoveTo(24, 24); // Hover.
+    document.body.offsetTop; // Update layout for hovered state.
+}
+</script>
+
+</head>
+<body onload="test()">
+<p>
+ABCDEFG<br/>
+<span class="description">
+Hover over "A". It must stay green.
+</span>
+</p>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.checksum b/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.checksum
new file mode 100644
index 0000000..1bd4981
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.checksum
@@ -0,0 +1 @@
+9e02fc2e065df643a8a507394c13825c
diff --git a/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.png b/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.png
new file mode 100644
index 0000000..fb5e9ff
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.txt b/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.txt
new file mode 100644
index 0000000..98fcd54
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/first-letter-first-line-hover-expected.txt
@@ -0,0 +1,16 @@
+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 [color=#FF0000]
+    RenderBody {BODY} at (8,8) size 784x544
+      RenderBlock {P} at (0,0) size 784x73
+        RenderInline (generated) at (0,0) size 35x55 [color=#008000] [bgcolor=#FFC0CB]
+          RenderText {#text} at (0,0) size 35x55
+            text run at (0,0) width 35: "A"
+        RenderText {#text} at (35,0) size 190x55
+          text run at (35,0) width 190: "BCDEFG"
+        RenderBR {BR} at (225,43) size 0x0
+        RenderInline {SPAN} at (0,0) size 225x18 [color=#000000]
+          RenderText {#text} at (0,55) size 225x18
+            text run at (0,55) width 225: "Hover over \"A\". It must stay green."
+        RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b9dd09a..8a7a950 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-02-17  Yuzo Fujishima  <yuzo at google.com>
+
+        Reviewed by Eric Seidel.
+
+        In diffing render styles, consider all pseudo style changes.
+        Without this patch, only :before and :after are considered. This is the cause of the following bug.
+        https://bugs.webkit.org/show_bug.cgi?id=32187
+
+        Test: fast/css/first-letter-first-line-hover.html
+
+        * dom/Node.cpp:
+        (WebCore::Node::diff):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::hasAnyPublicPseudoStyles):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/RenderStyleConstants.h:
+        (WebCore::):
+
 2010-02-17  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 1baca9f..b897177 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -313,25 +313,20 @@ Node::StyleChange Node::diff(const RenderStyle* s1, const RenderStyle* s2)
 
     // If the pseudoStyles have changed, we want any StyleChange that is not NoChange
     // because setStyle will do the right thing with anything else.
-    if (ch == NoChange && s1->hasPseudoStyle(BEFORE)) {
-        RenderStyle* ps2 = s2->getCachedPseudoStyle(BEFORE);
-        if (!ps2)
-            ch = NoInherit;
-        else {
-            RenderStyle* ps1 = s1->getCachedPseudoStyle(BEFORE);
-            ch = ps1 && *ps1 == *ps2 ? NoChange : NoInherit;
-        }
-    }
-    if (ch == NoChange && s1->hasPseudoStyle(AFTER)) {
-        RenderStyle* ps2 = s2->getCachedPseudoStyle(AFTER);
-        if (!ps2)
-            ch = NoInherit;
-        else {
-            RenderStyle* ps1 = s1->getCachedPseudoStyle(AFTER);
-            ch = ps2 && *ps1 == *ps2 ? NoChange : NoInherit;
+    if (ch == NoChange && s1->hasAnyPublicPseudoStyles()) {
+        for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; ch == NoChange && pseudoId < FIRST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
+            if (s1->hasPseudoStyle(pseudoId)) {
+                RenderStyle* ps2 = s2->getCachedPseudoStyle(pseudoId);
+                if (!ps2)
+                    ch = NoInherit;
+                else {
+                    RenderStyle* ps1 = s1->getCachedPseudoStyle(pseudoId);
+                    ch = ps1 && *ps1 == *ps2 ? NoChange : NoInherit;
+                }
+            }
         }
     }
-    
+
     return ch;
 }
 
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index 0952557..712344f 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -192,6 +192,11 @@ static inline int pseudoBit(PseudoId pseudo)
     return 1 << (pseudo - 1);
 }
 
+bool RenderStyle::hasAnyPublicPseudoStyles() const
+{
+    return PUBLIC_PSEUDOID_MASK & noninherited_flags._pseudoBits;
+}
+
 bool RenderStyle::hasPseudoStyle(PseudoId pseudo) const
 {
     ASSERT(pseudo > NOPSEUDO);
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 5a60dea..6ec0534 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -350,6 +350,7 @@ public:
 
     bool isStyleAvailable() const;
 
+    bool hasAnyPublicPseudoStyles() const;
     bool hasPseudoStyle(PseudoId pseudo) const;
     void setHasPseudoStyle(PseudoId pseudo);
 
diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h
index 01862f6..4abbc1c 100644
--- a/WebCore/rendering/style/RenderStyleConstants.h
+++ b/WebCore/rendering/style/RenderStyleConstants.h
@@ -66,6 +66,7 @@ enum StyleDifferenceContextSensitiveProperty {
 
 // Static pseudo styles. Dynamic ones are produced on the fly.
 enum PseudoId {
+    // The order must be NOP ID, public IDs, and then internal IDs.
     NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, FILE_UPLOAD_BUTTON, INPUT_PLACEHOLDER,
     SLIDER_THUMB, SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL,
     MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIMELINE_CONTAINER,
@@ -75,7 +76,9 @@ enum PseudoId {
     MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
     INPUT_LIST_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON,
 
-    FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON
+    FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
+    FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON,
+    PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1)
 };
 
 // These have been defined in the order of their precedence for border-collapsing. Do

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list