[webkit-reviews] review denied: [Bug 88793] Implement undoscope attribute. : [Attachment 146883] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 11 12:02:07 PDT 2012


Ryosuke Niwa <rniwa at webkit.org> has denied Rakesh <rakesh.kn at motorola.com>'s
request for review:
Bug 88793: Implement undoscope attribute.
https://bugs.webkit.org/show_bug.cgi?id=88793

Attachment 146883: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=146883&action=review

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


> Source/WebCore/dom/Element.idl:146
> +	   attribute [Conditional=UNDO_MANAGER] boolean undoScope;

This should just "reflect".

> Source/WebCore/dom/Element.cpp:2126
> +void Element::setUndoScope(bool undoScope)
> +{
> +    setAttribute(undoscopeAttr, undoScope ? "true" : "false");
> +    if (!undoScope) {
> +	   if (undoManager())
> +	       rareData()->m_undoManager.clear();
> +	   return;
> +    }
> +
> +    if (!isRootEditableElement())
> +	   return;
> +    createUndoManager();
> +}

I think this is backwards. parsedAttribute should be calling this function
instead.

> Source/WebCore/html/HTMLElement.cpp:218
> +    if (attribute.name() == undoscopeAttr &&
equalIgnoringCase(attribute.value(), "true") && isRootEditableElement())

undoscope attribute doesn't take boolean values. It's a boolean attribute,
meaning that it's set iff we have undoscope=undoscope or undoscope.

> Source/WebCore/html/HTMLElement.cpp:221
> +    if (attribute.name() == contenteditableAttr && (attribute.isEmpty() ||
!equalIgnoringCase(attribute.value(), "false")) &&
equalIgnoringCase(fastGetAttribute(HTMLNames::undoscopeAttr), "true"))
> +	   createUndoManager();

When contenteditable attribute is set, we need to disconnect existing undo
manager in the subtree.


More information about the webkit-reviews mailing list