Document should always have a Settings.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2017 17:47:33 +0000 (17:47 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2017 17:47:33 +0000 (17:47 +0000)
commit435ac49e6070d1d293d9355d48998c93ada124ff
tree8836b44537698e1aafd96c4e2a5dcf93b9733be1
parent91e23b3c9831f5f6dd9c8be944ab3b127934bb35
Document should always have a Settings.
<https://webkit.org/b/120172>

Reviewed by Antti Koivisto.

Since a Document can't move between Frames, and it's either frameless
or partnered with a Frame provided at construction time, we know that
it will never need to switch between different Settings objects either.

Give Document a Ref<Settings> that contains either the Frame's Settings
or a default-constructed Settings object if frameless.
Document::settings() is promoted to a reference getter.

The bulk of this patch is removing now-unnecessary null checks.

* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
* Modules/plugins/PluginReplacement.h:
(WebCore::ReplacementPlugin::isEnabledBySettings):
* Modules/plugins/QuickTimePluginReplacement.h:
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::isEnabledBySettings):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::isEnabledBySettings):
* Modules/plugins/YouTubePluginReplacement.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon):
* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::requestScriptWithCache):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::appendSources):
(WebCore::CSSFontFace::webFontsShouldAlwaysFallBack):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::fallbackFontCount):
(WebCore::CSSFontSelector::fallbackFontAt):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertResize):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontFamily):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::defaultStyleForElement):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::checkForGenericFamilyChange):
(WebCore::StyleResolver::initializeFontStyle):
* css/StyleResolver.h:
(WebCore::StyleResolver::settings):
(WebCore::StyleResolver::documentSettings): Deleted.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::setReadyState):
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::defaultCharsetForLegacyBindings):
(WebCore::Document::recalcStyle):
(WebCore::Document::implicitClose):
(WebCore::Document::minimumLayoutDelay):
(WebCore::Document::setDomain):
(WebCore::Document::audioPlaybackRequiresUserGesture):
(WebCore::Document::videoPlaybackRequiresUserGesture):
(WebCore::Document::storageBlockingStateDidChange):
(WebCore::Document::isTelephoneNumberParsingEnabled):
(WebCore::Document::initSecurityContext):
(WebCore::Document::initDNSPrefetch):
(WebCore::Document::getCachedLocale):
(WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox):
(WebCore::Document::settings): Deleted.
* dom/Document.h:
(WebCore::Document::settings):
* dom/Element.cpp:
(WebCore::subpixelMetricsEnabled):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::pageUserSheet):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::dispatchErrorEvent):
* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::requestAnimationFrameEnabled):
* dom/make_names.pl:
(printConstructorInterior):
* editing/Editor.cpp:
* editing/markup.cpp:
(WebCore::createMarkupInternal):
* html/FTPDirectoryDocument.cpp:
(WebCore::createTemplateDocumentData):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setActive):
(WebCore::HTMLAnchorElement::sendPings):
(WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::canEmbedJava):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::shouldEnableWebGL):
(WebCore::HTMLCanvasElement::shouldAccelerate):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submitImplicitly):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::setLocation):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::updateImageControls):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::sourceURI):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
(WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks):
(WebCore::HTMLMediaElement::mediaPlayerNetworkInterfaceName):
(WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
(WebCore::HTMLMediaElement::doesHaveAttribute):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::HTMLVideoElement):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
(WebCore::MediaElementSession::allowsAutomaticMediaDataLoading):
(WebCore::MediaElementSession::allowsPictureInPicture):
(WebCore::MediaElementSession::maximumMediaSourceBufferSize):
* html/parser/HTMLParserOptions.cpp:
(WebCore::HTMLParserOptions::HTMLParserOptions):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::toggleSimpleLineLayout):
* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::computedFontSizeFromSpecifiedSize):
(WebCore::Style::fontSizeForKeyword):
(WebCore::Style::legacyFontSizeForPixelSize):
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
47 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
Source/WebCore/Modules/plugins/PluginReplacement.h
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm
Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp
Source/WebCore/Modules/plugins/YouTubePluginReplacement.h
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/bindings/js/CachedScriptFetcher.cpp
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/css/parser/CSSParser.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/ExtensionStyleSheets.cpp
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptableDocumentParser.cpp
Source/WebCore/dom/ScriptedAnimationController.cpp
Source/WebCore/dom/make_names.pl
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLAppletElement.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLImageLoader.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/parser/HTMLParserOptions.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/loader/LinkLoader.cpp
Source/WebCore/page/csp/ContentSecurityPolicy.cpp
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebCore/style/StyleFontSizeFunctions.cpp
Source/WebCore/style/StyleScope.cpp
Source/WebCore/xml/XMLHttpRequest.cpp