Changeset 88793 in webkit


Ignore:
Timestamp:
Jun 14, 2011 6:22:18 AM (13 years ago)
Author:
yael.aharon@nokia.com
Message:

2011-06-14 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Kent Tamura.

<progress> should support :indeterminate pseudo-class
https://bugs.webkit.org/show_bug.cgi?id=62430

  • fast/dom/HTMLProgressElement/indeterminate-progress-001.html: Added.
  • fast/dom/HTMLProgressElement/indeterminate-progress-002-expected.txt: Added.
  • fast/dom/HTMLProgressElement/indeterminate-progress-002.html: Added.
  • platform/mac/fast/dom/HTMLProgressElement/indeterminate-progress-001-expected.png: Added.
  • platform/mac/fast/dom/HTMLProgressElement/indeterminate-progress-001-expected.txt: Added.
  • platform/chromium/test_expectations.txt:

2011-06-14 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Kent Tamura.

<progress> should support :indeterminate pseudo-class
https://bugs.webkit.org/show_bug.cgi?id=62430

Add support for :indeterminate pseudo class for progress element.

Tests: fast/dom/HTMLProgressElement/indeterminate-progress-001.html

fast/dom/HTMLProgressElement/indeterminate-progress-002.html

  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::canShareStyleWithControl): (WebCore::CSSStyleSelector::canShareStyleWithElement): (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
  • html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::isDeterminate): (WebCore::HTMLProgressElement::didElementStateChange):
  • html/HTMLProgressElement.h:
Location:
trunk
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88792 r88793  
     12011-06-14  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Kent Tamura.
     4
     5        <progress> should support :indeterminate pseudo-class
     6        https://bugs.webkit.org/show_bug.cgi?id=62430
     7
     8        * fast/dom/HTMLProgressElement/indeterminate-progress-001.html: Added.
     9        * fast/dom/HTMLProgressElement/indeterminate-progress-002-expected.txt: Added.
     10        * fast/dom/HTMLProgressElement/indeterminate-progress-002.html: Added.
     11        * platform/mac/fast/dom/HTMLProgressElement/indeterminate-progress-001-expected.png: Added.
     12        * platform/mac/fast/dom/HTMLProgressElement/indeterminate-progress-001-expected.txt: Added.
     13        * platform/chromium/test_expectations.txt:
     14
    1152011-06-14  Pavel Feldman  <pfeldman@google.com>
    216
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r88789 r88793  
    39893989BUGCR85755 : fast/js/exception-properties.html = TEXT
    39903990
     3991BUGWK62430 : fast/dom/HTMLProgressElement/indeterminate-progress-001.html = FAIL
     3992
    39913993// Has been flaky, probably since birth.
    39923994BUGWK62580 : fast/loader/inherit-charset-to-empty-frame.html = PASS TEXT
  • trunk/Source/WebCore/ChangeLog

    r88792 r88793  
     12011-06-14  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Kent Tamura.
     4
     5        <progress> should support :indeterminate pseudo-class
     6        https://bugs.webkit.org/show_bug.cgi?id=62430
     7
     8        Add support for :indeterminate pseudo class for progress element.
     9
     10        Tests: fast/dom/HTMLProgressElement/indeterminate-progress-001.html
     11               fast/dom/HTMLProgressElement/indeterminate-progress-002.html
     12
     13        * css/CSSStyleSelector.cpp:
     14        (WebCore::CSSStyleSelector::canShareStyleWithControl):
     15        (WebCore::CSSStyleSelector::canShareStyleWithElement):
     16        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
     17        * html/HTMLProgressElement.cpp:
     18        (WebCore::HTMLProgressElement::isDeterminate):
     19        (WebCore::HTMLProgressElement::didElementStateChange):
     20        * html/HTMLProgressElement.h:
     21
    1222011-06-14  Pavel Feldman  <pfeldman@google.com>
    223
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r88553 r88793  
    6666#include "HTMLInputElement.h"
    6767#include "HTMLNames.h"
     68#include "HTMLProgressElement.h"
    6869#include "HTMLTextAreaElement.h"
    6970#include "KeyframeList.h"
     
    10201021}
    10211022
     1023bool CSSStyleSelector::canShareStyleWithControl(StyledElement* element) const
     1024{
     1025#if ENABLE(PROGRESS_TAG)
     1026    if (element->hasTagName(progressTag)) {
     1027        if (!m_element->hasTagName(progressTag))
     1028            return false;
     1029       
     1030        HTMLProgressElement* thisProgressElement = static_cast<HTMLProgressElement*>(element);
     1031        HTMLProgressElement* otherProgressElement = static_cast<HTMLProgressElement*>(m_element);
     1032        if (thisProgressElement->isDeterminate() != otherProgressElement->isDeterminate())
     1033            return false;
     1034       
     1035        return true;
     1036    }
     1037#endif
     1038   
     1039    HTMLInputElement* thisInputElement = element->toInputElement();
     1040    HTMLInputElement* otherInputElement = m_element->toInputElement();
     1041   
     1042    if (!thisInputElement || !otherInputElement)
     1043        return false;
     1044   
     1045    if (thisInputElement->isAutofilled() != otherInputElement->isAutofilled())
     1046        return false;
     1047    if (thisInputElement->isChecked() != otherInputElement->isChecked())
     1048        return false;
     1049    if (thisInputElement->isIndeterminate() != otherInputElement->isIndeterminate())
     1050        return false;
     1051   
     1052    if (element->isEnabledFormControl() != m_element->isEnabledFormControl())
     1053        return false;
     1054   
     1055    if (element->isDefaultButtonForForm() != m_element->isDefaultButtonForForm())
     1056        return false;
     1057   
     1058    if (!m_element->document()->containsValidityStyleRules())
     1059        return false;
     1060   
     1061    bool willValidate = element->willValidate();
     1062   
     1063    if (willValidate != m_element->willValidate())
     1064        return false;
     1065   
     1066    if (willValidate && (element->isValidFormControlElement() != m_element->isValidFormControlElement()))
     1067        return false;
     1068   
     1069    if (element->isInRange() != m_element->isInRange())
     1070        return false;
     1071   
     1072    if (element->isOutOfRange() != m_element->isOutOfRange())
     1073        return false;
     1074   
     1075    return true;
     1076}
     1077
    10221078bool CSSStyleSelector::canShareStyleWithElement(Node* node) const
    10231079{
     
    10751131        return false;
    10761132
    1077     if (isControl) {
    1078         HTMLInputElement* thisInputElement = element->toInputElement();
    1079         HTMLInputElement* otherInputElement = m_element->toInputElement();
    1080 
    1081         if (!thisInputElement || !otherInputElement)
    1082             return false;
    1083 
    1084         if (thisInputElement->isAutofilled() != otherInputElement->isAutofilled())
    1085             return false;
    1086         if (thisInputElement->isChecked() != otherInputElement->isChecked())
    1087             return false;
    1088         if (thisInputElement->isIndeterminate() != otherInputElement->isIndeterminate())
    1089             return false;
    1090 
    1091         if (element->isEnabledFormControl() != m_element->isEnabledFormControl())
    1092             return false;
    1093 
    1094         if (element->isDefaultButtonForForm() != m_element->isDefaultButtonForForm())
    1095             return false;
    1096 
    1097         if (!m_element->document()->containsValidityStyleRules())
    1098             return false;
    1099 
    1100         bool willValidate = element->willValidate();
    1101 
    1102         if (willValidate != m_element->willValidate())
    1103             return false;
    1104 
    1105         if (willValidate && (element->isValidFormControlElement() != m_element->isValidFormControlElement()))
    1106             return false;
    1107 
    1108         if (element->isInRange() != m_element->isInRange())
    1109             return false;
    1110 
    1111         if (element->isOutOfRange() != m_element->isOutOfRange())
    1112             return false;
    1113     }
     1133    if (isControl && !canShareStyleWithControl(element))
     1134        return false;
    11141135
    11151136    if (style->transitions() || style->animations())
     
    28822903                if (!e || !e->isFormControlElement())
    28832904                    break;
     2905               
     2906#if ENABLE(PROGRESS_TAG)
     2907                if (e->hasTagName(progressTag)) {
     2908                    HTMLProgressElement* progress = static_cast<HTMLProgressElement*>(e);
     2909                    if (progress && !progress->isDeterminate())
     2910                        return true;
     2911                    break;
     2912                }
     2913#endif
     2914               
    28842915                HTMLInputElement* inputElement = e->toInputElement();
    28852916                if (inputElement && inputElement->isIndeterminate())
  • trunk/Source/WebCore/css/CSSStyleSelector.h

    r87362 r88793  
    316316
    317317        void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&);
     318       
     319        bool canShareStyleWithControl(StyledElement*) const;
    318320
    319321        void applyProperty(int id, CSSValue*);
  • trunk/Source/WebCore/html/HTMLProgressElement.cpp

    r86526 r88793  
    136136}
    137137
     138bool HTMLProgressElement::isDeterminate()
     139{
     140    double currentPosition = position();
     141    return (HTMLProgressElement::IndeterminatePosition != currentPosition && HTMLProgressElement::InvalidPosition != currentPosition);
     142}
     143   
    138144void HTMLProgressElement::didElementStateChange()
    139145{
    140146    m_value->setWidthPercentage(position()*100);
    141     if (renderer())
     147    if (renderer()) {
     148        RenderProgress* render = toRenderProgress(renderer());
     149        bool wasDeterminate = render->isDeterminate();
    142150        renderer()->updateFromElement();
     151        if (wasDeterminate != isDeterminate())
     152            setNeedsStyleRecalc();
     153    }
    143154}
    144155
  • trunk/Source/WebCore/html/HTMLProgressElement.h

    r86526 r88793  
    4444    double position() const;
    4545
     46    bool isDeterminate();
     47   
    4648    virtual bool canContainRangeEndPoint() const { return false; }
    4749
Note: See TracChangeset for help on using the changeset viewer.