Commit eb14de0a authored by tkent@chromium.org's avatar tkent@chromium.org
Browse files

[Chromium] Rendering error of spin buttons on layers

https://bugs.webkit.org/show_bug.cgi?id=54427

Reviewed by Darin Fisher.

Source/WebCore:

Test: fast/forms/input-appearance-spinbutton-layer.html

* rendering/RenderThemeChromiumWin.cpp:
  Add checks for multiple ThemePainter instances.
(WebCore::RenderThemeChromiumWin::paintInnerSpinButton):
  Avoid to create multiple ThemePainter instances.

LayoutTests:

* fast/forms/input-appearance-spinbutton-layer.html: Added.
* platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.checksum: Added.
* platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.png: Added.
* platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.txt: Added.
* platform/gtk/Skipped:
* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 37bdf9c8
2011-02-15 Kent Tamura <tkent@chromium.org>
Reviewed by Darin Fisher.
[Chromium] Rendering error of spin buttons on layers
https://bugs.webkit.org/show_bug.cgi?id=54427
* fast/forms/input-appearance-spinbutton-layer.html: Added.
* platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.checksum: Added.
* platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.png: Added.
* platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.txt: Added.
* platform/gtk/Skipped:
* platform/qt/Skipped:
2011-02-15 Martin Robinson <mrobinson@igalia.com>
 
Skip all Hixie SVG performance tests on GTK+. They seem
<!DOCTYPE html>
<body>
<!-- The following two input fields should look identical except opacity.
We had a bug about spin button rendering on a layer. -->
<input type=number value=10 style="opacity:0.999999"><br>
<input type=number value=10 style="opacity:1.0">
</body>
......@@ -1978,6 +1978,7 @@ media/video-zoom-controls.html
# Need to implement inner-spin-button or outer-spin-button
fast/forms/input-appearance-spinbutton-disabled-readonly.html
fast/forms/input-appearance-spinbutton-layer.html
fast/forms/input-number-events.html
fast/forms/input-spinbutton-capturing.html
......
8cd7e8b4122953cc9225f45daf3d9348
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x62
RenderBlock {HTML} at (0,0) size 800x62
RenderBody {BODY} at (8,8) size 784x46
RenderBR {BR} at (129,2) size 0x18
RenderTextControl {INPUT} at (2,25) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
RenderBlock {DIV} at (105,2) size 0x15
RenderBlock {DIV} at (109,2) size 13x15
RenderText {#text} at (0,0) size 0x0
layer at (13,36) size 101x13
RenderBlock {DIV} at (3,3) size 101x13
RenderText {#text} at (1,0) size 14x13
text run at (1,0) width 14: "10"
layer at (10,10) size 125x19
RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
RenderBlock {DIV} at (105,2) size 0x15
RenderBlock {DIV} at (109,2) size 13x15
layer at (13,13) size 101x13
RenderBlock {DIV} at (3,3) size 101x13
RenderText {#text} at (1,0) size 14x13
text run at (1,0) width 14: "10"
......@@ -4791,6 +4791,7 @@ fast/text/bidi-explicit-embedding-past-end.html
# Need to implement inner-spin-button or outer-spin-button
fast/forms/input-appearance-spinbutton-disabled-readonly.html
fast/forms/input-appearance-spinbutton-layer.html
fast/forms/input-number-events.html
fast/forms/input-spinbutton-capturing.html
......
2011-02-15 Kent Tamura <tkent@chromium.org>
Reviewed by Darin Fisher.
[Chromium] Rendering error of spin buttons on layers
https://bugs.webkit.org/show_bug.cgi?id=54427
Test: fast/forms/input-appearance-spinbutton-layer.html
* rendering/RenderThemeChromiumWin.cpp:
Add checks for multiple ThemePainter instances.
(WebCore::RenderThemeChromiumWin::paintInnerSpinButton):
Avoid to create multiple ThemePainter instances.
2011-02-15 Chris Rogers <crogers@google.com>
 
Reviewed by Kenneth Russell.
......@@ -62,10 +62,15 @@ namespace WebCore {
static const int kStandardMenuListButtonWidth = 17;
namespace {
// We must not create multiple ThemePainter instances.
class ThemePainter {
public:
ThemePainter(GraphicsContext* context, const IntRect& r)
{
#ifndef NDEBUG
ASSERT(!s_hasInstance);
s_hasInstance = true;
#endif
TransparencyWin::TransformMode transformMode = getTransformMode(context->getCTM());
m_helper.init(context, getLayerMode(context, transformMode), transformMode, r);
......@@ -85,6 +90,9 @@ public:
~ThemePainter()
{
m_helper.composite();
#ifndef NDEBUG
s_hasInstance = false;
#endif
}
GraphicsContext* context() { return m_helper.context(); }
......@@ -120,8 +128,15 @@ private:
}
TransparencyWin m_helper;
#ifndef NDEBUG
static bool s_hasInstance;
#endif
};
#ifndef NDEBUG
bool ThemePainter::s_hasInstance = false;
#endif
} // namespace
static void getNonClientMetrics(NONCLIENTMETRICS* metrics)
......@@ -707,23 +722,28 @@ bool RenderThemeChromiumWin::paintInnerSpinButton(RenderObject* object, const Pa
{
IntRect half = rect;
half.setHeight(rect.height() / 2);
const ThemeData& upThemeData = getThemeData(object, SpinButtonUp);
ThemePainter upPainter(info.context, half);
PlatformBridge::paintSpinButton(upPainter.context(),
upThemeData.m_part,
upThemeData.m_state,
upThemeData.m_classicState,
upPainter.drawRect());
half.setY(rect.y() + rect.height() / 2);
const ThemeData& downThemeData = getThemeData(object, SpinButtonDown);
ThemePainter downPainter(info.context, half);
PlatformBridge::paintSpinButton(downPainter.context(),
downThemeData.m_part,
downThemeData.m_state,
downThemeData.m_classicState,
downPainter.drawRect());
// Need explicit blocks to avoid to create multiple ThemePainter instances.
{
half.setHeight(rect.height() / 2);
const ThemeData& upThemeData = getThemeData(object, SpinButtonUp);
ThemePainter upPainter(info.context, half);
PlatformBridge::paintSpinButton(upPainter.context(),
upThemeData.m_part,
upThemeData.m_state,
upThemeData.m_classicState,
upPainter.drawRect());
}
{
half.setY(rect.y() + rect.height() / 2);
const ThemeData& downThemeData = getThemeData(object, SpinButtonDown);
ThemePainter downPainter(info.context, half);
PlatformBridge::paintSpinButton(downPainter.context(),
downThemeData.m_part,
downThemeData.m_state,
downThemeData.m_classicState,
downPainter.drawRect());
}
return false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment