Change visual look of placeholder
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2012 22:42:59 +0000 (22:42 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2012 22:42:59 +0000 (22:42 +0000)
commit208b4c18613a3dc221b4ed5950d9bd0ad921223c
tree589c52a0285b2566687e3cd4b2e2cb7906ebaa0b
parent9caf0f388bb4d56fdd7b2e8bb3d0486ff1d7120f
Change visual look of placeholder
https://bugs.webkit.org/show_bug.cgi?id=102149
<rdar://problem/12695566>

Reviewed by Darin Adler.

Move the button to the lower-right corner. Move the theming into
RenderSnapshottedPlugin for now. Eventually we will want to migrate to using the
shadow DOM instead, and the metrics of the button are needed for click passthrough.

* Resources/startButton.png: Added.
* Resources/startButton@2x.png: Added.
* Resources/startButtonPressed.png: Added.
* Resources/startButtonPressed@2x.png: Added.
* WebCore.xcodeproj/project.pbxproj: Add button images.

Maintain variables to track whether the mouse is over the button, and the rect
for the button. If the user clicks in the rect, we render a pressed button.
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore): Add named constant for bottom and right padding of the button.
(WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn):
(WebCore::RenderSnapshottedPlugIn::paintReplaced):
(WebCore::startButtonImage): Returns button image.
(WebCore::startButtonPressedImage): Returns pressed button image.
(WebCore::RenderSnapshottedPlugIn::paintButton): Draw the button image in the
lower right hand corner, but only if we are active or hovered.
(WebCore::RenderSnapshottedPlugIn::repaintButton): Stubbed to call repaint().
(WebCore::RenderSnapshottedPlugIn::handleEvent): Repaint the button if we are
hovering over the plugin rect. With a mouse down event, calculate whether the
mouse position is within the button rect.
(WebCore::RenderSnapshottedPlugIn::layout): Cache the rect representing the button
contents.
* rendering/RenderSnapshottedPlugIn.h:

Remove theming function for now.
* rendering/RenderTheme.h:
(RenderTheme):
* rendering/RenderThemeMacShared.h:
* rendering/RenderThemeMacShared.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Resources/startButton.png [new file with mode: 0644]
Source/WebCore/Resources/startButton@2x.png [new file with mode: 0644]
Source/WebCore/Resources/startButtonPressed.png [new file with mode: 0644]
Source/WebCore/Resources/startButtonPressed@2x.png [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
Source/WebCore/rendering/RenderSnapshottedPlugIn.h
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeMacShared.h
Source/WebCore/rendering/RenderThemeMacShared.mm