[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
pkasting at chromium.org
pkasting at chromium.org
Wed Dec 22 12:39:25 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 591fbbf3ded7a53aeaac9b34e5e29a132557b309
Author: pkasting at chromium.org <pkasting at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 26 19:57:43 2010 +0000
Misc. cleanup split off from bug 32356.
https://bugs.webkit.org/show_bug.cgi?id=44696
Reviewed by Dimitri Glazkov.
WebCore:
* WebCore.gyp/WebCore.gyp:
* dom/Element.cpp:
(WebCore::localZoomForRenderer):
* platform/ScrollView.cpp:
(WebCore::ScrollView::wheelEvent):
* platform/ScrollView.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::scroll):
* platform/Scrollbar.h:
(WebCore::Scrollbar::isScrollbar):
* platform/ScrollbarClient.h:
(WebCore::ScrollbarClient::~ScrollbarClient):
* platform/qt/ScrollbarQt.cpp:
(WebCore::Scrollbar::contextMenu):
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scroll):
* rendering/RenderLayer.h:
* rendering/RenderListBox.h:
* rendering/RenderTextControlSingleLine.h:
WebKit/chromium:
* src/WebScrollbarImpl.cpp:
(WebKit::WebScrollbarImpl::setLocation):
(WebKit::WebScrollbarImpl::onMouseWheel):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::propagateScroll):
* src/win/WebInputEventFactory.cpp:
(WebKit::WebInputEventFactory::mouseWheelEvent):
WebKit2:
* WebProcess/WebPage/qt/WebPageQt.cpp:
(WebKit::WebPage::performDefaultBehaviorForKeyEvent):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5765b34..8453751 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,31 @@
+2010-08-26 Peter Kasting <pkasting at google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Misc. cleanup split off from bug 32356.
+ https://bugs.webkit.org/show_bug.cgi?id=44696
+
+ * WebCore.gyp/WebCore.gyp:
+ * dom/Element.cpp:
+ (WebCore::localZoomForRenderer):
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::wheelEvent):
+ * platform/ScrollView.h:
+ * platform/Scrollbar.cpp:
+ (WebCore::Scrollbar::scroll):
+ * platform/Scrollbar.h:
+ (WebCore::Scrollbar::isScrollbar):
+ * platform/ScrollbarClient.h:
+ (WebCore::ScrollbarClient::~ScrollbarClient):
+ * platform/qt/ScrollbarQt.cpp:
+ (WebCore::Scrollbar::contextMenu):
+ * rendering/RenderBox.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scroll):
+ * rendering/RenderLayer.h:
+ * rendering/RenderListBox.h:
+ * rendering/RenderTextControlSingleLine.h:
+
2010-08-26 David Hyatt <hyatt at apple.com>
Reviewed by Simon Fraser.
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index c625f5f..25ad450 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -1222,8 +1222,8 @@
'sources/': [
['exclude', 'Posix\\.cpp$'],
['include', '/opentype/'],
- ['include', '/TransparencyWin\\.cpp$'],
['include', '/SkiaFontWin\\.cpp$'],
+ ['include', '/TransparencyWin\\.cpp$'],
],
'defines': [
# Match Safari and Mozilla on Windows.
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 2d44f62..26bca23 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -273,8 +273,8 @@ static float localZoomForRenderer(RenderObject* renderer)
// FIXME: This does the wrong thing if two opposing zooms are in effect and canceled each
// other out, but the alternative is that we'd have to crawl up the whole render tree every
// time (or store an additional bit in the RenderStyle to indicate that a zoom was specified).
- float zoomFactor = 1.0f;
- if (renderer->style()->effectiveZoom() != 1.0f) {
+ float zoomFactor = 1;
+ if (renderer->style()->effectiveZoom() != 1) {
// Need to find the nearest enclosing RenderObject that set up
// a differing zoom, and then we divide our result by it to eliminate the zoom.
RenderObject* prev = renderer;
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index b39ddc1..4c01175 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -669,7 +669,7 @@ void ScrollView::wheelEvent(PlatformWheelEvent& e)
if (e.granularity() == ScrollByPageWheelEvent) {
ASSERT(deltaX == 0);
bool negative = deltaY < 0;
- deltaY = max(max<int>(visibleHeight() * Scrollbar::minFractionToStepWhenPaging(), visibleHeight() - Scrollbar::maxOverlapBetweenPages()), 1);
+ deltaY = max(max(static_cast<float>(visibleHeight()) * Scrollbar::minFractionToStepWhenPaging(), static_cast<float>(visibleHeight() - Scrollbar::maxOverlapBetweenPages())), 1.0f);
if (negative)
deltaY = -deltaY;
}
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index b7827b8..adcfaf9 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -57,7 +57,7 @@ class ScrollView : public Widget, public ScrollbarClient {
public:
~ScrollView();
- // ScrollbarClient function. FrameView overrides the other two.
+ // ScrollbarClient function. FrameView overrides the others.
virtual void valueChanged(Scrollbar*);
// The window thats hosts the ScrollView. The ScrollView will communicate scrolls and repaints to the
diff --git a/WebCore/platform/Scrollbar.cpp b/WebCore/platform/Scrollbar.cpp
index 119a9dc..ff8f66f 100644
--- a/WebCore/platform/Scrollbar.cpp
+++ b/WebCore/platform/Scrollbar.cpp
@@ -142,24 +142,20 @@ bool Scrollbar::scroll(ScrollDirection direction, ScrollGranularity granularity,
}
#endif
+ // Ignore perpendicular scrolls.
+ if ((m_orientation == HorizontalScrollbar) ? (direction == ScrollUp || direction == ScrollDown) : (direction == ScrollLeft || direction == ScrollRight))
+ return false;
float step = 0;
- if ((direction == ScrollUp && m_orientation == VerticalScrollbar) || (direction == ScrollLeft && m_orientation == HorizontalScrollbar))
- step = -1;
- else if ((direction == ScrollDown && m_orientation == VerticalScrollbar) || (direction == ScrollRight && m_orientation == HorizontalScrollbar))
- step = 1;
-
- if (granularity == ScrollByLine)
- step *= m_lineStep;
- else if (granularity == ScrollByPage)
- step *= m_pageStep;
- else if (granularity == ScrollByDocument)
- step *= m_totalSize;
- else if (granularity == ScrollByPixel)
- step *= m_pixelStep;
-
- float newPos = m_currentPos + step * multiplier;
- float maxPos = m_totalSize - m_visibleSize;
- return setCurrentPos(max(min(newPos, maxPos), 0.0f));
+ switch (granularity) {
+ case ScrollByLine: step = m_lineStep; break;
+ case ScrollByPage: step = m_pageStep; break;
+ case ScrollByDocument: step = m_totalSize; break;
+ case ScrollByPixel: step = m_pixelStep; break;
+ }
+ if (direction == ScrollUp || direction == ScrollLeft)
+ multiplier = -multiplier;
+
+ return setCurrentPos(max(min(m_currentPos + (step * multiplier), static_cast<float>(m_totalSize - m_visibleSize)), 0.0f));
}
void Scrollbar::updateThumb()
diff --git a/WebCore/platform/Scrollbar.h b/WebCore/platform/Scrollbar.h
index 6b3cd0d..f8ef96d 100644
--- a/WebCore/platform/Scrollbar.h
+++ b/WebCore/platform/Scrollbar.h
@@ -79,7 +79,7 @@ public:
void setProportion(int visibleSize, int totalSize);
void setPressedPos(int p) { m_pressedPos = p; }
- bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
+ bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
virtual void paint(GraphicsContext*, const IntRect& damageRect);
@@ -124,9 +124,6 @@ public:
virtual IntPoint convertToContainingView(const IntPoint&) const;
virtual IntPoint convertFromContainingView(const IntPoint&) const;
-private:
- virtual bool isScrollbar() const { return true; }
-
protected:
Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
@@ -142,7 +139,6 @@ protected:
ScrollGranularity pressedPartScrollGranularity();
void moveThumb(int pos);
- bool setCurrentPos(float pos);
ScrollbarClient* m_client;
ScrollbarOrientation m_orientation;
@@ -167,6 +163,11 @@ protected:
bool m_overlapsResizer;
bool m_suppressInvalidation;
+
+private:
+ virtual bool isScrollbar() const { return true; }
+
+ bool setCurrentPos(float pos);
};
}
diff --git a/WebCore/platform/ScrollbarClient.h b/WebCore/platform/ScrollbarClient.h
index 6efe72e..fa94ecc 100644
--- a/WebCore/platform/ScrollbarClient.h
+++ b/WebCore/platform/ScrollbarClient.h
@@ -34,7 +34,7 @@ namespace WebCore {
class ScrollbarClient {
public:
- virtual ~ScrollbarClient() {}
+ virtual ~ScrollbarClient() { }
virtual void valueChanged(Scrollbar*) = 0;
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0;
diff --git a/WebCore/platform/qt/ScrollbarQt.cpp b/WebCore/platform/qt/ScrollbarQt.cpp
index 70aa5db..85dc107 100644
--- a/WebCore/platform/qt/ScrollbarQt.cpp
+++ b/WebCore/platform/qt/ScrollbarQt.cpp
@@ -72,9 +72,7 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event)
const QPoint globalPos = QPoint(event.globalX(), event.globalY());
QAction* actionSelected = menu.exec(globalPos);
- if (!actionSelected)
- { /* Do nothing */ }
- else if (actionSelected == actScrollHere) {
+ if (actionSelected == actScrollHere) {
const QPoint pos = convertFromContainingWindow(event.pos());
moveThumb(horizontal ? pos.x() : pos.y());
} else if (actionSelected == actScrollTop)
@@ -82,13 +80,13 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event)
else if (actionSelected == actScrollBottom)
setValue(maximum());
else if (actionSelected == actPageUp)
- scroll(horizontal ? ScrollLeft: ScrollUp, ScrollByPage, 1);
+ scroll(horizontal ? ScrollLeft: ScrollUp, ScrollByPage);
else if (actionSelected == actPageDown)
- scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage, 1);
+ scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage);
else if (actionSelected == actScrollUp)
- scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine, 1);
+ scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine);
else if (actionSelected == actScrollDown)
- scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine, 1);
+ scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine);
#endif // QT_NO_CONTEXTMENU
return true;
}
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 392a297..d20eb84 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -246,7 +246,7 @@ public:
virtual int verticalScrollbarWidth() const;
int horizontalScrollbarHeight() const;
- virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f, Node** stopNode = 0);
+ virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
bool canBeScrolledAndHasScrollableArea() const;
virtual bool canBeProgramaticallyScrolled(bool) const;
virtual void autoscroll();
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index e07b15d..cf6d23f 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -2235,12 +2235,10 @@ bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularit
bool didVerticalScroll = false;
if (m_hBar) {
- if (granularity == ScrollByDocument) {
- // Special-case for the ScrollByDocument granularity. A document scroll can only be up
- // or down and in both cases the horizontal bar goes all the way to the left.
- didHorizontalScroll = m_hBar->scroll(ScrollLeft, ScrollByDocument, multiplier);
- } else
- didHorizontalScroll = m_hBar->scroll(direction, granularity, multiplier);
+ // Special-case for the ScrollByDocument granularity. A document scroll
+ // can only be up or down and in both cases the horizontal bar goes all
+ // the way to the left.
+ didHorizontalScroll = m_hBar->scroll((granularity == ScrollByDocument) ? ScrollLeft : direction, granularity, multiplier);
}
if (m_vBar)
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index fd4a2b5..624bad2 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -274,7 +274,7 @@ public:
void updateScrollInfoAfterLayout();
- bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
+ bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
void autoscroll();
void resize(const PlatformMouseEvent&, const IntSize&);
diff --git a/WebCore/rendering/RenderListBox.h b/WebCore/rendering/RenderListBox.h
index aafb87e..36cb87a 100644
--- a/WebCore/rendering/RenderListBox.h
+++ b/WebCore/rendering/RenderListBox.h
@@ -68,7 +68,7 @@ private:
virtual bool isPointInOverflowControl(HitTestResult&, int x, int y, int tx, int ty);
- virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f, Node** stopNode = 0);
+ virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
virtual void calcPrefWidths();
virtual int baselinePosition(bool firstLine, bool isRootLineBox) const;
diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h
index e57e37e..0deb063 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/WebCore/rendering/RenderTextControlSingleLine.h
@@ -82,7 +82,7 @@ private:
virtual int scrollHeight() const;
virtual void setScrollLeft(int);
virtual void setScrollTop(int);
- virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f, Node** stopNode = 0);
+ virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
int textBlockWidth() const;
virtual float getAvgCharWidth(AtomicString family);
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 06358c3..15b400e 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-26 Peter Kasting <pkasting at google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Misc. cleanup split off from bug 32356.
+ https://bugs.webkit.org/show_bug.cgi?id=44696
+
+ * src/WebScrollbarImpl.cpp:
+ (WebKit::WebScrollbarImpl::setLocation):
+ (WebKit::WebScrollbarImpl::onMouseWheel):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::propagateScroll):
+ * src/win/WebInputEventFactory.cpp:
+ (WebKit::WebInputEventFactory::mouseWheelEvent):
+
2010-08-26 Mikhail Naganov <mnaganov at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/src/WebScrollbarImpl.cpp b/WebKit/chromium/src/WebScrollbarImpl.cpp
index 8bf5340..c0131cb 100644
--- a/WebKit/chromium/src/WebScrollbarImpl.cpp
+++ b/WebKit/chromium/src/WebScrollbarImpl.cpp
@@ -81,7 +81,7 @@ void WebScrollbarImpl::setLocation(const WebRect& rect)
m_scrollbar->invalidate();
int length = m_scrollbar->orientation() == HorizontalScrollbar ? m_scrollbar->width() : m_scrollbar->height();
- int pageStep = max(max<int>(length * Scrollbar::minFractionToStepWhenPaging(), length - Scrollbar::maxOverlapBetweenPages()), 1);
+ int pageStep = max(max(static_cast<int>(static_cast<float>(length) * Scrollbar::minFractionToStepWhenPaging()), length - Scrollbar::maxOverlapBetweenPages()), 1);
m_scrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
m_scrollbar->setEnabled(m_scrollbar->totalSize() > length);
m_scrollbar->setProportion(length, m_scrollbar->totalSize());
@@ -214,7 +214,7 @@ bool WebScrollbarImpl::onMouseWheel(const WebInputEvent& event)
if (mousewheel.scrollByPage) {
ASSERT(m_scrollbar->orientation() == VerticalScrollbar);
bool negative = delta < 0;
- delta = max(max<int>(m_scrollbar->visibleSize() * Scrollbar::minFractionToStepWhenPaging(), m_scrollbar->visibleSize() - Scrollbar::maxOverlapBetweenPages()), 1);
+ delta = max(max(static_cast<float>(m_scrollbar->visibleSize()) * Scrollbar::minFractionToStepWhenPaging(), static_cast<float>(m_scrollbar->visibleSize() - Scrollbar::maxOverlapBetweenPages())), 1.0f);
if (negative)
delta *= -1;
}
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 383b716..5065f5e 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -823,13 +823,10 @@ bool WebViewImpl::propagateScroll(ScrollDirection scrollDirection,
if (!frame)
return false;
- bool scrollHandled =
- frame->eventHandler()->scrollOverflow(scrollDirection,
- scrollGranularity);
+ bool scrollHandled = frame->eventHandler()->scrollOverflow(scrollDirection, scrollGranularity);
Frame* currentFrame = frame;
while (!scrollHandled && currentFrame) {
- scrollHandled = currentFrame->view()->scroll(scrollDirection,
- scrollGranularity);
+ scrollHandled = currentFrame->view()->scroll(scrollDirection, scrollGranularity);
currentFrame = currentFrame->tree()->parent();
}
return scrollHandled;
diff --git a/WebKit/chromium/src/win/WebInputEventFactory.cpp b/WebKit/chromium/src/win/WebInputEventFactory.cpp
index a5bd935..4d83f22 100644
--- a/WebKit/chromium/src/win/WebInputEventFactory.cpp
+++ b/WebKit/chromium/src/win/WebInputEventFactory.cpp
@@ -398,11 +398,11 @@ WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(HWND hwnd, UINT message
//
// How many pixels should we scroll per line? Gecko uses the height of the
// current line, which means scroll distance changes as you go through the
- // page or go to different pages. IE 7 is ~50 px/line, although the value
- // seems to vary slightly by page and zoom level. Since IE 7 has a smoothing
- // algorithm on scrolling, it can get away with slightly larger scroll values
- // without feeling jerky. Here we use 100 px per three lines (the default
- // scroll amount is three lines per wheel tick).
+ // page or go to different pages. IE 8 is ~60 px/line, although the value
+ // seems to vary slightly by page and zoom level. Also, IE defaults to
+ // smooth scrolling while Firefox doesn't, so it can get away with somewhat
+ // larger scroll values without feeling as jerky. Here we use 100 px per
+ // three lines (the default scroll amount is three lines per wheel tick).
static const float scrollbarPixelsPerLine = 100.0f / 3.0f;
wheelDelta /= WHEEL_DELTA;
float scrollDelta = wheelDelta;
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 01eaef4..08f096d 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-26 Peter Kasting <pkasting at google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Misc. cleanup split off from bug 32356.
+ https://bugs.webkit.org/show_bug.cgi?id=44696
+
+ * WebProcess/WebPage/qt/WebPageQt.cpp:
+ (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
+
2010-08-25 Brent Fulgham <bfulgham at webkit.org>
Build fix, no review.
diff --git a/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
index 7408b2a..3e83ba1 100644
--- a/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
+++ b/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
@@ -226,10 +226,7 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboard
m_page->goBack();
break;
case VK_SPACE:
- if (keyboardEvent.shiftKey())
- scroll(m_page, ScrollUp, ScrollByPage);
- else
- scroll(m_page, ScrollDown, ScrollByPage);
+ scroll(m_page, keyboardEvent.shiftKey() ? ScrollUp : ScrollDown, ScrollByPage);
break;
case VK_LEFT:
scroll(m_page, ScrollLeft, ScrollByLine);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list