[webkit-reviews] review denied: [Bug 59961] Implement DefaultParagraphSeparator execCommand, to let authors choose the default block element : [Attachment 129748] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 1 14:38:40 PST 2012


Ryosuke Niwa <rniwa at webkit.org> has denied Pablo Flouret
<pablof at motorola.com>'s request for review:
Bug 59961: Implement DefaultParagraphSeparator execCommand, to let authors
choose the default block element
https://bugs.webkit.org/show_bug.cgi?id=59961

Attachment 129748: Patch
https://bugs.webkit.org/attachment.cgi?id=129748&action=review

------- Additional Comments from Ryosuke Niwa <rniwa at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=129748&action=review


> Source/WebCore/editing/Editor.cpp:3026
> +void Editor::setDefaultParagraphSeparator(EditorParagraphSeparator
separator)
> +{
> +    ASSERT(separator == EditorParagraphSeparatorDiv || separator ==
EditorParagraphSeparatorP);
> +    m_defaultParagraphSeparator = separator;
> +}

I don't think we need an assertion here since compiler enforces the value in
enum by default. Also, it's probably better to keep it inline.

> Source/WebCore/editing/Editor.h:83
> +enum EditorParagraphSeparator { EditorParagraphSeparatorDiv,
EditorParagraphSeparatorP };

Should be EditorParagraphSeparatorIsDiv and EditorParagraphSeparatorIsP

> Source/WebCore/editing/htmlediting.cpp:852
> +    if (document->frame()->editor()->defaultParagraphSeparator() ==
EditorParagraphSeparatorP)
> +	   return HTMLParagraphElement::create(document);
>      return HTMLDivElement::create(document);

We should use switch statement here instead so that we'll get a compilation
error when a new value is added to enum and forgot to add a case here.

> Source/WebCore/page/Frame.cpp:311
> +
> +    // Reset the editor's default paragraph separator to the default value
(a div).
> +    m_editor.setDefaultParagraphSeparator(EditorParagraphSeparatorDiv);

What!? We shouldn't have to do this.


More information about the webkit-reviews mailing list