[EFL] Move codes related to theme setting from Widget to RenderTheme
https://bugs.webkit.org/show_bug.cgi?id=89842

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

WebKit/Efl uses custom theme for Scrollbar, RenderTheme and Cursor.
However, theme information itself is in WidgetEfl so it is accessed by
calling recursive function.
Because theme is managed by each page, this patch moves codes related to
theme from WidgetEfl to RenderThemeEfl which is contained by page.

* platform/Widget.h: Removed functions related to theme.
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::setThemePath): Added to set theme path.
(WebCore::RenderThemeEfl::createEdje): Updated method to use RenderThemeEfl's theme.
(WebCore::RenderThemeEfl::RenderThemeEfl):
* platform/efl/RenderThemeEfl.h:
(WebCore::RenderThemeEfl::themePath): Added to get theme path
* platform/efl/ScrollbarEfl.cpp: Updated method to use RenderThemeEfl's theme.
(ScrollbarEfl::setParent):
* platform/efl/WidgetEfl.cpp: Removed codes related theme.
(WidgetPrivate):

Source/WebKit:

* CMakeLists.txt: Added html/shadow to WebKit_INCLUDE_DIRECTORIES.

Source/WebKit/efl:

* ewk/ewk_frame.cpp:
(ewk_frame_view_create_for_view): Removed codes which set theme in FrameView.
* ewk/ewk_view.cpp:
(ewk_view_theme_set): Called RenderThemeEfl::setThemePath instead of setting theme in FrameView.

Source/WebKit2:

* CMakeLists.txt: Added html/shadow to WebKit_INCLUDE_DIRECTORIES.
* WebProcess/WebPage/efl/WebPageEfl.cpp:
(WebKit::WebPage::setThemePath): Called RenderThemeEfl::setThemePath instead of setting theme in FrameView.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed buildfix from Zoltan Herczeg after 122768.

* dfg/DFGCCallHelpers.h:
(JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
(CCallHelpers):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed chromium tests rebaselines after r122785.

* platform/chromium-linux-x86/fast/borders/border-image-scaled-gradient-expected.png: Added.
* platform/chromium-linux-x86/fast/reflections/reflection-with-zoom-expected.png: Copied from LayoutTests/platform/chromium-linux/fast/reflections/reflection-with-zoom-expected.png.
* platform/chromium-linux/fast/borders/border-image-scaled-gradient-expected.png:
* platform/chromium-linux/fast/css/transformed-mask-expected.png:
* platform/chromium-linux/fast/gradients/css3-linear-angle-gradients-expected.png:
* platform/chromium-linux/fast/gradients/css3-linear-right-angle-gradients-expected.png:
* platform/chromium-linux/fast/gradients/css3-radial-gradients-expected.png:
* platform/chromium-linux/fast/gradients/css3-radial-gradients2-expected.png:
* platform/chromium-linux/fast/gradients/css3-repeating-linear-gradients-expected.png:
* platform/chromium-linux/fast/gradients/css3-repeating-radial-gradients-expected.png:
* platform/chromium-linux/fast/reflections/reflection-with-zoom-expected.png:
* platform/chromium-mac-snowleopard/fast/borders/border-image-scaled-gradient-expected.png: Added.
* platform/chromium-mac-snowleopard/fast/css/transformed-mask-expected.png:
* platform/chromium-mac-snowleopard/fast/reflections/reflection-with-zoom-expected.png:
* platform/chromium-mac/fast/borders/border-image-scaled-gradient-expected.png:
* platform/chromium-mac/fast/css/transformed-mask-expected.png:
* platform/chromium-mac/fast/gradients/border-image-gradient-sides-and-corners-expected.png:
* platform/chromium-mac/fast/gradients/css3-linear-angle-gradients-expected.png:
* platform/chromium-mac/fast/gradients/css3-linear-right-angle-gradients-expected.png:
* platform/chromium-mac/fast/gradients/css3-radial-gradients-expected.png:
* platform/chromium-mac/fast/gradients/css3-repeating-linear-gradients-expected.png:
* platform/chromium-mac/fast/gradients/css3-repeating-radial-gradients-expected.png:
* platform/chromium-mac/fast/reflections/reflection-with-zoom-expected.png:
* platform/chromium-win-xp/fast/borders/border-image-scaled-gradient-expected.png: Added.
* platform/chromium-win-xp/fast/reflections/reflection-with-zoom-expected.png: Copied from LayoutTests/platform/chromium-linux/fast/reflections/reflection-with-zoom-expected.png.
* platform/chromium-win/fast/borders/border-image-scaled-gradient-expected.png:
* platform/chromium-win/fast/css/transformed-mask-expected.png:
* platform/chromium-win/fast/gradients/border-image-gradient-sides-and-corners-expected.png:
* platform/chromium-win/fast/gradients/css3-linear-angle-gradients-expected.png:
* platform/chromium-win/fast/gradients/css3-linear-right-angle-gradients-expected.png:
* platform/chromium-win/fast/gradients/css3-radial-gradients-expected.png:
* platform/chromium-win/fast/gradients/gradient-after-transparent-border-expected.png:
* platform/chromium-win/fast/reflections/reflection-with-zoom-expected.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed chromium tests rebaselines after r122791.

* platform/chromium-win/platform/chromium/compositing/scrollbars/custom-composited-different-track-parts-expected.png:
* platform/chromium-win/transforms/3d/point-mapping/3d-point-mapping-expected.png:
* platform/chromium-win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png:
* platform/chromium-win/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] TextInputController shouldn't know about TestShell
https://bugs.webkit.org/show_bug.cgi?id=91455

Reviewed by Kent Tamura.

This patch uses the same pattern we used for the
AccessibilityController to remove the dependency on TestShell.

* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::initialize):
(TestShell::createMainWindow):
(TestShell::~TestShell):
* DumpRenderTree/chromium/TextInputController.cpp:
(TextInputController::TextInputController):
(TextInputController::insertText):
(TextInputController::doCommand):
(TextInputController::setMarkedText):
(TextInputController::unmarkText):
(TextInputController::hasMarkedText):
(TextInputController::markedRange):
(TextInputController::selectedRange):
(TextInputController::firstRectForCharacterRange):
(TextInputController::validAttributesForMarkedText):
(TextInputController::setComposition):
* DumpRenderTree/chromium/TextInputController.h:
(WebKit):
(TextInputController):
(TextInputController::setWebView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Move TextInputController into TestRunner.a
https://bugs.webkit.org/show_bug.cgi?id=91457

Reviewed by Ryosuke Niwa.

This patch is purely moving code. TextInputController is one of the
objects exposed to JavaScript and so should be in the TestRunner
library.

* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/chromium/TestRunner/TextInputController.cpp: Renamed from Tools/DumpRenderTree/chromium/TextInputController.cpp.
* DumpRenderTree/chromium/TestRunner/TextInputController.h: Renamed from Tools/DumpRenderTree/chromium/TextInputController.h.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Internals: Remove injectPagePopupController()
https://bugs.webkit.org/show_bug.cgi?id=91471

Reviewed by Hajime Morita.

r122558 introduced injectPagePopupController(), however we'd like to
avoid adding such JavaScript binding code. We can avoid it by exposing a
PagePopupController for a mock and injecting the following code to the
popup document:

<script>window.pagePopupController = window.internals.pagePopupController</script>

No new tests. This is a kind of refactoring.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::pagePopupController):
Added. Accessor for PagePopupControler owned by the MockPagePopupDriver.
* testing/InternalSettings.h:
(InternalSettings): Declare pagePopupController() for Internals::pagePopupController().
* testing/Internals.cpp:
(WebCore::Internals::pagePopupController):
Added. This uses InternalSettings::pagePopupController().
* testing/Internals.h:
(Internals): Declare pagePopupController() for Internals.idl.
* testing/Internals.idl: Declare pagePopupController.

* testing/MockPagePopupDriver.cpp:
Moved m_pagePopupController from MockPagePopup to MockPagePopupDriver.
(WebCore::MockPagePopup::MockPagePopup):
Added a script element to prepare window.pagePopupController.
Removed a callsite of injectPagePopupController().
(WebCore::MockPagePopupDriver::openPagePopup):
(WebCore::MockPagePopupDriver::closePagePopup):
* testing/MockPagePopupDriver.h:
(WebCore::MockPagePopupDriver::pagePopupController):
Accessor for a PagePopupController object.
(MockPagePopupDriver): Add RefPtr<PagePopupController> data member.

* testing/v8/WebCoreTestSupport.cpp: Remove injectPagePopupController().
* testing/v8/WebCoreTestSupport.h: ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Shadow DOM for img element
https://bugs.webkit.org/show_bug.cgi?id=90532

Reviewed by Hajime Morita.

Source/WebCore:

This patch adds Shadow DOM support for img element.

According to the Shadow DOM spec, img element should behave like having a user agent Shadow DOM.
However, if we add Shadow DOM to img by default, it will cause performance regression and memory bloat.

So, we would like to postpone adding a Shadow DOM to img until when we really need it. In other words,
we add our User Agent Shadow DOM to img just before a user adds Author Shadow DOM.

The User Agent Shadow DOM for img has only one element, which displays an image. If img has
a Shadow DOM, img will behave like <span style="display: inline-block"> by default. The display style can
be chagned using CSS though.

This patch also adds ImageLoaderClient. The element we render an image and the element we take an argument
from were the same, however not they might be different. We would like to encapsulate the fact into
ImageLoaderClient.

Tests: fast/dom/shadow/shadowdom-for-image-alt-update.html
       fast/dom/shadow/shadowdom-for-image-alt.html
       fast/dom/shadow/shadowdom-for-image-content.html
       fast/dom/shadow/shadowdom-for-image-dynamic.html
       fast/dom/shadow/shadowdom-for-image-event-click.html
       fast/dom/shadow/shadowdom-for-image-in-shadowdom.html
       fast/dom/shadow/shadowdom-for-image-map.html
       fast/dom/shadow/shadowdom-for-image-style.html
       fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html
       fast/dom/shadow/shadowdom-for-image-with-width-and-height.html
       fast/dom/shadow/shadowdom-for-image.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/html.css:
(img):
* html/HTMLImageElement.cpp:
(WebCore::ImageElement::setImageIfNecessary):
(WebCore):
(WebCore::ImageElement::createRendererForImage):
(WebCore::HTMLImageElement::willAddAuthorShadowRoot): When we don't have a user agent Shadow DOM yet
we add it.
(WebCore::HTMLImageElement::createShadowSubtree):
(WebCore::HTMLImageElement::imageElement):
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::createRenderer): If a user agent Shadow DOM is attached, we create
Renderer from style, instead of creating RenderImage.
(WebCore::HTMLImageElement::attach):
(WebCore::HTMLImageElement::innerElement):
* html/HTMLImageElement.h:
(WebCore):
(ImageElement):
(HTMLImageElement):
(WebCore::HTMLImageElement::sourceElement):
(WebCore::HTMLImageElement::refSourceElement):
(WebCore::HTMLImageElement::derefSourceElement):
(WebCore::HTMLImageElement::imageRenderer):
(WebCore::HTMLImageElement::imageLoader):
(WebCore::isHTMLImageElement):
(WebCore::toHTMLImageElement):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::HTMLImageLoader):
(WebCore::HTMLImageLoader::dispatchLoadEvent):
(WebCore::HTMLImageLoader::sourceURI):
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLImageLoader.h:
(HTMLImageLoader):
* html/HTMLInputElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPlugInElement.h:
* html/HTMLTagNames.in:
* html/HTMLVideoElement.h:
* html/shadow/ImageInnerElement.cpp: Added.
(WebCore):
(WebCore::ImageInnerElement::ImageInnerElement):
(WebCore::ImageInnerElement::hostImage):
(WebCore::ImageInnerElement::imageLoader):
(WebCore::ImageInnerElement::attach):
(WebCore::ImageInnerElement::createRenderer):
* html/shadow/ImageInnerElement.h: Added.
(WebCore):
(ImageInnerElement):
(WebCore::ImageInnerElement::imageRenderer):
(WebCore::ImageInnerElement::create):
(WebCore::isImageInnerElement):
(WebCore::toImageInnerElement):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::ImageLoader):
(WebCore::ImageLoader::~ImageLoader):
(WebCore):
(WebCore::ImageLoader::document):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::renderImageResource):
(WebCore::ImageLoader::updatedHasPendingLoadEvent):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
(WebCore::ImageLoader::dispatchPendingLoadEvent):
(WebCore::ImageLoader::dispatchPendingErrorEvent):
* loader/ImageLoader.h:
(WebCore):
(ImageLoader):
(WebCore::ImageLoader::client):
* loader/ImageLoaderClient.h: Added.
(WebCore):
(ImageLoaderClient): Provides the necessary interfaces to ImageLoader.
(WebCore::ImageLoaderClient::~ImageLoaderClient):
(ImageLoaderClientBase):
(WebCore::ImageLoaderClientBase::sourceElement):
(WebCore::ImageLoaderClientBase::imageElement):
(WebCore::ImageLoaderClientBase::refSourceElement):
(WebCore::ImageLoaderClientBase::derefSourceElement):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::imageMap):
(WebCore::RenderImage::updateAltText):
(WebCore::RenderImage::hostImageElement):
(WebCore):
* rendering/RenderImage.h:
(WebCore):
(RenderImage):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldRespectImageOrientation):
* svg/SVGImageElement.h:
(SVGImageElement):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::SVGImageLoader):
(WebCore::SVGImageLoader::dispatchLoadEvent):
(WebCore::SVGImageLoader::sourceURI):
* svg/SVGImageLoader.h:
(SVGImageLoader):

LayoutTests:

Contains the following test cases.
(1) ShadowDOM is attached to an img element and use a shadow element
(2) ShadowDOM is attached to an img element and use a content element
(3) width and height are specified
(4) src attribute is dynamically changed
(5) multiple ShadowDOMs are attached to an img element
(6) ShadowDOM is attached to an img element in Shadow DOM
(7) event retargetting
(8) img with display: none, display: inline, display: block
(9) image map
(10) alt text
(11) alt text with dynamic update

* fast/dom/shadow/shadowdom-for-image-alt-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-alt-update-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-alt-update.html: Added.
* fast/dom/shadow/shadowdom-for-image-alt.html: Added.
* fast/dom/shadow/shadowdom-for-image-content-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-content.html: Added.
* fast/dom/shadow/shadowdom-for-image-dynamic-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-dynamic.html: Added.
* fast/dom/shadow/shadowdom-for-image-event-click-expected.txt: Added.
* fast/dom/shadow/shadowdom-for-image-event-click.html: Added.
* fast/dom/shadow/shadowdom-for-image-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-in-shadowdom-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-in-shadowdom.html: Added.
* fast/dom/shadow/shadowdom-for-image-map-expected.txt: Added.
* fast/dom/shadow/shadowdom-for-image-map.html: Added.
* fast/dom/shadow/shadowdom-for-image-style-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-style.html: Added.
* fast/dom/shadow/shadowdom-for-image-with-multiple-shadow-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html: Added.
* fast/dom/shadow/shadowdom-for-image-with-width-and-height-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-with-width-and-height.html: Added.
* fast/dom/shadow/shadowdom-for-image.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122824 268f45cc-cd09-0410-ab3c-d52691b4dbfc