[webkit-changes] [WebKit/WebKit] 252a60: Combine Base64DecodeOptions and Base64DecodeMode

Anne van Kesteren noreply at github.com
Mon Apr 24 00:00:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 252a605f349215717db4711cc3bfb7b7ea3bf446
      https://github.com/WebKit/WebKit/commit/252a605f349215717db4711cc3bfb7b7ea3bf446
  Author: Anne van Kesteren <annevk at annevk.nl>
  Date:   2023-04-23 (Sun, 23 Apr 2023)

  Changed paths:
    M Source/JavaScriptCore/jsc.cpp
    M Source/WTF/wtf/text/Base64.cpp
    M Source/WTF/wtf/text/Base64.h
    M Source/WebCore/page/Base64Utilities.cpp
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp
    M Source/WebCore/platform/network/DataURLDecoder.cpp
    M Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp
    M Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp
    M Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm
    M Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm

  Log Message:
  -----------
  Combine Base64DecodeOptions and Base64DecodeMode
https://bugs.webkit.org/show_bug.cgi?id=255479
rdar://108082420

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=184529#c11 gave a bunch of feedback that was unfortunately
overlooked. This attempts to address it. In particular:

* Using WebKit's isUnicodeCompatibleASCIIWhitespace was an accident and not intentional. All callers
  want isASCIIWhitespace (which excludes U+000B (\v)).
* The isLatin1() check was thought to be needed to address a test, but that wasn't actually the
  case.

Additionally this folds Base64DecodeOptions into Base64DecodeMode reducing the number of decoding
variants we offer to callers and making them more explicit.

We might be able to shrink that even more with some additional investigation, in particular as part
of properly standardizing CSP and SRI base64/base64url requirements.

Base64EncodeMap is renamed to Base64EncodeMode for parity.

* Source/JavaScriptCore/jsc.cpp:
(JSC_DEFINE_HOST_FUNCTION):
* Source/WTF/wtf/text/Base64.cpp:
(WTF::base64EncodeInternal):
(WTF::base64Encode):
(WTF::base64EncodeToVector):
(WTF::base64EncodeToString):
(WTF::base64DecodeInternal):
(WTF::base64Decode):
* Source/WTF/wtf/text/Base64.h:
(WTF::base64EncodeToVector):
(WTF::base64EncodeToString):
(WTF::base64Decode):
(WTF::base64URLEncodeToVector):
(WTF::base64URLEncodeToString):
(WTF::base64URLDecode):
(WTF::calculateBase64EncodedSize):
(WTF::base64Encoded):
(WTF::base64URLEncoded):
(WTF::StringTypeAdapter<Base64Specification>::writeTo const):
* Source/WebCore/page/Base64Utilities.cpp:
(WebCore::Base64Utilities::atob):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):

https://bugs.webkit.org/show_bug.cgi?id=255442 covers cleaning this up further, but this at least
aligns it with data: URL requirements.

* Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::extractSinfData):
* Source/WebCore/platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::decodeSynchronously):
* Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp:
(WebKit::RemoteWebInspectorUIProxy::platformSave):
* Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp:
(WebKit::WebInspectorUIProxy::platformSave):
* Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
(WebKit::WebInspectorUIProxy::showSavePanel):
* Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::save):

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




More information about the webkit-changes mailing list