Skip to content
  • dino@apple.com's avatar
    Add a user agent stylesheet for plugins · 532fe3a5
    dino@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=107890
    
    Reviewed by Alexey Proskuryakov.
    
    Source/WebCore:
    
    As a step along the way to providing a Shadow DOM for plug-in elements, add a
    User Agent stylesheet that is loaded when an embed or object element is
    in the document. At the moment the stylesheet is empty.
    
    The stylesheet can be overridden by the RenderTheme or the ChromeClient, allowing
    ports to provide a custom appearance. This involved hooking up some virtual methods
    on ChromeClient, the stubs of which are already implemented in WK2.
    As a drive-by, since snapshotted plugins will need some localization I've also
    exposed the ChromeClient methods to get text labels.
    
    * CMakeLists.txt: Add plugIns.css.
    * DerivedSources.make: Ditto.
    * DerivedSources.pri: Ditto.
    * GNUmakefile.am: Ditto.
    * WebCore.gyp/WebCore.gyp: Ditto.
    * WebCore.vcproj/WebCore.vcproj: Ditto.
    * WebCore.vcxproj/WebCore.vcxproj: Ditto.
    * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
    * WebCore.xcodeproj/project.pbxproj: Ditoo.
    * css/StyleResolver.cpp:
    (WebCore::ensureDefaultStyleSheetsForElement): Load and inject new plugInsStyleSheet if there is an object or embed element.
    * css/plugIns.css: Added. Empty for now.
    * page/ChromeClient.h: New methods for querying the client.
    (WebCore::ChromeClient::plugInStartLabelTitle):
    (WebCore::ChromeClient::plugInStartLabelSubtitle):
    (WebCore::ChromeClient::plugInExtraStyleSheet):
    * rendering/RenderTheme.h:
    (WebCore::RenderTheme::extraPlugInsStyleSheet): Allow the theme to provide an extra stylesheet.
    
    Source/WebKit2:
    
    * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Rename client callbacks
    to have a "create" prefix, making it clear that these generate new Strings.
    * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: Actually call into
    the injected bundle to retrieve any custom stylesheet for plugins.
    (WebKit::InjectedBundlePageUIClient::plugInExtraStyleSheet):
    * WebProcess/WebCoreSupport/WebChromeClient.h:
    (WebChromeClient): Add override keyword onto virtual functions now
    that the base class has implementations.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    532fe3a5