Changeset 61993 in webkit


Ignore:
Timestamp:
Jun 28, 2010 4:20:33 AM (14 years ago)
Author:
morrita@google.com
Message:

2010-06-22 MORITA Hajime <morrita@google.com>

Reviewed by Kent Tamura.

<progress> should be styled with -webkit-progress-bar-value
https://bugs.webkit.org/show_bug.cgi?id=40823

Added cases for various style combinations, and explanations for
that cases.

  • fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html:
  • platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.checksum:
  • platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.png:
  • platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.txt:
  • platform/qt/Skipped:

2010-06-22 MORITA Hajime <morrita@google.com>

Reviewed by Kent Tamura.

<progress> should be styled with -webkit-progress-bar-value
https://bugs.webkit.org/show_bug.cgi?id=40823

Fixed to peek styles of the shadow node pseudo class to fallback
to non-styled painting.

  • css/html.css: (progress): Added defaul background-color. (progress::-webkit-progress-bar-value): Added defaul background-color.
  • rendering/RenderProgress.cpp: (WebCore::RenderProgress::shouldHaveParts): (WebCore::RenderProgress::updatePartsState):

Test: fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r61991 r61993  
     12010-06-22  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Kent Tamura.
     4
     5        <progress> should be styled with -webkit-progress-bar-value
     6        https://bugs.webkit.org/show_bug.cgi?id=40823
     7
     8        Added cases for various style combinations, and explanations for
     9        that cases.
     10
     11        * fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html:
     12        * platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.checksum:
     13        * platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.png:
     14        * platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.txt:
     15        * platform/qt/Skipped:
     16
    1172010-06-28  Eric Seidel  <eric@webkit.org>
    218
  • trunk/LayoutTests/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html

    r58228 r61993  
    22<head><script>
    33window.onload = function() {
    4     document.getElementById("p").setAttribute("style", "-webkit-appearance:none; border:3px red dotted; background-color:cyan;")
     4    document.getElementById("toChangeStyle").setAttribute("style", "border:3px red dotted; background-color:cyan;");
     5    document.getElementById("toAddStyle").setAttribute("style", "border:3px red dotted; background-color:cyan;");
    56}
    67</script>
    78<style>
    8 ::-webkit-progress-bar-value {background-color:gray;}
    9 #p::-webkit-progress-bar-value {background-color:darkblue;}
     9.styled::-webkit-progress-bar-value {background-color: lightgray;}
     10#toAddStyle::-webkit-progress-bar-value {background-color:darkblue;}
     11.no-appearance {-webkit-appearance: none;}
    1012</style>
    1113</head>
    12 <body><progress max=100 value=70 dir="rtl" id="p"></progress><progress max=100 value=70 style="-webkit-appearance:none; width:300px; height:50px; background-color:blue; " ></progress><progress style="border:3px solid red;" value=0.5></progress></body>
     14<body>
     15  <ul>
     16    <li>
     17      Giving style statically : background-color:
     18      <progress class="styled" max=100 value=70 style="width:300px; height:50px; background-color:blue; " >
     19    </li>
     20    <li>
     21      Giving style statically : border:
     22      <progress class="styled" style="border:3px solid red;" value=0.5>
     23    </li>
     24    <li>
     25      Giving style statically, only for -webkit-progress-bar-value:
     26      <progress class="styled" value=0.5></progress>
     27    </li>
     28    <li>
     29      Adding style dynamically:
     30      <progress value=0.5 id="toAddStyle"></progress>
     31    </li>
     32    <li>
     33      Changing style dynamically:
     34      <progress class="styled" max=100 value=70 dir="rtl" id="toChangeStyle"></progress>
     35    </li>
     36  </ul>
     37</body>
    1338</html>
  • trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.checksum

    r58228 r61993  
    1 9d70735521c5b951d8ec93992d820d16
     1496b6f8374f87c0d227c4cc48011920f
  • trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element-expected.txt

    r58228 r61993  
    33layer at (0,0) size 800x600
    44  RenderBlock {HTML} at (0,0) size 800x600
    5     RenderBody {BODY} at (8,8) size 784x584
    6       RenderProgress {PROGRESS} at (0,28) size 166x22 [bgcolor=#00FFFF] [border: (3px dotted #FF0000)]
    7         RenderBlock {DIV} at (51,3) size 112x16 [bgcolor=#00008B]
    8       RenderProgress {PROGRESS} at (166,0) size 300x50 [bgcolor=#0000FF]
    9         RenderBlock {DIV} at (0,0) size 210x50 [bgcolor=#808080]
    10       RenderProgress {PROGRESS} at (466,28) size 166x22 [border: (3px solid #FF0000)]
    11         RenderBlock {DIV} at (3,3) size 80x16 [bgcolor=#808080]
    12       RenderText {#text} at (0,0) size 0x0
    13       RenderText {#text} at (0,0) size 0x0
     5    RenderBody {BODY} at (8,8) size 784x576
     6      RenderBlock {UL} at (0,0) size 784x138
     7        RenderListItem {LI} at (40,0) size 744x51
     8          RenderListMarker at (-17,33) size 7x18: bullet
     9          RenderText {#text} at (0,33) size 268x18
     10            text run at (0,33) width 268: "Giving style statically : background-color: "
     11          RenderProgress {PROGRESS} at (268,0) size 300x50 [bgcolor=#0000FF]
     12            RenderBlock {DIV} at (0,0) size 210x50 [bgcolor=#D3D3D3]
     13        RenderListItem {LI} at (40,51) size 744x23
     14          RenderListMarker at (-17,5) size 7x18: bullet
     15          RenderText {#text} at (0,5) size 197x18
     16            text run at (0,5) width 197: "Giving style statically : border: "
     17          RenderProgress {PROGRESS} at (197,0) size 166x22 [bgcolor=#808080] [border: (3px solid #FF0000)]
     18            RenderBlock {DIV} at (3,3) size 80x16 [bgcolor=#D3D3D3]
     19        RenderListItem {LI} at (40,74) size 744x18
     20          RenderListMarker at (-17,0) size 7x18: bullet
     21          RenderText {#text} at (0,0) size 376x18
     22            text run at (0,0) width 376: "Giving style statically, only for -webkit-progress-bar-value: "
     23          RenderProgress {PROGRESS} at (376,1) size 160x16 [bgcolor=#808080]
     24            RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#D3D3D3]
     25          RenderText {#text} at (0,0) size 0x0
     26        RenderListItem {LI} at (40,92) size 744x23
     27          RenderListMarker at (-17,5) size 7x18: bullet
     28          RenderText {#text} at (0,5) size 170x18
     29            text run at (0,5) width 170: "Adding style dynamically: "
     30          RenderProgress {PROGRESS} at (170,0) size 166x22 [bgcolor=#00FFFF] [border: (3px dotted #FF0000)]
     31            RenderBlock {DIV} at (3,3) size 80x16 [bgcolor=#00008B]
     32          RenderText {#text} at (0,0) size 0x0
     33        RenderListItem {LI} at (40,115) size 744x23
     34          RenderListMarker at (-17,5) size 7x18: bullet
     35          RenderText {#text} at (0,5) size 184x18
     36            text run at (0,5) width 184: "Changing style dynamically: "
     37          RenderProgress {PROGRESS} at (184,0) size 166x22 [bgcolor=#00FFFF] [border: (3px dotted #FF0000)]
     38            RenderBlock {DIV} at (51,3) size 112x16 [bgcolor=#D3D3D3]
     39          RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/qt/Skipped

    r61970 r61993  
    32523252# meter-element.html is temporally disabled.We need to rebaseline.
    32533253fast/dom/HTMLMeterElement/meter-element.html
     3254# progress-bar-value-pseudo-element.html is temporally disabled.We need to rebaseline.
     3255fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html
    32543256fast/dom/HTMLObjectElement/vspace-hspace-as-number.html
    32553257fast/dom/HTMLStyleElement/insert-parser-generated.html
  • trunk/WebCore/ChangeLog

    r61992 r61993  
     12010-06-22  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Kent Tamura.
     4
     5        <progress> should be styled with -webkit-progress-bar-value
     6        https://bugs.webkit.org/show_bug.cgi?id=40823
     7
     8        Fixed to peek styles of the shadow node pseudo class to fallback
     9        to non-styled painting.
     10       
     11        * css/html.css:
     12        (progress): Added defaul background-color.
     13        (progress::-webkit-progress-bar-value): Added defaul background-color.
     14        * rendering/RenderProgress.cpp:
     15        (WebCore::RenderProgress::shouldHaveParts):
     16        (WebCore::RenderProgress::updatePartsState):
     17
     18        Test: fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html
     19       
    1202010-06-28  Csaba Osztrogonác  <ossy@webkit.org>
    221
  • trunk/WebCore/css/html.css

    r61975 r61993  
    585585    width: 10em;
    586586    vertical-align: -0.2em;
    587 }
    588 
    589 progress::-webkit-progress-bar {
     587    background-color: gray;
     588}
     589
     590progress::-webkit-progress-bar-value {
    590591    -webkit-appearance: progress-bar;
     592    background-color: green;
    591593}
    592594
  • trunk/WebCore/rendering/RenderProgress.cpp

    r61376 r61993  
    9999bool RenderProgress::shouldHaveParts() const
    100100{
    101     return !style()->hasAppearance();
     101    if (!style()->hasAppearance())
     102        return true;
     103    if (ShadowBlockElement::partShouldHaveStyle(this, PROGRESS_BAR_VALUE))
     104        return true;
     105    return false;
    102106}
    103107
     
    105109{
    106110    if (shouldHaveParts() && !m_valuePart) {
     111        style()->setAppearance(NoControlPart);
    107112        m_valuePart = ShadowBlockElement::createForPart(this->node(), PROGRESS_BAR_VALUE);
    108113        addChild(m_valuePart->renderer());
Note: See TracChangeset for help on using the changeset viewer.