Patch by Robin Qiu <robin.qiu@torchmobile.com.cn> on 2011-07-19

Reviewed by Antonio Gomes.

ScrollBar should initialize current position in constructor.
https://bugs.webkit.org/show_bug.cgi?id=39284

When ScrollBar is created, m_currentPos should be initialized to
m_scrollableArea's current scrollPosition. Because scrollbars may
be created after the content of m_scrollableArea has been scrolled.

Source/WebCore:

Test: scrollbars/scrollbar-initial-position.html

* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):

LayoutTests:

* scrollbars/scrollbar-initial-position-expected.png: Added.
* scrollbars/scrollbar-initial-position-expected.txt: Added.
* scrollbars/scrollbar-initial-position.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6a2ece20
2011-07-19 Robin Qiu <robin.qiu@torchmobile.com.cn>
Reviewed by Antonio Gomes.
ScrollBar should initialize current position in constructor.
https://bugs.webkit.org/show_bug.cgi?id=39284
When ScrollBar is created, m_currentPos should be initialized to
m_scrollableArea's current scrollPosition. Because scrollbars may
be created after the content of m_scrollableArea has been scrolled.
* scrollbars/scrollbar-initial-position-expected.png: Added.
* scrollbars/scrollbar-initial-position-expected.txt: Added.
* scrollbars/scrollbar-initial-position.html: Added.
2011-07-19 Yuta Kitamura <yutak@chromium.org>
WebSocket: Implement hybi framing
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Bug 39284 test case</title>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
</script>
<style type="text/css">
<!--
#container {
display:block;
border:1px solid black;
width:100px;
height:100px;
overflow:hidden;
padding:0px;
background-color:blue;
}
#container:hover {
overflow:auto;
}
::-webkit-scrollbar {
width: 20px;
height: 20px;
}
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
height: 0px;
display: block;
}
::-webkit-scrollbar-track-piece {
background-color: black;
}
::-webkit-scrollbar-thumb:vertical {
background-color: white;
}
-->
</style>
</head>
<body style="margin:0px;">
<div id="container">
<div style="height:200px; width:50px; background-color:red;">
</div>
<div style="height:200px; width:50px; background-color:green;">
</div>
</div>
<script>
var t = document.getElementById("container");
t.scrollTop = t.scrollHeight;
if (window.eventSender) {
eventSender.mouseMoveTo(50, 50);
eventSender.mouseMoveTo(250, 250);
eventSender.mouseMoveTo(50, 50);
}
if (window.layoutTestController)
window.layoutTestController.notifyDone();
</script>
</body>
</html>
2011-07-19 Robin Qiu <robin.qiu@torchmobile.com.cn>
Reviewed by Antonio Gomes.
ScrollBar should initialize current position in constructor.
https://bugs.webkit.org/show_bug.cgi?id=39284
When ScrollBar is created, m_currentPos should be initialized to
m_scrollableArea's current scrollPosition. Because scrollbars may
be created after the content of m_scrollableArea has been scrolled.
Test: scrollbars/scrollbar-initial-position.html
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):
2011-07-19 Yuta Kitamura <yutak@chromium.org>
WebSocket: Implement hybi framing
......@@ -97,6 +97,9 @@ Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orient
// alone when sizing).
int thickness = m_theme->scrollbarThickness(controlSize);
Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
if (m_scrollableArea)
m_currentPos = static_cast<float>(m_scrollableArea->scrollPosition(this));
}
Scrollbar::~Scrollbar()
......
Markdown is supported
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