[webkit-reviews] review granted: [Bug 239335] Require an existing AtomString for HTMLFormElement's named getter parameter : [Attachment 457630] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 14 13:01:09 PDT 2022


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 239335: Require an existing AtomString for HTMLFormElement's named getter
parameter
https://bugs.webkit.org/show_bug.cgi?id=239335

Attachment 457630: Patch

https://bugs.webkit.org/attachment.cgi?id=457630&action=review




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

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

> Source/WebCore/html/HTMLFormElement.cpp:936
> +    if (name.isEmpty())
> +	   return { };

This further optimizes the null and empty string cases, but slows down all the
non-empty cases. I don’t think it’s needed for correctness, unless I missed
something. I suppose it’s a good idea.

> Source/WebCore/html/HTMLFormElement.idl:42
> +    getter (RadioNodeList or Element)? ([RequiresExistingAtomString]
DOMString name);

Want to be sure these are good optimizations. I think I made
RequiresExistingAtomString, and it’s obviously helpful if people often look for
something that doesn’t exist, but it might *slightly* slow down the case of
looking for things that do exist.


More information about the webkit-reviews mailing list