[webkit-reviews] review granted: [Bug 231410] Scroll To Text Fragment directive parsing : [Attachment 441016] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Oct 13 11:53:20 PDT 2021
Chris Dumez <cdumez at apple.com> has granted Megan Gardner
<megan_gardner at apple.com>'s request for review:
Bug 231410: Scroll To Text Fragment directive parsing
https://bugs.webkit.org/show_bug.cgi?id=231410
Attachment 441016: Patch
https://bugs.webkit.org/attachment.cgi?id=441016&action=review
--- Comment #23 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 441016
--> https://bugs.webkit.org/attachment.cgi?id=441016
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=441016&action=review
r=me with changes.
> Source/WebCore/dom/Document.h:2225
> + StringView m_fragmentDirective;
It doesn't seem right of have a StringView data member on the Document. What
guarantees that the underlying String stays alive?
We probably want to use String here and `const String&` in the getter/setter.
> Source/WebCore/dom/FragmentDirectiveParser.cpp:73
> + fragmentDirective = fragmentDirective.substring(textDirective.length(),
fragmentDirective.length());
Do you really need to specify the second parameter? Seems you want everything
after the `text=` prefix.
> Source/WebCore/dom/FragmentDirectiveParser.h:29
> +#include <wtf/IsoMalloc.h>
Should not be needed.
> Source/WebCore/dom/FragmentDirectiveParser.h:41
> + WTF_MAKE_FAST_ALLOCATED(FragmentDirectiveParser);
Should not be needed since you only stack-allocate it.
> Source/WebCore/dom/FragmentDirectiveParser.h:45
> + const Vector<ParsedTextDirective>& parsedTextDirectives() { return
m_parsedTextDirectives; };
getter should be marked as const.
> Source/WebCore/page/FrameView.cpp:2224
> + // TODO: Scroll to the range specified by the directive
Per coding style (https://webkit.org/code-style-guidelines/#comments), this
should be FIXME, not TODO.
More information about the webkit-reviews
mailing list