[webkit-changes] [WebKit/WebKit] 268abc: Replace ParserContentPolicy with OptionSet

Ryosuke Niwa noreply at github.com
Sat Sep 24 22:01:32 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 268abc73e5c3102aeb56d33423d3fefced964092
      https://github.com/WebKit/WebKit/commit/268abc73e5c3102aeb56d33423d3fefced964092
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2022-09-24 (Sat, 24 Sep 2022)

  Changed paths:
    M Source/WebCore/dom/DocumentFragment.cpp
    M Source/WebCore/dom/DocumentFragment.h
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/FragmentScriptingPermission.h
    M Source/WebCore/dom/Range.cpp
    M Source/WebCore/dom/ScriptableDocumentParser.cpp
    M Source/WebCore/dom/ScriptableDocumentParser.h
    M Source/WebCore/dom/ShadowRoot.cpp
    M Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
    M Source/WebCore/editing/gtk/WebContentReaderGtk.cpp
    M Source/WebCore/editing/libwpe/EditorLibWPE.cpp
    M Source/WebCore/editing/markup.cpp
    M Source/WebCore/editing/markup.h
    M Source/WebCore/html/parser/HTMLConstructionSite.cpp
    M Source/WebCore/html/parser/HTMLConstructionSite.h
    M Source/WebCore/html/parser/HTMLDocumentParser.cpp
    M Source/WebCore/html/parser/HTMLDocumentParser.h
    M Source/WebCore/html/parser/HTMLTreeBuilder.cpp
    M Source/WebCore/html/parser/HTMLTreeBuilder.h
    M Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
    M Source/WebCore/xml/parser/XMLDocumentParser.cpp
    M Source/WebCore/xml/parser/XMLDocumentParser.h
    M Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
    M Source/WebKitLegacy/mac/WebView/WebFrame.mm

  Log Message:
  -----------
  Replace ParserContentPolicy with OptionSet
https://bugs.webkit.org/show_bug.cgi?id=245630

Reviewed by Darin Adler.

Make ParserContentPolicy enum class and use its OptionSet instead. The old values convert to new values as follows:

* DisallowScriptingAndPluginContent -> { }
* DisallowScriptingContent -> { ParserContentPolicy::AllowPluginContent }
* AllowScriptingContent -> { ParserContentPolicy::AllowScriptingContent, ParserContentPolicy::AllowPluginContent }
* AllowScriptingContentAndDoNotMarkAlreadyStarted ->
    { ParserContentPolicy::AllowScriptingContent, ParserContentPolicy::AllowPluginContent,
    ParserContentPolicy::DoNotMarkAlreadyStarted }

* Source/WebCore/dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::parseHTML):
(WebCore::DocumentFragment::parseXML):
* Source/WebCore/dom/DocumentFragment.h:
(WebCore::DocumentFragment::parseHTML):
(WebCore::DocumentFragment::parseXML):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::setOuterHTML):
(WebCore::Element::setInnerHTML):
(WebCore::Element::insertAdjacentHTML):
* Source/WebCore/dom/FragmentScriptingPermission.h:
(WebCore::scriptingContentIsAllowed):
(WebCore::disallowScriptingContent):
(WebCore::pluginContentIsAllowed):
(WebCore::allowPluginContent):
(): Deleted.
* Source/WebCore/dom/Range.cpp:
(WebCore::Range::createContextualFragment):
* Source/WebCore/dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
* Source/WebCore/dom/ScriptableDocumentParser.h:
(WebCore::ScriptableDocumentParser::parserContentPolicy):
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
* Source/WebCore/dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setInnerHTML):
* Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment):
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readWebArchive):
(WebCore::WebContentReader::readHTML):
* Source/WebCore/editing/gtk/WebContentReaderGtk.cpp:
(WebCore::WebContentReader::readFilePath):
(WebCore::WebContentReader::readHTML):
* Source/WebCore/editing/libwpe/EditorLibWPE.cpp:
(WebCore::createFragmentFromPasteboardData):
* Source/WebCore/editing/markup.cpp:
(WebCore::sanitizeMarkup):
(WebCore::createFragmentFromMarkup):
(WebCore::createFragmentForMarkup):
(WebCore::createFragmentForInnerOuterHTML):
(WebCore::createFragmentForTransformToFragment):
(WebCore::createContextualFragment):
* Source/WebCore/editing/markup.h:
(WebCore::createFragmentFromMarkup):
* Source/WebCore/html/parser/HTMLConstructionSite.cpp:
(WebCore::setAttributes):
(WebCore::HTMLConstructionSite::HTMLConstructionSite):
(WebCore::HTMLConstructionSite::insertScriptElement):
* Source/WebCore/html/parser/HTMLConstructionSite.h:
(WebCore::HTMLConstructionSite::parserContentPolicy):
* Source/WebCore/html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::HTMLDocumentParser):
(WebCore::HTMLDocumentParser::create):
(WebCore::HTMLDocumentParser::parseDocumentFragment):
* Source/WebCore/html/parser/HTMLDocumentParser.h:
(WebCore::HTMLDocumentParser::parseDocumentFragment):
* Source/WebCore/html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
* Source/WebCore/html/parser/HTMLTreeBuilder.h:
* Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::fragmentFromCFHTML):
(WebCore::fragmentFromHTML):
* Source/WebCore/xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::parseDocumentFragment):
* Source/WebCore/xml/parser/XMLDocumentParser.h:
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::setAttributes):
(WebCore::XMLDocumentParser::XMLDocumentParser):
* Source/WebKitLegacy/mac/WebView/WebFrame.mm:
(-[WebFrame _documentFragmentWithMarkupString:baseURLString:]):

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




More information about the webkit-changes mailing list