Changeset 14847
- Timestamp:
- 06/13/06 16:19:33 (3 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 7 modified
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/block/positioning/relative-overflow-block-expected.checksum (added)
-
LayoutTests/fast/block/positioning/relative-overflow-block-expected.png (added)
-
LayoutTests/fast/block/positioning/relative-overflow-block-expected.txt (added)
-
LayoutTests/fast/block/positioning/relative-overflow-block.html (added)
-
LayoutTests/fast/block/positioning/relative-overflow-replaced-expected.checksum (added)
-
LayoutTests/fast/block/positioning/relative-overflow-replaced-expected.png (added)
-
LayoutTests/fast/block/positioning/relative-overflow-replaced-expected.txt (added)
-
LayoutTests/fast/block/positioning/relative-overflow-replaced-float-expected.checksum (added)
-
LayoutTests/fast/block/positioning/relative-overflow-replaced-float-expected.png (added)
-
LayoutTests/fast/block/positioning/relative-overflow-replaced-float-expected.txt (added)
-
LayoutTests/fast/block/positioning/relative-overflow-replaced-float.html (added)
-
LayoutTests/fast/block/positioning/relative-overflow-replaced.html (added)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/rendering/RenderBox.cpp (modified) (4 diffs)
-
WebCore/rendering/RenderBox.h (modified) (1 diff)
-
WebCore/rendering/RenderFlow.cpp (modified) (6 diffs)
-
WebCore/rendering/RenderLayer.cpp (modified) (1 diff)
-
WebCore/rendering/RenderObject.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r14846 r14847 1 2006-06-13 Antti Koivisto <koivisto@iki.fi> 2 3 Reviewed by Hyatt 4 5 http://bugzilla.opendarwin.org/show_bug.cgi?id=9314 6 7 * fast/block/positioning/relative-overflow-block-expected.checksum: Added. 8 * fast/block/positioning/relative-overflow-block-expected.png: Added. 9 * fast/block/positioning/relative-overflow-block-expected.txt: Added. 10 * fast/block/positioning/relative-overflow-block.html: Added. 11 * fast/block/positioning/relative-overflow-replaced-expected.checksum: Added. 12 * fast/block/positioning/relative-overflow-replaced-expected.png: Added. 13 * fast/block/positioning/relative-overflow-replaced-expected.txt: Added. 14 * fast/block/positioning/relative-overflow-replaced-float-expected.checksum: Added. 15 * fast/block/positioning/relative-overflow-replaced-float-expected.png: Added. 16 * fast/block/positioning/relative-overflow-replaced-float-expected.txt: Added. 17 * fast/block/positioning/relative-overflow-replaced-float.html: Added. 18 * fast/block/positioning/relative-overflow-replaced.html: Added. 19 1 20 2006-06-13 Anders Carlsson <acarlsson@apple.com> 2 21 -
trunk/WebCore/ChangeLog
r14846 r14847 1 2006-06-13 Antti Koivisto <koivisto@iki.fi> 2 3 Reviewed by Hyatt. 4 5 http://bugzilla.opendarwin.org/show_bug.cgi?id=9314 6 Relative positioned block size doesnt update root layer size 7 8 - take relative positioning into account in leftmost/rightmost/lowestPosition() 9 - ignore zero width/height boxes in leftmost/rightmost/lowestPosition() 10 - split relativePositionOffset() to x and y functions 11 12 * rendering/RenderBox.cpp: 13 (WebCore::RenderBox::absolutePosition): 14 (WebCore::RenderBox::relativePositionOffsetX): 15 (WebCore::RenderBox::relativePositionOffsetY): 16 (WebCore::RenderBox::lowestPosition): 17 (WebCore::RenderBox::rightmostPosition): 18 (WebCore::RenderBox::leftmostPosition): 19 * rendering/RenderBox.h: 20 * rendering/RenderFlow.cpp: 21 (WebCore::RenderFlow::lowestPosition): 22 (WebCore::RenderFlow::rightmostPosition): 23 (WebCore::RenderFlow::leftmostPosition): 24 * rendering/RenderLayer.cpp: 25 (WebCore::RenderLayer::updateLayerPosition): 26 * rendering/RenderObject.cpp: 27 (WebCore::RenderObject::offsetLeft): 28 (WebCore::RenderObject::offsetTop): 29 1 30 2006-06-13 Anders Carlsson <acarlsson@apple.com> 2 31 -
trunk/WebCore/rendering/RenderBox.cpp
r14759 r14847 763 763 } 764 764 765 if (isRelPositioned()) 766 relativePositionOffset(xPos, yPos); 765 if (isRelPositioned()) { 766 xPos += relativePositionOffsetX(); 767 yPos += relativePositionOffsetY(); 768 } 767 769 768 770 return true; … … 934 936 } 935 937 936 void RenderBox::relativePositionOffset(int &tx, int &ty) 937 { 938 int RenderBox::relativePositionOffsetX() const 939 { 940 int tx = 0; 938 941 if(!style()->left().isAuto()) 939 tx += style()->left().calcValue(containingBlockWidth());942 tx = style()->left().calcValue(containingBlockWidth()); 940 943 else if(!style()->right().isAuto()) 941 tx -= style()->right().calcValue(containingBlockWidth()); 944 tx = -style()->right().calcValue(containingBlockWidth()); 945 return tx; 946 } 947 948 int RenderBox::relativePositionOffsetY() const 949 { 950 int ty = 0; 942 951 if(!style()->top().isAuto()) 943 952 { 944 953 if (!style()->top().isPercent() 945 954 || containingBlock()->style()->height().isFixed()) 946 ty += style()->top().calcValue(containingBlockHeight());955 ty = style()->top().calcValue(containingBlockHeight()); 947 956 } 948 957 else if(!style()->bottom().isAuto()) … … 950 959 if (!style()->bottom().isPercent() 951 960 || containingBlock()->style()->height().isFixed()) 952 ty -= style()->bottom().calcValue(containingBlockHeight()); 953 } 961 ty = -style()->bottom().calcValue(containingBlockHeight()); 962 } 963 return ty; 954 964 } 955 965 … … 2366 2376 int RenderBox::lowestPosition(bool includeOverflowInterior, bool includeSelf) const 2367 2377 { 2368 return includeSelf ? m_height : 0; 2378 if (!includeSelf || !m_width) 2379 return 0; 2380 int bottom = m_height; 2381 if (isRelPositioned()) 2382 bottom += relativePositionOffsetY(); 2383 return bottom; 2369 2384 } 2370 2385 2371 2386 int RenderBox::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const 2372 2387 { 2373 return includeSelf ? m_width : 0; 2388 if (!includeSelf || !m_height) 2389 return 0; 2390 int right = m_width; 2391 if (isRelPositioned()) 2392 right += relativePositionOffsetX(); 2393 return right; 2374 2394 } 2375 2395 2376 2396 int RenderBox::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const 2377 2397 { 2378 return includeSelf ? 0 : m_width; 2379 } 2380 2381 } 2398 if (!includeSelf || !m_height) 2399 return m_width; 2400 int left = 0; 2401 if (isRelPositioned()) 2402 left += relativePositionOffsetX(); 2403 return left; 2404 } 2405 2406 } -
trunk/WebCore/rendering/RenderBox.h
r14727 r14847 133 133 void calcVerticalMargins(); 134 134 135 void relativePositionOffset(int &tx, int &ty); 135 int relativePositionOffsetX() const; 136 int relativePositionOffsetY() const; 136 137 137 138 virtual RenderLayer* layer() const { return m_layer; } -
trunk/WebCore/rendering/RenderFlow.cpp
r14638 r14847 517 517 { 518 518 assert(!isInlineFlow()); 519 int bottom = RenderContainer::lowestPosition(includeOverflowInterior, includeSelf);519 int bottom = includeSelf && m_width > 0 ? m_height : 0; 520 520 if (!includeOverflowInterior && hasOverflowClip()) 521 521 return bottom; … … 531 531 } 532 532 } 533 534 if (isRelPositioned()) 535 bottom += relativePositionOffsetY(); 533 536 534 537 return bottom; … … 538 541 { 539 542 assert(!isInlineFlow()); 540 int right = RenderContainer::rightmostPosition(includeOverflowInterior, includeSelf);543 int right = includeSelf && m_height > 0 ? m_width : 0; 541 544 if (!includeOverflowInterior && hasOverflowClip()) 542 545 return right; … … 553 556 } 554 557 558 if (isRelPositioned()) 559 right += relativePositionOffsetX(); 560 555 561 return right; 556 562 } … … 559 565 { 560 566 assert(!isInlineFlow()); 561 int left = RenderContainer::leftmostPosition(includeOverflowInterior, includeSelf);567 int left = includeSelf && m_height > 0 ? 0 : m_width; 562 568 if (!includeOverflowInterior && hasOverflowClip()) 563 569 return left; … … 574 580 } 575 581 582 if (isRelPositioned()) 583 left += relativePositionOffsetX(); 584 576 585 return left; 577 586 } -
trunk/WebCore/rendering/RenderLayer.cpp
r14809 r14847 264 264 m_relX = m_relY = 0; 265 265 if (m_object->isRelPositioned()) { 266 static_cast<RenderBox*>(m_object)->relativePositionOffset(m_relX, m_relY); 266 m_relX = static_cast<RenderBox*>(m_object)->relativePositionOffsetX(); 267 m_relY = static_cast<RenderBox*>(m_object)->relativePositionOffsetY(); 267 268 x += m_relX; y += m_relY; 268 269 } -
trunk/WebCore/rendering/RenderObject.cpp
r14827 r14847 550 550 int x = xPos(); 551 551 if (!isPositioned()) { 552 if (isRelPositioned()) { 553 int y = 0; 554 ((RenderBox*)this)->relativePositionOffset(x, y); 555 } 552 if (isRelPositioned()) 553 x += ((RenderBox*)this)->relativePositionOffsetX(); 556 554 557 555 RenderObject* offsetPar = offsetParent(); … … 569 567 int y = yPos(); 570 568 if (!isPositioned()) { 571 if (isRelPositioned()) { 572 int x = 0; 573 ((RenderBox*)this)->relativePositionOffset(x, y); 574 } 569 if (isRelPositioned()) 570 y += ((RenderBox*)this)->relativePositionOffsetY(); 575 571 RenderObject* offsetPar = offsetParent(); 576 572 RenderObject* curr = parent();