[webkit-reviews] review granted: [Bug 82009] [Shadow DOM] Introduce ComposedShadowTreeWalker as a successor of ReifiedTreeTraversal APIs : [Attachment 134739] ready for review

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 30 09:11:18 PDT 2012


Dimitri Glazkov (Google) <dglazkov at chromium.org> has granted Hayato Ito
<hayato at chromium.org>'s request for review:
Bug 82009: [Shadow DOM] Introduce ComposedShadowTreeWalker as a successor of
ReifiedTreeTraversal APIs
https://bugs.webkit.org/show_bug.cgi?id=82009

Attachment 134739: ready for review
https://bugs.webkit.org/attachment.cgi?id=134739&action=review

------- Additional Comments from Dimitri Glazkov (Google)
<dglazkov at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=134739&action=review


This is sooo much more elegant. Thank you for doing this! A few tweaks before
you land:

> Source/WebCore/dom/ComposedShadowTreeWalker.cpp:45
> +#ifndef NDEBUG
> +#define ASSERT_PRECONDITION() assertPrecondition()
> +#else
> +#define ASSERT_PRECONDITION()
> +#endif
> +
> +#ifndef NDEBUG
> +#define ASSERT_POSTCONDITION() assertPostcondition()
> +#else
> +#define ASSERT_POSTCONDITION()
> +#endif

The WebKit typical approach here is to declare these as empty inline-in-header
functions for #ifdef NDEBUG.

> Source/WebCore/dom/ComposedShadowTreeWalker.cpp:77
> +ComposedShadowTreeWalker
ComposedShadowTreeWalker::startedWithFirstChild(const Node* node, Policy
policy)

I think just fromFirstChild is nicer.

> Source/WebCore/dom/ComposedShadowTreeWalker.h:61
> +    void nextNode();
> +    void previousNode();

These can just be next and previous.


More information about the webkit-reviews mailing list