[Webkit-unassigned] [Bug 131093] Move removeEquivalentProperties functions to EditingStyle

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 28 10:06:24 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=131093


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #230297|review?                     |review+
               Flag|                            |




--- Comment #8 from Darin Adler <darin at apple.com>  2014-04-28 10:06:46 PST ---
(From update of attachment 230297)
View in context: https://bugs.webkit.org/attachment.cgi?id=230297&action=review

> Source/WebCore/editing/EditingStyle.cpp:609
> +    RefPtr<MutableStyleProperties> style = nodeStyle->style();

This doesn’t need to be a RefPtr. Just a raw pointer would do. In fact, I suggest a reference rather than a pointer for this local variable.

> Source/WebCore/editing/EditingStyle.cpp:1195
> +void EditingStyle::removeEquivalentProperties(const StyleProperties* style)

This should take a reference, not a pointer, since a null pointer is not allowed. The callers should pass *style rather than style.get().

> Source/WebCore/editing/EditingStyle.cpp:1200
> +        StyleProperties::PropertyReference property = m_mutableStyle->propertyAt(i);

I think this would read better with auto.

> Source/WebCore/editing/EditingStyle.cpp:1206
> +    for (unsigned i = 0; i < propertiesToRemove.size(); ++i)
> +        m_mutableStyle->removeProperty(propertiesToRemove[i]);

This should be a modern C++ for loop.

    for (auto& property : propertiesToRemove)
        m_mutableStyle->removeProperty(property);

> Source/WebCore/editing/EditingStyle.cpp:1209
> +void EditingStyle::removeEquivalentProperties(const ComputedStyleExtractor* computedStyle)

This should take a reference, not a pointer, since a null pointer is not allowed. The callers should pass *style rather than style.get().

> Source/WebCore/editing/EditingStyle.cpp:1220
> +    for (unsigned i = 0; i < propertiesToRemove.size(); ++i)
> +        m_mutableStyle->removeProperty(propertiesToRemove[i]);

Ditto.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list