RenderTheme does not need to be per-page
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 May 2017 05:35:04 +0000 (05:35 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 May 2017 05:35:04 +0000 (05:35 +0000)
commit5a0c53142af85771391b4a0392c46ff6316c35c8
tree5fefee112708809ead9dbdd05eb19f428e5bcc19
parenta5ec1124f12070069df7706d6dfd84fa24f9c09b
RenderTheme does not need to be per-page
https://bugs.webkit.org/show_bug.cgi?id=172116
<rdar://problem/30426457>

Reviewed by Zalan Bujtas.

There are no implementations of RenderTheme::themeForPage that actually care about the page.
It can be replaced with a singleton, simplifying a bunch of code.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::shadowRootCSSText):
(WebCore::MediaControlsHost::base64StringForIconNameAndType):
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):

    Fix a potential crash if we get here when page is null (though it doesn't appear to repro on trunk).

* css/StyleColor.cpp:
(WebCore::StyleColor::colorFromKeyword):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor):
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeSystemFont):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::updateAppearance):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::createElementRenderer):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::usesMenuList):
(WebCore::HTMLSelectElement::platformHandleKeydownEvent):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
* html/InputType.cpp:
(WebCore::InputType::themeSupportsDataListUI):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldHaveSpinButton):
(WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setStrokeColor):
(WebCore::CanvasRenderingContext2D::setFillColor):
* html/canvas/CanvasStyle.cpp:
(WebCore::parseColor):
(WebCore::parseColorOrCurrentColor):
(WebCore::CanvasStyle::createFromString):
* html/canvas/CanvasStyle.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::startTimer):
(WebCore::MediaControlPanelElement::makeOpaque):
(WebCore::MediaControlPanelElement::makeTransparent):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::reset):
(WebCore::MediaControls::reportedError):
(WebCore::MediaControls::updateCurrentTimeDisplay):
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::tryCreate):
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::theme): Deleted.
* platform/wpe/RenderThemeWPE.cpp:
(WebCore::RenderTheme::singleton):
(WebCore::RenderTheme::themeForPage): Deleted.
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::theme):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::focusRingColor):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::defaultTheme): Deleted.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderTheme::singleton):
(WebCore::RenderTheme::themeForPage): Deleted.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderTheme::singleton):
(WebCore::RenderTheme::themeForPage): Deleted.
* rendering/RenderThemeMac.mm:
(WebCore::RenderTheme::singleton):
(WebCore::RenderTheme::themeForPage): Deleted.
* rendering/RenderThemeWin.cpp:
(WebCore::RenderTheme::singleton):
(WebCore::RenderTheme::themeForPage): Deleted.
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
Source/WebCore/css/CSSDefaultStyleSheets.cpp
Source/WebCore/css/StyleColor.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/parser/CSSParser.cpp
Source/WebCore/css/parser/CSSParser.h
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMeterElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/InputType.cpp
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/html/canvas/CanvasStyle.cpp
Source/WebCore/html/canvas/CanvasStyle.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControls.cpp
Source/WebCore/html/shadow/mac/ImageControlsButtonElementMac.cpp
Source/WebCore/page/MemoryRelease.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp
Source/WebCore/platform/win/PopupMenuWin.cpp
Source/WebCore/platform/wpe/RenderThemeWPE.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeGtk.cpp
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebCore/rendering/TextPaintStyle.cpp
Source/WebKit/win/WebView.cpp