Changeset 242311 in webkit


Ignore:
Timestamp:
Mar 2, 2019 9:33:20 AM (5 years ago)
Author:
Darin Adler
Message:

Improve some comments
https://bugs.webkit.org/show_bug.cgi?id=195243

Reviewed by Daniel Bates.

  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
Fix a typo in a comment.

  • dom/RadioButtonGroups.cpp: Fix a typo in a comment.

(WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
it a bit longer. Use nullptr instead of 0.
(WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r242309 r242311  
     12019-03-02  Darin Adler  <darin@apple.com>
     2
     3        Improve some comments
     4        https://bugs.webkit.org/show_bug.cgi?id=195243
     5
     6        Reviewed by Daniel Bates.
     7
     8        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
     9        (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
     10        Fix a typo in a comment.
     11
     12        * dom/RadioButtonGroups.cpp: Fix a typo in a comment.
     13        (WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.
     14
     15        * html/HTMLInputElement.cpp:
     16        (WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
     17        it a bit longer. Use nullptr instead of 0.
     18        (WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.
     19
    1202019-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r242051 r242311  
    20772077        return YES;
    20782078   
    2079     // Explicity set that this is now an element (in case other logic tries to override).
     2079    // Explicitly set that this is now an element (in case other logic tries to override).
    20802080    [wrapper setValue:@YES forKey:@"isAccessibilityElement"];   
    20812081    [array addObject:wrapper];
  • trunk/Source/WebCore/dom/RadioButtonGroups.cpp

    r240237 r242311  
    187187// ----------------------------------------------------------------
    188188
    189 // Explicity define empty constructor and destructor in order to prevent the
    190 // compiler from generating them as inlines. So we don't need to to define
    191 // RadioButtonGroup in the header.
     189// Explicitly define default constructor and destructor here outside the header
     190// so we can compile the header without including the definition of RadioButtonGroup.
    192191RadioButtonGroups::RadioButtonGroups() = default;
    193 
    194192RadioButtonGroups::~RadioButtonGroups() = default;
    195193
     
    255253{
    256254    if (!m_nameToGroupMap)
    257         return 0;
     255        return nullptr;
    258256    m_nameToGroupMap->checkConsistency();
    259257    RadioButtonGroup* group = m_nameToGroupMap->get(name.impl());
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r240926 r242311  
    166166    // Need to remove form association while this is still an HTMLInputElement
    167167    // so that virtual functions are called correctly.
    168     setForm(0);
    169     // setForm(0) may register this to a document-level radio button group.
    170     // We should unregister it to avoid accessing a deleted object.
     168    setForm(nullptr);
     169
     170    // This is needed for a radio button that was not in a form, and also for
     171    // a radio button that was in a form. The call to setForm(nullptr) above
     172    // actually adds the button to the document groups in the latter case.
     173    // That is inelegant, but harmless since we remove it here.
    171174    if (isRadioButton())
    172175        document().formController().radioButtonGroups().removeButton(*this);
     176
    173177#if ENABLE(TOUCH_EVENTS)
    174178    if (m_hasTouchEventHandler)
     
    15641568        newDocument.registerForDocumentSuspensionCallbacks(*this);
    15651569    }
     1570
     1571    // We call this even for radio buttons in forms; it's harmless because the
     1572    // removeButton function is written to be safe for buttons not in any group.
    15661573    if (isRadioButton())
    15671574        oldDocument.formController().radioButtonGroups().removeButton(*this);
     1575
    15681576#if ENABLE(TOUCH_EVENTS)
    15691577    if (m_hasTouchEventHandler) {
     
    18931901    return buttons->groupMembers(*this);
    18941902}
    1895    
     1903
    18961904HTMLInputElement* HTMLInputElement::checkedRadioButtonForGroup() const
    18971905{
    18981906    if (RadioButtonGroups* buttons = radioButtonGroups())
    18991907        return buttons->checkedButtonForGroup(name());
    1900     return 0;
     1908    return nullptr;
    19011909}
    19021910
Note: See TracChangeset for help on using the changeset viewer.