Changeset 97596 in webkit


Ignore:
Timestamp:
Oct 17, 2011, 2:15:12 AM (13 years ago)
Author:
Antti Koivisto
Message:

Test :visited pseudo class
https://bugs.webkit.org/show_bug.cgi?id=70219

Source/WebCore:

Reviewed by Andreas Kling.

Currently DRT doesn't support :visited. All tests where it should match have wrong checked in results.

  • Make <a href=""> to match :visited in DRT. It already does on browsers. A number of existing tests for :visited use it already, the rest can be modified to use it.
  • Make render tree dumps correctly dump the visited state dependent color.
  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::determineLinkStateSlowCase):

  • rendering/RenderTreeAsText.cpp:

(WebCore::RenderTreeAsText::writeRenderObject):

LayoutTests:

Reviewed by Andreas Kling.

Update Mac results for tests that already use <a href="">.

All other platforms need rebaselining too.

  • platform/mac/css2.1/t0511-c21-pseud-link-02-e-expected.txt:
  • platform/mac/css2.1/t0511-c21-pseud-link-03-e-expected.txt:
  • platform/mac/fast/dom/34176-expected.txt:
  • platform/mac/fast/events/reveal-link-when-focused-expected.txt:
  • platform/mac/fast/history/visited-link-background-color-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug26553-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug46623-1-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug51140-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug7342-expected.txt:
  • platform/mac/tables/mozilla/bugs/bug8950-expected.txt:
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r97595 r97596  
     12011-10-15  Antti Koivisto  <antti@apple.com>
     2
     3        Test :visited pseudo class
     4        https://bugs.webkit.org/show_bug.cgi?id=70219
     5
     6        Reviewed by Andreas Kling.
     7   
     8        Update Mac results for tests that already use <a href="">.
     9       
     10        All other platforms need rebaselining too.
     11
     12        * platform/mac/css2.1/t0511-c21-pseud-link-02-e-expected.txt:
     13        * platform/mac/css2.1/t0511-c21-pseud-link-03-e-expected.txt:
     14        * platform/mac/fast/dom/34176-expected.txt:
     15        * platform/mac/fast/events/reveal-link-when-focused-expected.txt:
     16        * platform/mac/fast/history/visited-link-background-color-expected.txt:
     17        * platform/mac/tables/mozilla/bugs/bug26553-expected.txt:
     18        * platform/mac/tables/mozilla/bugs/bug46623-1-expected.txt:
     19        * platform/mac/tables/mozilla/bugs/bug51140-expected.txt:
     20        * platform/mac/tables/mozilla/bugs/bug7342-expected.txt:
     21        * platform/mac/tables/mozilla/bugs/bug8950-expected.txt:
     22
    1232011-10-17  Kent Tamura  <tkent@chromium.org>
    224
  • trunk/LayoutTests/platform/mac/css2.1/t0511-c21-pseud-link-02-e-expected.txt

    r25970 r97596  
    55    RenderBody {BODY} at (8,16) size 784x18
    66      RenderBlock {P} at (0,0) size 784x18
    7         RenderInline {A} at (0,0) size 164x18 [color=#FF0000]
     7        RenderInline {A} at (0,0) size 164x18 [color=#008000]
    88          RenderText {#text} at (0,0) size 164x18
    99            text run at (0,0) width 164: "This link should be green."
  • trunk/LayoutTests/platform/mac/css2.1/t0511-c21-pseud-link-03-e-expected.txt

    r25970 r97596  
    55    RenderBody {BODY} at (8,16) size 784x18
    66      RenderBlock {P} at (0,0) size 784x18
    7         RenderInline {A} at (0,0) size 164x18 [color=#FF0000]
     7        RenderInline {A} at (0,0) size 164x18 [color=#008000]
    88          RenderText {#text} at (0,0) size 164x18
    99            text run at (0,0) width 164: "This link should be green."
  • trunk/LayoutTests/platform/mac/fast/dom/34176-expected.txt

    r78897 r97596  
    217217            text run at (680,6) width 60: "This is a "
    218218          RenderInline {SPAN} at (0,0) size 109x18
    219             RenderInline {A} at (0,0) size 109x18 [color=#0000EE]
     219            RenderInline {A} at (0,0) size 109x18 [color=#551A8B]
    220220              RenderText {#text} at (740,6) size 29x18
    221221                text run at (740,6) width 29: "Test"
     
    226226            text run at (680,1) width 60: "This is a "
    227227          RenderInline {SPAN} at (0,0) size 122x18
    228             RenderInline {A} at (0,0) size 122x18 [color=#0000EE]
     228            RenderInline {A} at (0,0) size 122x18 [color=#551A8B]
    229229              RenderText {#text} at (676,1) size 93x18
    230230                text run at (676,1) width 4 RTL: " "
     
    240240              RenderText {#text} at (742,0) size 27x18
    241241                text run at (742,0) width 27: "Test"
    242               RenderInline {A} at (0,0) size 0x18 [color=#0000EE]
     242              RenderInline {A} at (0,0) size 0x18 [color=#551A8B]
    243243        RenderBlock {DIV} at (0,113) size 769x24 [bgcolor=#FF0000]
    244244          RenderText {#text} at (682,6) size 60x18
     
    254254            text run at (639,0) width 60: "This is a "
    255255          RenderInline {SPAN} at (0,0) size 70x18
    256             RenderInline {A} at (0,0) size 70x18 [color=#0000EE]
     256            RenderInline {A} at (0,0) size 70x18 [color=#551A8B]
    257257              RenderText {#text} at (699,0) size 33x18
    258258                text run at (699,0) width 33: "Test "
  • trunk/LayoutTests/platform/mac/fast/events/reveal-link-when-focused-expected.txt

    r63403 r97596  
    88          text run at (0,0) width 331: "padding to make link be initially scrolled out of sight"
    99      RenderBlock (anonymous) at (0,2000) size 769x18
    10         RenderInline {A} at (0,0) size 355x18 [color=#0000EE]
     10        RenderInline {A} at (0,0) size 355x18 [color=#551A8B]
    1111          RenderText {#text} at (0,0) size 355x18
    1212            text run at (0,0) width 355: "this link should be focused and revealed after page loads"
  • trunk/LayoutTests/platform/mac/fast/history/visited-link-background-color-expected.txt

    r83087 r97596  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderBlock {A} at (0,0) size 500x500 [color=#0000EE] [bgcolor=#808000]
     6      RenderBlock {A} at (0,0) size 500x500 [color=#FFFFFF] [bgcolor=#808000]
    77        RenderText {#text} at (0,0) size 316x18
    88          text run at (0,0) width 316: "This text should be white on an olive background."
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug26553-expected.txt

    r78910 r97596  
    88          RenderTableRow {TR} at (0,2) size 782x126
    99            RenderTableCell {TD} at (2,2) size 183x126 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    10               RenderInline {A} at (0,0) size 181x18 [color=#0000EE]
     10              RenderInline {A} at (0,0) size 181x18 [color=#551A8B]
    1111                RenderImage {IMG} at (1,1) size 61x62
    1212                RenderImage {IMG} at (1,63) size 181x62
     
    1414              RenderImage {IMG} at (134,1) size 186x62
    1515            RenderTableCell {TD} at (642,33) size 138x64 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]
    16               RenderInline {A} at (0,0) size 0x0 [color=#0000EE]
     16              RenderInline {A} at (0,0) size 0x0 [color=#551A8B]
    1717                RenderImage {IMG} at (4,1) size 133x62
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug46623-1-expected.txt

    r30635 r97596  
    2020                      RenderInline {FONT} at (0,0) size 239x30
    2121                        RenderInline {B} at (0,0) size 149x15
    22                           RenderInline {A} at (0,0) size 149x15 [color=#0000EE]
     22                          RenderInline {A} at (0,0) size 149x15 [color=#551A8B]
    2323                            RenderText {#text} at (2,20) size 149x15
    2424                              text run at (2,20) width 33: "Click "
     
    2626                        RenderText {#text} at (151,20) size 73x15
    2727                          text run at (151,20) width 73: ", or copy this "
    28                         RenderInline {A} at (0,0) size 239x30 [color=#0000EE]
     28                        RenderInline {A} at (0,0) size 239x30 [color=#551A8B]
    2929                          RenderText {#text} at (224,20) size 239x30
    3030                            text run at (224,20) width 17: "list"
     
    3232                        RenderText {#text} at (67,35) size 40x15
    3333                          text run at (67,35) width 40: ".  View "
    34                         RenderInline {A} at (0,0) size 83x15 [color=#0000EE]
     34                        RenderInline {A} at (0,0) size 83x15 [color=#551A8B]
    3535                          RenderText {#text} at (107,35) size 83x15
    3636                            text run at (107,35) width 83: "Who is in MPG"
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug51140-expected.txt

    r81992 r97596  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBlock (anonymous) at (0,0) size 784x18
    7         RenderInline {A} at (0,0) size 27x18 [color=#0000EE]
     7        RenderInline {A} at (0,0) size 27x18 [color=#551A8B]
    88          RenderText {#text} at (0,0) size 27x18
    99            text run at (0,0) width 27: "note"
    1010        RenderText {#text} at (27,0) size 4x18
    1111          text run at (27,0) width 4: " "
    12         RenderInline {A} at (0,0) size 72x18 [color=#0000EE]
     12        RenderInline {A} at (0,0) size 72x18 [color=#551A8B]
    1313          RenderText {#text} at (31,0) size 72x18
    1414            text run at (31,0) width 72: "closepopup"
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug7342-expected.txt

    r54748 r97596  
    2222                      RenderTableRow {TR} at (0,2) size 114x27
    2323                        RenderTableCell {TD} at (2,3) size 110x24 [bgcolor=#CCCCCC] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    24                           RenderInline {A} at (0,0) size 61x18 [color=#000099]
     24                          RenderInline {A} at (0,0) size 61x18 [color=#660099]
    2525                            RenderInline {B} at (0,0) size 61x18
    2626                              RenderText {#text} at (3,3) size 61x18
     
    2929                      RenderTableRow {TR} at (0,31) size 114x27
    3030                        RenderTableCell {TD} at (2,32) size 110x24 [bgcolor=#FFFFFF] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
    31                           RenderInline {A} at (0,0) size 57x18 [color=#000099]
     31                          RenderInline {A} at (0,0) size 57x18 [color=#660099]
    3232                            RenderInline {B} at (0,0) size 57x18
    3333                              RenderText {#text} at (3,3) size 57x18
     
    3636                      RenderTableRow {TR} at (0,60) size 114x27
    3737                        RenderTableCell {TD} at (2,61) size 110x24 [bgcolor=#FFFFFF] [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1]
    38                           RenderInline {A} at (0,0) size 78x18 [color=#000099]
     38                          RenderInline {A} at (0,0) size 78x18 [color=#660099]
    3939                            RenderInline {B} at (0,0) size 78x18
    4040                              RenderText {#text} at (3,3) size 78x18
     
    4343                      RenderTableRow {TR} at (0,89) size 114x27
    4444                        RenderTableCell {TD} at (2,90) size 110x24 [bgcolor=#FFFFFF] [border: (1px inset #808080)] [r=3 c=0 rs=1 cs=1]
    45                           RenderInline {A} at (0,0) size 65x18 [color=#000099]
     45                          RenderInline {A} at (0,0) size 65x18 [color=#660099]
    4646                            RenderInline {B} at (0,0) size 65x18
    4747                              RenderText {#text} at (3,3) size 65x18
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug8950-expected.txt

    r78910 r97596  
    5050                                                    RenderTableRow {TR} at (0,2) size 271x22
    5151                                                      RenderTableCell {TD} at (2,2) size 144x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    52                                                         RenderInline {A} at (0,0) size 51x18 [color=#0000EE]
     52                                                        RenderInline {A} at (0,0) size 51x18 [color=#551A8B]
    5353                                                          RenderText {#text} at (2,2) size 51x18
    5454                                                            text run at (2,2) width 51: "Holiday"
    5555                                                      RenderTableCell {TD} at (148,2) size 121x22 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    56                                                         RenderInline {A} at (0,0) size 29x18 [color=#0000EE]
     56                                                        RenderInline {A} at (0,0) size 29x18 [color=#551A8B]
    5757                                                          RenderText {#text} at (2,2) size 29x18
    5858                                                            text run at (2,2) width 29: "Cars"
    5959                                                    RenderTableRow {TR} at (0,26) size 271x22
    6060                                                      RenderTableCell {TD} at (2,26) size 144x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
    61                                                         RenderInline {A} at (0,0) size 40x18 [color=#0000EE]
     61                                                        RenderInline {A} at (0,0) size 40x18 [color=#551A8B]
    6262                                                          RenderText {#text} at (2,2) size 40x18
    6363                                                            text run at (2,2) width 40: "Sports"
    6464                                                      RenderTableCell {TD} at (148,26) size 121x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
    65                                                         RenderInline {A} at (0,0) size 53x18 [color=#0000EE]
     65                                                        RenderInline {A} at (0,0) size 53x18 [color=#551A8B]
    6666                                                          RenderText {#text} at (2,2) size 53x18
    6767                                                            text run at (2,2) width 53: "Animals"
    6868                                                    RenderTableRow {TR} at (0,50) size 271x22
    6969                                                      RenderTableCell {TD} at (2,50) size 144x22 [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1]
    70                                                         RenderInline {A} at (0,0) size 69x18 [color=#0000EE]
     70                                                        RenderInline {A} at (0,0) size 69x18 [color=#551A8B]
    7171                                                          RenderText {#text} at (2,2) size 69x18
    7272                                                            text run at (2,2) width 69: "Computers"
    7373                                                      RenderTableCell {TD} at (148,50) size 121x22 [border: (1px inset #808080)] [r=2 c=1 rs=1 cs=1]
    74                                                         RenderInline {A} at (0,0) size 57x18 [color=#0000EE]
     74                                                        RenderInline {A} at (0,0) size 57x18 [color=#551A8B]
    7575                                                          RenderText {#text} at (2,2) size 57x18
    7676                                                            text run at (2,2) width 57: "Cartoons"
     
    116116                          RenderTableRow {TR} at (0,2) size 198x22
    117117                            RenderTableCell {TD} at (2,2) size 194x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    118                               RenderInline {A} at (0,0) size 51x18 [color=#0000EE]
     118                              RenderInline {A} at (0,0) size 51x18 [color=#551A8B]
    119119                                RenderText {#text} at (2,2) size 51x18
    120120                                  text run at (2,2) width 51: "Holiday"
  • trunk/Source/WebCore/ChangeLog

    r97594 r97596  
     12011-10-15  Antti Koivisto  <antti@apple.com>
     2
     3        Test :visited pseudo class
     4        https://bugs.webkit.org/show_bug.cgi?id=70219
     5
     6        Reviewed by Andreas Kling.
     7       
     8        Currently DRT doesn't support :visited. All tests where it should match have wrong checked in results.
     9       
     10        - Make <a href=""> to match :visited in DRT. It already does on browsers. A number of existing tests
     11          for :visited use it already, the rest can be modified to use it.
     12        - Make render tree dumps correctly dump the visited state dependent color.
     13
     14        * css/SelectorChecker.cpp:
     15        (WebCore::SelectorChecker::determineLinkStateSlowCase):
     16        * rendering/RenderTreeAsText.cpp:
     17        (WebCore::RenderTreeAsText::writeRenderObject):
     18
    1192011-10-17  Satish Sampath  <satish@chromium.org>
    220
  • trunk/Source/WebCore/css/SelectorChecker.cpp

    r97248 r97596  
    229229    if (!attr || attr->isNull())
    230230        return NotInsideLink;
     231
     232    // An empty href refers to the document itself which is always visited. It is useful to check this explicitly so
     233    // that visited links can be tested in platform independent manner, without explicit support in the test harness.
     234    if (attr->isEmpty())
     235        return InsideVisitedLink;
    231236
    232237    LinkHash hash = visitedLinkHash(m_document->baseURL(), *attr);
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

    r97308 r97596  
    283283            ts << " " << quoteAndEscapeNonPrintables(toRenderFileUploadControl(&o)->fileTextValue());
    284284
    285         if (o.parent() && (o.parent()->style()->color() != o.style()->color()))
    286             ts << " [color=" << o.style()->color().nameForRenderTreeAsText() << "]";
    287 
    288         if (o.parent() && (o.parent()->style()->backgroundColor() != o.style()->backgroundColor()) &&
    289             o.style()->backgroundColor().isValid() && o.style()->backgroundColor().rgb())
     285        if (o.parent()) {
     286            Color color = o.style()->visitedDependentColor(CSSPropertyColor);
     287            if (o.parent()->style()->visitedDependentColor(CSSPropertyColor) != color)
     288                ts << " [color=" << color.nameForRenderTreeAsText() << "]";
     289
    290290            // Do not dump invalid or transparent backgrounds, since that is the default.
    291             ts << " [bgcolor=" << o.style()->backgroundColor().nameForRenderTreeAsText() << "]";
    292        
    293         if (o.parent() && (o.parent()->style()->textFillColor() != o.style()->textFillColor()) &&
    294             o.style()->textFillColor().isValid() && o.style()->textFillColor() != o.style()->color() &&
    295             o.style()->textFillColor().rgb())
    296             ts << " [textFillColor=" << o.style()->textFillColor().nameForRenderTreeAsText() << "]";
    297 
    298         if (o.parent() && (o.parent()->style()->textStrokeColor() != o.style()->textStrokeColor()) &&
    299             o.style()->textStrokeColor().isValid() && o.style()->textStrokeColor() != o.style()->color() &&
    300             o.style()->textStrokeColor().rgb())
    301             ts << " [textStrokeColor=" << o.style()->textStrokeColor().nameForRenderTreeAsText() << "]";
    302 
    303         if (o.parent() && (o.parent()->style()->textStrokeWidth() != o.style()->textStrokeWidth()) &&
    304             o.style()->textStrokeWidth() > 0)
    305             ts << " [textStrokeWidth=" << o.style()->textStrokeWidth() << "]";
     291            Color backgroundColor = o.style()->visitedDependentColor(CSSPropertyBackgroundColor);
     292            if (o.parent()->style()->visitedDependentColor(CSSPropertyBackgroundColor) != backgroundColor
     293                && backgroundColor.isValid() && backgroundColor.rgb())
     294                ts << " [bgcolor=" << backgroundColor.nameForRenderTreeAsText() << "]";
     295           
     296            Color textFillColor = o.style()->visitedDependentColor(CSSPropertyWebkitTextFillColor);
     297            if (o.parent()->style()->visitedDependentColor(CSSPropertyWebkitTextFillColor) != textFillColor
     298                && textFillColor.isValid() && textFillColor != color && textFillColor.rgb())
     299                ts << " [textFillColor=" << textFillColor.nameForRenderTreeAsText() << "]";
     300
     301            Color textStrokeColor = o.style()->visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
     302            if (o.parent()->style()->visitedDependentColor(CSSPropertyWebkitTextStrokeColor) != textStrokeColor
     303                && textStrokeColor.isValid() && textStrokeColor != color && textStrokeColor.rgb())
     304                ts << " [textStrokeColor=" << textStrokeColor.nameForRenderTreeAsText() << "]";
     305
     306            if (o.parent()->style()->textStrokeWidth() != o.style()->textStrokeWidth() && o.style()->textStrokeWidth() > 0)
     307                ts << " [textStrokeWidth=" << o.style()->textStrokeWidth() << "]";
     308        }
    306309
    307310        if (!o.isBoxModelObject())
Note: See TracChangeset for help on using the changeset viewer.