| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(qu
adForFakeMouseMoveEvent); | 1356 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(qu
adForFakeMouseMoveEvent); |
| 1357 frame->eventHandler()->dispatchFakeMouseMoveEventSoonInQuad(quadForFakeM
ouseMoveEvent); | 1357 frame->eventHandler()->dispatchFakeMouseMoveEventSoonInQuad(quadForFakeM
ouseMoveEvent); |
| 1358 } | 1358 } |
| 1359 | 1359 |
| 1360 // Just schedule a full repaint of our object. | 1360 // Just schedule a full repaint of our object. |
| 1361 if (view && repaint) | 1361 if (view && repaint) |
| 1362 renderer()->repaintUsingContainer(repaintContainer, rectForRepaint); | 1362 renderer()->repaintUsingContainer(repaintContainer, rectForRepaint); |
| 1363 | 1363 |
| 1364 if (updateScrollbars) { | 1364 if (updateScrollbars) { |
| 1365 if (m_hBar) | 1365 if (m_hBar) |
| 1366 m_hBar->setValue(scrollXOffset()); | 1366 m_hBar->setValue(scrollXOffset(), Scrollbar::NotFromScrollAnimator); |
| 1367 if (m_vBar) | 1367 if (m_vBar) |
| 1368 m_vBar->setValue(m_scrollY); | 1368 m_vBar->setValue(m_scrollY, Scrollbar::NotFromScrollAnimator); |
| 1369 } | 1369 } |
| 1370 | 1370 |
| 1371 // Schedule the scroll DOM event. | 1371 // Schedule the scroll DOM event. |
| 1372 if (view) { | 1372 if (view) { |
| 1373 if (FrameView* frameView = view->frameView()) | 1373 if (FrameView* frameView = view->frameView()) |
| 1374 frameView->scheduleEvent(Event::create(eventNames().scrollEvent, fal
se, false), renderer()->node()); | 1374 frameView->scheduleEvent(Event::create(eventNames().scrollEvent, fal
se, false), renderer()->node()); |
| 1375 } | 1375 } |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 void RenderLayer::scrollRectToVisible(const IntRect& rect, bool scrollToAnchor,
const ScrollAlignment& alignX, const ScrollAlignment& alignY) | 1378 void RenderLayer::scrollRectToVisible(const IntRect& rect, bool scrollToAnchor,
const ScrollAlignment& alignX, const ScrollAlignment& alignY) |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1611 int baseHeight = renderer->height() - (isBoxSizingBorder ? 0 : renderer-
>borderAndPaddingHeight()); | 1611 int baseHeight = renderer->height() - (isBoxSizingBorder ? 0 : renderer-
>borderAndPaddingHeight()); |
| 1612 baseHeight = baseHeight / zoomFactor; | 1612 baseHeight = baseHeight / zoomFactor; |
| 1613 style->setProperty(CSSPropertyHeight, String::number(baseHeight + differ
ence.height()) + "px", false, ec); | 1613 style->setProperty(CSSPropertyHeight, String::number(baseHeight + differ
ence.height()) + "px", false, ec); |
| 1614 } | 1614 } |
| 1615 | 1615 |
| 1616 document->updateLayout(); | 1616 document->updateLayout(); |
| 1617 | 1617 |
| 1618 // FIXME (Radar 4118564): We should also autoscroll the window as necessary
to keep the point under the cursor in view. | 1618 // FIXME (Radar 4118564): We should also autoscroll the window as necessary
to keep the point under the cursor in view. |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 int RenderLayer::scrollSize(ScrollbarOrientation orientation) const |
| 1622 { |
| 1623 Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_hBar : m_vB
ar).get(); |
| 1624 return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0; |
| 1625 } |
| 1626 |
| 1627 void RenderLayer::setScrollOffsetFromAnimation(const IntPoint& offset) |
| 1628 { |
| 1629 if (m_hBar) |
| 1630 m_hBar->setValue(offset.x(), Scrollbar::FromScrollAnimator); |
| 1631 if (m_vBar) |
| 1632 m_vBar->setValue(offset.y(), Scrollbar::FromScrollAnimator); |
| 1633 } |
| 1634 |
| 1621 void RenderLayer::valueChanged(Scrollbar*) | 1635 void RenderLayer::valueChanged(Scrollbar*) |
| 1622 { | 1636 { |
| 1623 // Update scroll position from scrollbars. | 1637 // Update scroll position from scrollbars. |
| 1624 | 1638 |
| 1625 bool needUpdate = false; | 1639 bool needUpdate = false; |
| 1626 int newX = scrollXOffset(); | 1640 int newX = scrollXOffset(); |
| 1627 int newY = m_scrollY; | 1641 int newY = m_scrollY; |
| 1628 | 1642 |
| 1629 if (m_hBar) { | 1643 if (m_hBar) { |
| 1630 newX = m_hBar->value(); | 1644 newX = m_hBar->value(); |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2061 m_hBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); | 2075 m_hBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); |
| 2062 m_hBar->setProportion(clientWidth, m_scrollWidth); | 2076 m_hBar->setProportion(clientWidth, m_scrollWidth); |
| 2063 // Explicitly set the horizontal scroll value. This ensures that when a | 2077 // Explicitly set the horizontal scroll value. This ensures that when a |
| 2064 // right-to-left scrollable area's width (or content width) changes, the | 2078 // right-to-left scrollable area's width (or content width) changes, the |
| 2065 // top right corner of the content doesn't shift with respect to the top | 2079 // top right corner of the content doesn't shift with respect to the top |
| 2066 // right corner of the area. Conceptually, right-to-left areas have | 2080 // right corner of the area. Conceptually, right-to-left areas have |
| 2067 // their origin at the top-right, but RenderLayer is top-left oriented, | 2081 // their origin at the top-right, but RenderLayer is top-left oriented, |
| 2068 // so this is needed to keep everything working (see how scrollXOffset() | 2082 // so this is needed to keep everything working (see how scrollXOffset() |
| 2069 // differs from scrollYOffset() to get an idea of why the horizontal and | 2083 // differs from scrollYOffset() to get an idea of why the horizontal and |
| 2070 // vertical scrollbars need to be treated differently). | 2084 // vertical scrollbars need to be treated differently). |
| 2071 m_hBar->setValue(scrollXOffset()); | 2085 m_hBar->setValue(scrollXOffset(), Scrollbar::NotFromScrollAnimator); |
| 2072 } | 2086 } |
| 2073 if (m_vBar) { | 2087 if (m_vBar) { |
| 2074 int clientHeight = box->clientHeight(); | 2088 int clientHeight = box->clientHeight(); |
| 2075 int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepW
henPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1); | 2089 int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepW
henPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1); |
| 2076 m_vBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); | 2090 m_vBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); |
| 2077 m_vBar->setProportion(clientHeight, m_scrollHeight); | 2091 m_vBar->setProportion(clientHeight, m_scrollHeight); |
| 2078 } | 2092 } |
| 2079 | 2093 |
| 2080 if (renderer()->node() && renderer()->document()->hasListenerType(Document::
OVERFLOWCHANGED_LISTENER)) | 2094 if (renderer()->node() && renderer()->document()->hasListenerType(Document::
OVERFLOWCHANGED_LISTENER)) |
| 2081 updateOverflowStatus(horizontalOverflow, verticalOverflow); | 2095 updateOverflowStatus(horizontalOverflow, verticalOverflow); |
| (...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3867 { | 3881 { |
| 3868 if (!layer) | 3882 if (!layer) |
| 3869 return; | 3883 return; |
| 3870 | 3884 |
| 3871 if (WebCore::Frame* frame = layer->renderer()->frame()) { | 3885 if (WebCore::Frame* frame = layer->renderer()->frame()) { |
| 3872 WTF::String output = externalRepresentation(frame, WebCore::RenderAsText
ShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextSho
wCompositedLayers | WebCore::RenderAsTextShowAddresses | WebCore::RenderAsTextSh
owIDAndClass); | 3886 WTF::String output = externalRepresentation(frame, WebCore::RenderAsText
ShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextSho
wCompositedLayers | WebCore::RenderAsTextShowAddresses | WebCore::RenderAsTextSh
owIDAndClass); |
| 3873 fprintf(stderr, "%s\n", output.utf8().data()); | 3887 fprintf(stderr, "%s\n", output.utf8().data()); |
| 3874 } | 3888 } |
| 3875 } | 3889 } |
| 3876 #endif | 3890 #endif |
| OLD | NEW |