Changeset 11521 in webkit
- Timestamp:
- Dec 10, 2005 12:21:58 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r11520 r11521 1 2005-12-10 Darin Adler <darin@apple.com> 2 3 New layout test for http://bugzilla.opendarwin.org/show_bug.cgi?id=5826 4 5 * fast/overflow/overflow-rtl-expected.checksum: Added. 6 * fast/overflow/overflow-rtl-expected.png: Added. 7 * fast/overflow/overflow-rtl-expected.txt: Added. 8 * fast/overflow/overflow-rtl.html: Added. 9 1 10 2005-12-10 Darin Adler <darin@apple.com> 2 11 -
trunk/WebCore/ChangeLog-2005-12-19
r11520 r11521 1 2005-12-10 Mitz Pettel <opendarwin.org@mitzpettel.com> 2 3 Reviewed by Hyatt, landed by Darin. 4 5 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5826 6 Blocks with direction:rtl and overflow:auto or scroll have incorrect scrollbars 7 8 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::leftmostPosition): 9 * khtml/rendering/render_layer.cpp: 10 (khtml::RenderLayer::RenderLayer): Initialize 11 (khtml::RenderLayer::scrollOffset): 12 (khtml::RenderLayer::subtractScrollOffset): 13 (khtml::RenderLayer::scrollToOffset): 14 (khtml::RenderLayer::scrollRectToVisible): 15 (khtml::RenderLayer::updateScrollPositionFromScrollbars): 16 (khtml::RenderLayer::computeScrollDimensions): 17 (khtml::RenderLayer::updateScrollInfoAfterLayout): 18 * khtml/rendering/render_layer.h: 19 (khtml::RenderLayer::scrollXOffset): 20 (khtml::RenderLayer::scrollToYOffset): 21 1 22 2005-12-10 Graham Dennis <Graham.Dennis@gmail.com> 2 23 -
trunk/WebCore/khtml/rendering/render_block.cpp
r11392 r11521 2160 2160 if (!includeOverflowInterior && hasOverflowClip()) 2161 2161 return left; 2162 2163 // FIXME: Check left overflow when we eventually support it.2162 if (includeSelf && m_overflowLeft < left) 2163 left = m_overflowLeft; 2164 2164 2165 2165 if (m_floatingObjects) { -
trunk/WebCore/khtml/rendering/render_layer.cpp
r11398 r11521 125 125 m_scrollX( 0 ), 126 126 m_scrollY( 0 ), 127 m_scrollOriginX( 0 ), 128 m_scrollLeftOverflow( 0 ), 127 129 m_scrollWidth( 0 ), 128 130 m_scrollHeight( 0 ), … … 489 491 RenderLayer::scrollOffset(int& x, int& y) 490 492 { 491 x += scrollXOffset() ;493 x += scrollXOffset() + m_scrollLeftOverflow; 492 494 y += scrollYOffset(); 493 495 } … … 496 498 RenderLayer::subtractScrollOffset(int& x, int& y) 497 499 { 498 x -= scrollXOffset() ;500 x -= scrollXOffset() + m_scrollLeftOverflow; 499 501 y -= scrollYOffset(); 500 502 } … … 521 523 // is either occluded by another layer or clipped by an enclosing 522 524 // layer or contains fixed backgrounds, etc.). 523 m_scrollX = x ;525 m_scrollX = x - m_scrollOriginX; 524 526 m_scrollY = y; 525 527 … … 546 548 if (updateScrollbars) { 547 549 if (m_hBar) 548 m_hBar->setValue( m_scrollX);550 m_hBar->setValue(scrollXOffset()); 549 551 if (m_vBar) 550 552 m_vBar->setValue(m_scrollY); … … 558 560 559 561 if (m_object->hasOverflowClip()) { 560 QRect layerBounds = QRect(m_x + m_scrollX, m_y + m_scrollY, m_width, m_height);561 QRect exposeRect = QRect(rect.x() + m_scrollX, rect.y() + m_scrollY, rect.width(), rect.height());562 QRect layerBounds = QRect(m_x + scrollXOffset(), m_y + m_scrollY, m_width, m_height); 563 QRect exposeRect = QRect(rect.x() + scrollXOffset(), rect.y() + m_scrollY, rect.width(), rect.height()); 562 564 QRect r = getRectToExpose(layerBounds, exposeRect, alignX, alignY); 563 565 … … 568 570 yOffset = kMax(0, kMin(m_scrollHeight - m_height, yOffset)); 569 571 570 if (xOffset != m_scrollX|| yOffset != m_scrollY) {571 int diffX = m_scrollX;572 if (xOffset != scrollXOffset() || yOffset != m_scrollY) { 573 int diffX = scrollXOffset(); 572 574 int diffY = m_scrollY; 573 575 scrollToOffset(xOffset, yOffset); 574 diffX = m_scrollX- diffX;576 diffX = scrollXOffset() - diffX; 575 577 diffY = m_scrollY - diffY; 576 578 newRect.setX(rect.x() - diffX); … … 669 671 { 670 672 bool needUpdate = false; 671 int newX = m_scrollX;673 int newX = scrollXOffset(); 672 674 int newY = m_scrollY; 673 675 674 676 if (m_hBar) { 675 677 newX = m_hBar->value(); 676 if (newX != m_scrollX)678 if (newX != scrollXOffset()) 677 679 needUpdate = true; 678 680 } … … 796 798 { 797 799 m_scrollDimensionsDirty = false; 798 799 int rightPos = m_object->rightmostPosition(true, false) - m_object->borderLeft(); 800 int bottomPos = m_object->lowestPosition(true, false) - m_object->borderTop(); 800 801 bool ltr = m_object->style()->direction() == LTR; 801 802 802 803 int clientWidth = m_object->clientWidth(); 803 804 int clientHeight = m_object->clientHeight(); 804 805 806 m_scrollLeftOverflow = ltr ? 0 : kMin(0, m_object->leftmostPosition(true, false) - m_object->borderLeft()); 807 808 int rightPos = ltr ? 809 m_object->rightmostPosition(true, false) - m_object->borderLeft() : 810 clientWidth - m_scrollLeftOverflow; 811 int bottomPos = m_object->lowestPosition(true, false) - m_object->borderTop(); 812 805 813 m_scrollWidth = kMax(rightPos, clientWidth); 806 814 m_scrollHeight = kMax(bottomPos, clientHeight); 815 816 m_scrollOriginX = ltr ? 0 : m_scrollWidth - clientWidth; 807 817 808 818 if (needHBar) … … 825 835 // Layout may cause us to be in an invalid scroll position. In this case we need 826 836 // to pull our scroll offsets back to the max (or push them up to the min). 827 int newX = kMax(0, kMin( m_scrollX, scrollWidth() - m_object->clientWidth()));837 int newX = kMax(0, kMin(scrollXOffset(), scrollWidth() - m_object->clientWidth())); 828 838 int newY = kMax(0, kMin(m_scrollY, scrollHeight() - m_object->clientHeight())); 829 if (newX != m_scrollX|| newY != m_scrollY)839 if (newX != scrollXOffset() || newY != m_scrollY) 830 840 scrollToOffset(newX, newY); 831 841 } … … 870 880 m_hBar->setSteps(LINE_STEP, pageStep); 871 881 m_hBar->setKnobProportion(clientWidth, m_scrollWidth); 882 m_hBar->setValue(scrollXOffset()); 872 883 } 873 884 if (m_vBar) { -
trunk/WebCore/khtml/rendering/render_layer.h
r11271 r11521 241 241 void scrollOffset(int& x, int& y); 242 242 void subtractScrollOffset(int& x, int& y); 243 int scrollXOffset() const { return m_scrollX ; }243 int scrollXOffset() const { return m_scrollX + m_scrollOriginX; } 244 244 int scrollYOffset() const { return m_scrollY; } 245 245 void scrollToOffset(int x, int y, bool updateScrollbars = true, bool repaint = true); 246 246 void scrollToXOffset(int x) { scrollToOffset(x, m_scrollY); } 247 void scrollToYOffset(int y) { scrollToOffset(m_scrollX , y); }247 void scrollToYOffset(int y) { scrollToOffset(m_scrollX + m_scrollOriginX, y); } 248 248 void scrollRectToVisible(const QRect &r, const ScrollAlignment& alignX = gAlignCenterIfNeeded, const ScrollAlignment& alignY = gAlignCenterIfNeeded); 249 249 QRect getRectToExpose(const QRect &visibleRect, const QRect &exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY); … … 369 369 int m_scrollX; 370 370 int m_scrollY; 371 int m_scrollOriginX; 372 int m_scrollLeftOverflow; 371 373 372 374 // The width/height of our scrolled area.
Note: See TracChangeset
for help on using the changeset viewer.