[webkit-changes] [WebKit/WebKit] f8eaba: Use StringView more in ScriptElement and EmailInpu...

Anne van Kesteren noreply at github.com
Wed May 31 09:43:50 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f8eaba1e91892d09b40add74c79e92bff1a8fc49
      https://github.com/WebKit/WebKit/commit/f8eaba1e91892d09b40add74c79e92bff1a8fc49
  Author: Anne van Kesteren <annevk at annevk.nl>
  Date:   2023-05-31 (Wed, 31 May 2023)

  Changed paths:
    M Source/WebCore/dom/ScriptElement.cpp
    M Source/WebCore/dom/ScriptElement.h
    M Source/WebCore/html/EmailInputType.cpp
    M Source/WebCore/html/HTMLScriptElement.cpp
    M Source/WebCore/html/HTMLScriptElement.h
    M Source/WebCore/svg/SVGScriptElement.h

  Log Message:
  -----------
  Use StringView more in ScriptElement and EmailInputType
https://bugs.webkit.org/show_bug.cgi?id=257500
rdar://110047074

Reviewed by Darin Adler.

Move the logic for the for and event attributes to HTMLScriptElement as
SVGScriptElement does not have to care for them and also avoid going
from AtomString to String and then allocating a new String when
trimming.

As RegularExpression::match() already takes a StringView make
isValidEmailAddress() match that.

* Source/WebCore/dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::isScriptForEventSupported const): Deleted.
* Source/WebCore/dom/ScriptElement.h:
(WebCore::ScriptElement::isScriptPreventedByForAndEventAttributes const):
* Source/WebCore/html/EmailInputType.cpp:
(WebCore::isValidEmailAddress):
(WebCore::EmailInputType::typeMismatchFor const):
* Source/WebCore/html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::isScriptPreventedByForAndEventAttributes const):
(WebCore::HTMLScriptElement::forAttributeValue const): Deleted.
(WebCore::HTMLScriptElement::eventAttributeValue const): Deleted.
* Source/WebCore/html/HTMLScriptElement.h:
* Source/WebCore/svg/SVGScriptElement.h:

Canonical link: https://commits.webkit.org/264736@main




More information about the webkit-changes mailing list