Changeset 77112 in webkit


Ignore:
Timestamp:
Jan 30, 2011 10:18:13 PM (13 years ago)
Author:
Simon Fraser
Message:

2011-01-30 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r77107.
http://trac.webkit.org/changeset/77107
https://bugs.webkit.org/show_bug.cgi?id=53412

Caused 5 new form-related test crashes (Requested by smfr on
#webkit).

  • css/CSSSelector.cpp: (WebCore::CSSSelector::pseudoId): (WebCore::nameToPseudoTypeMap): (WebCore::CSSSelector::extractPseudoType):
  • css/CSSSelector.h:
  • html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::parseMappedAttribute): (WebCore::HTMLProgressElement::attach):
  • html/HTMLProgressElement.h:
  • rendering/RenderProgress.cpp: (WebCore::RenderProgress::~RenderProgress): (WebCore::RenderProgress::updateFromElement): (WebCore::RenderProgress::layoutParts): (WebCore::RenderProgress::shouldHaveParts):
  • rendering/RenderProgress.h:
  • rendering/style/RenderStyleConstants.h:
Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r77110 r77112  
     12011-01-30  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r77107.
     4        http://trac.webkit.org/changeset/77107
     5        https://bugs.webkit.org/show_bug.cgi?id=53412
     6
     7        Caused 5 new form-related test crashes (Requested by smfr on
     8        #webkit).
     9
     10        * css/CSSSelector.cpp:
     11        (WebCore::CSSSelector::pseudoId):
     12        (WebCore::nameToPseudoTypeMap):
     13        (WebCore::CSSSelector::extractPseudoType):
     14        * css/CSSSelector.h:
     15        * html/HTMLProgressElement.cpp:
     16        (WebCore::HTMLProgressElement::parseMappedAttribute):
     17        (WebCore::HTMLProgressElement::attach):
     18        * html/HTMLProgressElement.h:
     19        * rendering/RenderProgress.cpp:
     20        (WebCore::RenderProgress::~RenderProgress):
     21        (WebCore::RenderProgress::updateFromElement):
     22        (WebCore::RenderProgress::layoutParts):
     23        (WebCore::RenderProgress::shouldHaveParts):
     24        * rendering/RenderProgress.h:
     25        * rendering/style/RenderStyleConstants.h:
     26
    1272011-01-30  Simon Fraser  <simon.fraser@apple.com>
    228
  • trunk/Source/WebCore/css/CSSSelector.cpp

    r77107 r77112  
    169169    case PseudoOuterSpinButton:
    170170        return OUTER_SPIN_BUTTON;
     171    case PseudoProgressBarValue:
     172#if ENABLE(PROGRESS_TAG)
     173        return PROGRESS_BAR_VALUE;
     174#else
     175        ASSERT_NOT_REACHED();
     176        return NOPSEUDO;
     177#endif
     178
    171179#if ENABLE(METER_TAG)
    172180    case PseudoMeterHorizontalBar:
     
    328336    DEFINE_STATIC_LOCAL(AtomicString, optional, ("optional"));
    329337    DEFINE_STATIC_LOCAL(AtomicString, outerSpinButton, ("-webkit-outer-spin-button"));
     338#if ENABLE(PROGRESS_TAG)
     339    DEFINE_STATIC_LOCAL(AtomicString, progressBarValue, ("-webkit-progress-bar-value"));
     340#endif
     341
    330342#if ENABLE(METER_TAG)
    331343    DEFINE_STATIC_LOCAL(AtomicString, meterHorizontalBar, ("-webkit-meter-horizontal-bar"));
     
    431443        nameToPseudoType->set(nthLastOfType.impl(), CSSSelector::PseudoNthLastOfType);
    432444        nameToPseudoType->set(outerSpinButton.impl(), CSSSelector::PseudoOuterSpinButton);
     445#if ENABLE(PROGRESS_TAG)
     446        nameToPseudoType->set(progressBarValue.impl(), CSSSelector::PseudoProgressBarValue);
     447#endif
    433448#if ENABLE(METER_TAG)
    434449        nameToPseudoType->set(meterHorizontalBar.impl(), CSSSelector::PseudoMeterHorizontalBar);
     
    530545    case PseudoMeterVerticalEvenLessGood:
    531546    case PseudoOuterSpinButton:
     547    case PseudoProgressBarValue:
    532548    case PseudoResizer:
    533549    case PseudoScrollbar:
  • trunk/Source/WebCore/css/CSSSelector.h

    r77107 r77112  
    196196            PseudoInnerSpinButton,
    197197            PseudoOuterSpinButton,
     198            PseudoProgressBarValue,
    198199            PseudoLeftPage,
    199200            PseudoRightPage,
  • trunk/Source/WebCore/html/HTMLProgressElement.cpp

    r77107 r77112  
    3131#include "HTMLParserIdioms.h"
    3232#include "RenderProgress.h"
    33 #include "ShadowElement.h"
    3433#include <wtf/StdLibExtras.h>
    3534
     
    3736
    3837using namespace HTMLNames;
    39 
    40 class ProgressBarValueElement : public ShadowBlockElement {
    41 public:
    42     ProgressBarValueElement(HTMLElement* shadowParent)
    43         : ShadowBlockElement(shadowParent)
    44     {
    45     }
    46 
    47     virtual const AtomicString& shadowPseudoId() const
    48     {
    49         DEFINE_STATIC_LOCAL(AtomicString, pseudId, ("-webkit-progress-bar-value"));
    50         return pseudId;
    51     }
    52 
    53     static PassRefPtr<ProgressBarValueElement> create(HTMLElement* shadowParent)
    54     {
    55         return adoptRef(new ProgressBarValueElement(shadowParent));
    56     }
    57 
    58 };
    5938
    6039HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
     
    8261void HTMLProgressElement::parseMappedAttribute(Attribute* attribute)
    8362{
    84     if (attribute->name() == valueAttr)
    85         didElementStateChange();
    86     else if (attribute->name() == maxAttr)
    87         didElementStateChange();
    88     else
     63    if (attribute->name() == valueAttr) {
     64        if (renderer())
     65            renderer()->updateFromElement();
     66    } else if (attribute->name() == maxAttr) {
     67        if (renderer())
     68            renderer()->updateFromElement();
     69    } else
    8970        HTMLFormControlElement::parseMappedAttribute(attribute);
    9071}
     
    9273void HTMLProgressElement::attach()
    9374{
    94     createShadowSubtreeIfNeeded();
    9575    HTMLFormControlElement::attach();
    96     didElementStateChange();
     76    if (renderer())
     77        renderer()->updateFromElement();
    9778}
    9879
     
    141122}
    142123
    143 ShadowBlockElement* HTMLProgressElement::valuePart()
    144 {
    145     return static_cast<ShadowBlockElement*>(shadowRoot());
    146 }
    147 
    148 void HTMLProgressElement::didElementStateChange()
    149 {
    150     if (renderer())
    151         renderer()->updateFromElement();
    152 }
    153 
    154 void HTMLProgressElement::createShadowSubtreeIfNeeded()
    155 {
    156     if (shadowRoot())
    157         return;
    158     setShadowRoot(ProgressBarValueElement::create(this).get());
    159 }
    160 
    161124} // namespace
    162125#endif
  • trunk/Source/WebCore/html/HTMLProgressElement.h

    r77107 r77112  
    2727namespace WebCore {
    2828
    29 class ShadowBlockElement;
    30 
    3129class HTMLProgressElement : public HTMLFormControlElement {
    3230public:
     
    4139    double position() const;
    4240
    43     ShadowBlockElement* valuePart();
    4441private:
    4542    HTMLProgressElement(const QualifiedName&, Document*, HTMLFormElement*);
     
    5451
    5552    virtual void attach();
    56 
    57     void didElementStateChange();
    58     void createShadowSubtreeIfNeeded();
    5953};
    6054
  • trunk/Source/WebCore/rendering/RenderProgress.cpp

    r77107 r77112  
    5050RenderProgress::~RenderProgress()
    5151{
     52    if (m_valuePart)
     53        m_valuePart->detach();
    5254}
    5355
    5456void RenderProgress::updateFromElement()
    5557{
     58    if (!m_valuePart) {
     59        m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), PROGRESS_BAR_VALUE);
     60        if (m_valuePart->renderer())
     61            addChild(m_valuePart->renderer());
     62    }
     63
    5664    if (shouldHaveParts())
    5765        style()->setAppearance(NoControlPart);
    58     else if (valuePart()->renderer())
    59         valuePart()->renderer()->style()->setVisibility(HIDDEN);
     66    else if (m_valuePart->renderer())
     67        m_valuePart->renderer()->style()->setVisibility(HIDDEN);
    6068
    6169    HTMLProgressElement* element = progressElement();
     
    95103void RenderProgress::layoutParts()
    96104{
    97     valuePart()->layoutAsPart(valuePartRect());
     105    m_valuePart->layoutAsPart(valuePartRect());
    98106    updateAnimationState();
    99107}
     
    103111    if (!style()->hasAppearance())
    104112        return true;
    105     if (!(valuePart()->renderer() && valuePart()->renderer()->style()->hasAppearance()))
     113    if (ShadowBlockElement::partShouldHaveStyle(this, PROGRESS_BAR_VALUE))
    106114        return true;
    107115    return false;
     
    138146}   
    139147
    140 ShadowBlockElement* RenderProgress::valuePart() const
    141 {
    142     return progressElement()->valuePart();
    143 }
    144 
    145148} // namespace WebCore
    146149
  • trunk/Source/WebCore/rendering/RenderProgress.h

    r77107 r77112  
    5858    void updateAnimationState();
    5959
    60     ShadowBlockElement* valuePart() const;
    61 
    6260    double m_position;
    6361    double m_animationStartTime;
     
    6664    bool m_animating;
    6765    Timer<RenderProgress> m_animationTimer;
     66    RefPtr<ShadowBlockElement> m_valuePart;
    6867};
    6968
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r77107 r77112  
    7272    MEDIA_CONTROLS_TIMELINE_CONTAINER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY,
    7373    MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
    74     INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK,
     74    INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK, PROGRESS_BAR_VALUE,
    7575    METER_HORIZONTAL_BAR, METER_HORIZONTAL_OPTIMUM, METER_HORIZONTAL_SUBOPTIMAL, METER_HORIZONTAL_EVEN_LESS_GOOD,
    7676    METER_VERTICAL_BAR, METER_VERTICAL_OPTIMUM, METER_VERTICAL_SUBOPTIMAL, METER_VERTICAL_EVEN_LESS_GOOD,
Note: See TracChangeset for help on using the changeset viewer.