Changeset 146977 in webkit


Ignore:
Timestamp:
Mar 27, 2013 4:06:48 AM (11 years ago)
Author:
tkent@chromium.org
Message:

Rename HTMLFormControlElement::readOnly to isReadOnly
https://bugs.webkit.org/show_bug.cgi?id=113297

Reviewed by Alexey Proskuryakov.

Source/WebCore:

HTMLFormControlElement::readOnly is not an implementation of
'readOnly' IDL attribute. It's confusing and we don't need to
violate our naming convention.

No new tests. Just a refactoring.

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::isReadOnly):

  • html/BaseMultipleFieldsDateAndTimeInputType.cpp:

(WebCore::BaseMultipleFieldsDateAndTimeInputType::isEditControlOwnerReadOnly):

  • html/HTMLFormControlElement.cpp:

(WebCore::HTMLFormControlElement::HTMLFormControlElement):
(WebCore::HTMLFormControlElement::parseAttribute):

  • html/HTMLFormControlElement.h:

(WebCore::HTMLFormControlElement::isReadOnly):
(WebCore::HTMLFormControlElement::isDisabledOrReadOnly):

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::matchesReadOnlyPseudoClass):
(WebCore::HTMLInputElement::matchesReadWritePseudoClass):

  • html/HTMLTextAreaElement.cpp:

(WebCore::HTMLTextAreaElement::matchesReadOnlyPseudoClass):
(WebCore::HTMLTextAreaElement::matchesReadWritePseudoClass):

  • html/shadow/SliderThumbElement.cpp:

(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
(WebCore::SliderThumbElement::willRespondToMouseClickEvents):

  • html/shadow/TextControlInnerElements.cpp:

(WebCore::InputFieldSpeechButtonElement::willRespondToMouseClickEvents):
(WebCore::InputFieldSpeechButtonElement::setRecognitionResult):

  • html/shadow/TextFieldDecorationElement.cpp:

(WebCore::TextFieldDecorationElement::updateImage):

  • rendering/RenderTextControl.cpp:

(WebCore::updateUserModifyProperty):

  • rendering/RenderThemeMacShared.mm:

(WebCore::RenderThemeMacShared::paintSearchFieldCancelButton):

Source/WebKit/chromium:

  • src/WebFormControlElement.cpp:

(WebKit::WebFormControlElement::isReadOnly):

Source/WebKit/win:

  • DOMHTMLClasses.cpp:

(DOMHTMLInputElement::readOnly):

Location:
trunk/Source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r146975 r146977  
     12013-03-27  Kent Tamura  <tkent@chromium.org>
     2
     3        Rename HTMLFormControlElement::readOnly to isReadOnly
     4        https://bugs.webkit.org/show_bug.cgi?id=113297
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        HTMLFormControlElement::readOnly is not an implementation of
     9        'readOnly' IDL attribute. It's confusing and we don't need to
     10        violate our naming convention.
     11
     12        No new tests. Just a refactoring.
     13
     14        * accessibility/AccessibilityNodeObject.cpp:
     15        (WebCore::AccessibilityNodeObject::isReadOnly):
     16        * html/BaseMultipleFieldsDateAndTimeInputType.cpp:
     17        (WebCore::BaseMultipleFieldsDateAndTimeInputType::isEditControlOwnerReadOnly):
     18        * html/HTMLFormControlElement.cpp:
     19        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
     20        (WebCore::HTMLFormControlElement::parseAttribute):
     21        * html/HTMLFormControlElement.h:
     22        (WebCore::HTMLFormControlElement::isReadOnly):
     23        (WebCore::HTMLFormControlElement::isDisabledOrReadOnly):
     24        * html/HTMLInputElement.cpp:
     25        (WebCore::HTMLInputElement::matchesReadOnlyPseudoClass):
     26        (WebCore::HTMLInputElement::matchesReadWritePseudoClass):
     27        * html/HTMLTextAreaElement.cpp:
     28        (WebCore::HTMLTextAreaElement::matchesReadOnlyPseudoClass):
     29        (WebCore::HTMLTextAreaElement::matchesReadWritePseudoClass):
     30        * html/shadow/SliderThumbElement.cpp:
     31        (WebCore::SliderThumbElement::defaultEventHandler):
     32        (WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
     33        (WebCore::SliderThumbElement::willRespondToMouseClickEvents):
     34        * html/shadow/TextControlInnerElements.cpp:
     35        (WebCore::InputFieldSpeechButtonElement::willRespondToMouseClickEvents):
     36        (WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
     37        * html/shadow/TextFieldDecorationElement.cpp:
     38        (WebCore::TextFieldDecorationElement::updateImage):
     39        * rendering/RenderTextControl.cpp:
     40        (WebCore::updateUserModifyProperty):
     41        * rendering/RenderThemeMacShared.mm:
     42        (WebCore::RenderThemeMacShared::paintSearchFieldCancelButton):
     43
    1442013-03-27  Yury Semikhatsky  <yurys@chromium.org>
    245
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r146860 r146977  
    684684
    685685    if (node->hasTagName(textareaTag))
    686         return static_cast<HTMLTextAreaElement*>(node)->readOnly();
     686        return static_cast<HTMLTextAreaElement*>(node)->isReadOnly();
    687687
    688688    if (node->hasTagName(inputTag)) {
    689689        HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
    690690        if (input->isTextField())
    691             return input->readOnly();
     691            return input->isReadOnly();
    692692    }
    693693
  • trunk/Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp

    r146746 r146977  
    177177bool BaseMultipleFieldsDateAndTimeInputType::isEditControlOwnerReadOnly() const
    178178{
    179     return element()->readOnly();
     179    return element()->isReadOnly();
    180180}
    181181
  • trunk/Source/WebCore/html/HTMLFormControlElement.cpp

    r145818 r146977  
    5252    : LabelableElement(tagName, document)
    5353    , m_disabled(false)
    54     , m_readOnly(false)
     54    , m_isReadOnly(false)
    5555    , m_isRequired(false)
    5656    , m_valueMatchesRenderer(false)
     
    134134            disabledAttributeChanged();
    135135    } else if (name == readonlyAttr) {
    136         bool oldReadOnly = m_readOnly;
    137         m_readOnly = !value.isNull();
    138         if (oldReadOnly != m_readOnly) {
     136        bool wasReadOnly = m_isReadOnly;
     137        m_isReadOnly = !value.isNull();
     138        if (wasReadOnly != m_isReadOnly) {
    139139            setNeedsWillValidateCheck();
    140140            setNeedsStyleRecalc();
  • trunk/Source/WebCore/html/HTMLFormControlElement.h

    r141292 r146977  
    9595    virtual void setCustomValidity(const String&) OVERRIDE;
    9696
    97     bool readOnly() const { return m_readOnly; }
    98     bool isDisabledOrReadOnly() const { return disabled() || m_readOnly; }
     97    bool isReadOnly() const { return m_isReadOnly; }
     98    bool isDisabledOrReadOnly() const { return disabled() || m_isReadOnly; }
    9999
    100100    bool hasAutofocused() { return m_hasAutofocused; }
     
    149149    OwnPtr<ValidationMessage> m_validationMessage;
    150150    bool m_disabled : 1;
    151     bool m_readOnly : 1;
     151    bool m_isReadOnly : 1;
    152152    bool m_isRequired : 1;
    153153    bool m_valueMatchesRenderer : 1;
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r146860 r146977  
    14571457bool HTMLInputElement::matchesReadOnlyPseudoClass() const
    14581458{
    1459     return m_inputType->supportsReadOnly() && readOnly();
     1459    return m_inputType->supportsReadOnly() && isReadOnly();
    14601460}
    14611461
    14621462bool HTMLInputElement::matchesReadWritePseudoClass() const
    14631463{
    1464     return m_inputType->supportsReadOnly() && !readOnly();
     1464    return m_inputType->supportsReadOnly() && !isReadOnly();
    14651465}
    14661466
  • trunk/Source/WebCore/html/HTMLTextAreaElement.cpp

    r143843 r146977  
    530530bool HTMLTextAreaElement::matchesReadOnlyPseudoClass() const
    531531{
    532     return readOnly();
     532    return isReadOnly();
    533533}
    534534
    535535bool HTMLTextAreaElement::matchesReadWritePseudoClass() const
    536536{
    537     return !readOnly();
     537    return !isReadOnly();
    538538}
    539539
  • trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp

    r146638 r146977  
    345345    // Missing this kind of check is likely to occur elsewhere if adding it in each shadow element.
    346346    HTMLInputElement* input = hostInput();
    347     if (!input || input->readOnly() || !input->isEnabledFormControl()) {
     347    if (!input || input->isDisabledOrReadOnly()) {
    348348        stopDragging();
    349349        HTMLDivElement::defaultEventHandler(event);
     
    376376{
    377377    const HTMLInputElement* input = hostInput();
    378     if (input && !input->readOnly() && input->isEnabledFormControl() && m_inDragMode)
     378    if (input && !input->isDisabledOrReadOnly() && m_inDragMode)
    379379        return true;
    380380
     
    385385{
    386386    const HTMLInputElement* input = hostInput();
    387     if (input && !input->readOnly() && input->isEnabledFormControl())
     387    if (input && !input->isDisabledOrReadOnly())
    388388        return true;
    389389
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp

    r145977 r146977  
    350350{
    351351    const HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowHost());
    352     if (input && !input->disabled() && !input->readOnly())
     352    if (input && !input->isDisabledOrReadOnly())
    353353        return true;
    354354
     
    387387    // here, we take a temporary reference.
    388388    RefPtr<HTMLInputElement> input(static_cast<HTMLInputElement*>(shadowHost()));
    389     if (!input || input->disabled() || input->readOnly())
     389    if (!input || input->isDisabledOrReadOnly())
    390390        return;
    391391
  • trunk/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp

    r145977 r146977  
    145145    if (hostInput()->disabled())
    146146        image = m_textFieldDecorator->imageForDisabledState();
    147     else if (hostInput()->readOnly())
     147    else if (hostInput()->isReadOnly())
    148148        image = m_textFieldDecorator->imageForReadonlyState();
    149149    else if (m_isInHoverState)
  • trunk/Source/WebCore/rendering/RenderTextControl.cpp

    r145562 r146977  
    8383        Element* element = toElement(node);
    8484        isEnabled = element->isEnabledFormControl();
    85         isReadOnlyControl = element->isTextFormControl() && toHTMLTextFormControlElement(element)->readOnly();
     85        isReadOnlyControl = element->isTextFormControl() && toHTMLTextFormControlElement(element)->isReadOnly();
    8686    }
    8787
  • trunk/Source/WebCore/rendering/RenderThemeMacShared.mm

    r145196 r146977  
    15511551    NSSearchFieldCell* search = this->search();
    15521552
    1553     if (input->isEnabledFormControl() && (input->isTextFormControl() && !static_cast<HTMLTextFormControlElement*>(input)->readOnly())) {
     1553    if (input->isEnabledFormControl() && (input->isTextFormControl() && !toHTMLTextFormControlElement(input)->isReadOnly())) {
    15541554        updateActiveState([search cancelButtonCell], o);
    15551555        updatePressedState([search cancelButtonCell], o);
  • trunk/Source/WebKit/chromium/ChangeLog

    r146961 r146977  
     12013-03-27  Kent Tamura  <tkent@chromium.org>
     2
     3        Rename HTMLFormControlElement::readOnly to isReadOnly
     4        https://bugs.webkit.org/show_bug.cgi?id=113297
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * src/WebFormControlElement.cpp:
     9        (WebKit::WebFormControlElement::isReadOnly):
     10
    1112013-03-26  Hayato Ito  <hayato@chromium.org>
    212
  • trunk/Source/WebKit/chromium/src/WebFormControlElement.cpp

    r95901 r146977  
    4747bool WebFormControlElement::isReadOnly() const
    4848{
    49     return constUnwrap<HTMLFormControlElement>()->readOnly();
     49    return constUnwrap<HTMLFormControlElement>()->isReadOnly();
    5050}
    5151
  • trunk/Source/WebKit/win/ChangeLog

    r146961 r146977  
     12013-03-27  Kent Tamura  <tkent@chromium.org>
     2
     3        Rename HTMLFormControlElement::readOnly to isReadOnly
     4        https://bugs.webkit.org/show_bug.cgi?id=113297
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * DOMHTMLClasses.cpp:
     9        (DOMHTMLInputElement::readOnly):
     10
    1112013-03-26  Hayato Ito  <hayato@chromium.org>
    212
  • trunk/Source/WebKit/win/DOMHTMLClasses.cpp

    r145745 r146977  
    11241124    ASSERT(m_element && m_element->hasTagName(inputTag));
    11251125    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);
    1126     *result = inputElement->readOnly() ? TRUE : FALSE;
     1126    *result = inputElement->isReadOnly() ? TRUE : FALSE;
    11271127    return S_OK;
    11281128}
Note: See TracChangeset for help on using the changeset viewer.