[Webkit-unassigned] [Bug 137918] Use references instead of pointers in EditingStyle

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 14 17:22:34 PST 2014


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
 Attachment #241580|review?                     |review+
              Flags|                            |

--- Comment #17 from Darin Adler <darin at apple.com> ---
Comment on attachment 241580
  --> https://bugs.webkit.org/attachment.cgi?id=241580
Patch v5

View in context: https://bugs.webkit.org/attachment.cgi?id=241580&action=review

r=me as long as you can give a satisfactory answer to all the questions about how we know various pointers are non-null

> Source/WebCore/editing/EditingStyle.cpp:651
> +    RefPtr<MutableStyleProperties> difference = getPropertiesNotIn(*m_mutableStyle, styleToCompare);

What guarantees that m_mutableStyle is non-null here?

> Source/WebCore/editing/EditingStyle.cpp:1412
> +        extractTextStyles(document, *mutableStyle, computedStyle.useFixedFontDefaultSize());

What guarantees that mutableStyle is non-null here? Can getPropertiesNotIn ever return null?

> Source/WebCore/editing/EditingStyle.cpp:1548
> +    return fontWeight ? fontWeightIsBold(*fontWeight) : false;

Forgot to mention this last time. I think this is even nicer with &&:

    return fontWeight && fontWeightIsBold(*fontWeight);

> Source/WebCore/editing/EditingStyle.cpp:1559
> +    diffTextDecorations(*mutableStyle, CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());

What guarantees mutableStyle is not null? Can EditingStyle::style ever return null?

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141115/067beeea/attachment-0002.html>

More information about the webkit-unassigned mailing list