Changeset 47200 in webkit
- Timestamp:
- Aug 13, 2009 9:16:11 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r47196 r47200 1 2009-08-13 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 wrong calculation of overflow size for flexbox and table 6 https://bugs.webkit.org/show_bug.cgi?id=28064 7 8 RenderFlexibleBox and RenderTable were using the width of overflow 9 to update height of overflow, so height became wrong value and 10 width was not updated. As the corresponding code of RenderBlock 11 was sane, I factored it out and used from RenderFlexibleBox and 12 RenderTable. 13 14 * fast/reflections/reflection-overflow-scroll-expected.txt: 15 * fast/reflections/reflection-overflow-scroll.html: 16 * fast/reflections/resources/reflection-overflow-scroll.js: 17 1 18 2009-08-13 Ariya Hidayat <ariya.hidayat@nokia.com> 2 19 -
trunk/LayoutTests/fast/reflections/reflection-overflow-scroll-expected.txt
r46889 r47200 6 6 PASS element.scrollLeft is 150 7 7 PASS element.scrollTop is 80 8 PASS element.scrollLeft is 150 9 PASS element.scrollTop is 80 10 PASS element.scrollLeft is 150 11 PASS element.scrollTop is 80 8 12 PASS successfullyParsed is true 9 13 -
trunk/LayoutTests/fast/reflections/reflection-overflow-scroll.html
r46889 r47200 30 30 </div> 31 31 32 <p> 33 With flexbox. There should be horizontal scroll bar. 34 <div id="horizontal_flex" style="overflow-x:scroll; width:150px;"> 35 <div style="display:-webkit-box; -webkit-box-reflect:right; width:150px;"> 36 Madam, I am Adam. 37 </div> 38 </div> 39 40 <p> 41 With flexbox. There should be vertical scroll bar. 42 <div id="vertical_flex" style="overflow-y:scroll; width:150px; height:80px;"> 43 <div style="display:-webkit-box; -webkit-box-reflect:below; height:80px;"> 44 Madam,<br> 45 I<br> 46 am<br> 47 Adam. 48 </div> 49 </div> 50 51 <p> 52 With table. There should be horizontal scroll bar. 53 <div id="horizontal_table" style="overflow-x:scroll; width:150px;"> 54 <table style="-webkit-box-reflect:right; width:150px;"> 55 <tr><td> 56 Madam, I am Adam. 57 </tr></td> 58 </table> 59 </div> 60 61 <p> 62 With table. There should be vertical scroll bar. 63 <div id="vertical_table" style="overflow-y:scroll; width:150px; height:80px;"> 64 <table style="-webkit-box-reflect:below; height:80px;"> 65 <tr><td> 66 Madam,<br> 67 I<br> 68 am<br> 69 Adam. 70 </tr></td> 71 </table> 72 </div> 73 32 74 </div> 33 75 -
trunk/LayoutTests/fast/reflections/resources/reflection-overflow-scroll.js
r46889 r47200 8 8 element.scrollLeft = 500; 9 9 shouldBe("element.scrollLeft", "150"); 10 element = document.getElementById("vertical"); 11 element.scrollTop = 500; 12 shouldBe("element.scrollTop", "80"); 10 13 11 element = document.getElementById("vertical"); 14 element = document.getElementById("horizontal_flex"); 15 element.scrollLeft = 500; 16 shouldBe("element.scrollLeft", "150"); 17 element = document.getElementById("vertical_flex"); 18 element.scrollTop = 500; 19 shouldBe("element.scrollTop", "80"); 20 21 element = document.getElementById("horizontal_table"); 22 element.scrollLeft = 500; 23 shouldBe("element.scrollLeft", "150"); 24 element = document.getElementById("vertical_table"); 12 25 element.scrollTop = 500; 13 26 shouldBe("element.scrollTop", "80"); -
trunk/WebCore/ChangeLog
r47195 r47200 1 2009-08-13 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 wrong calculation of overflow size for flexbox and table 6 https://bugs.webkit.org/show_bug.cgi?id=28064 7 8 RenderFlexibleBox and RenderTable were using the width of overflow 9 to update height of overflow, so height became wrong value and 10 width was not updated. As the corresponding code of RenderBlock 11 was sane, I factored it out and used from RenderFlexibleBox and 12 RenderTable. 13 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::updateOverflowWithShadowAndReflection): created from code of layoutBlock 16 (WebCore::RenderBlock::layoutBlock): 17 * rendering/RenderBlock.h: 18 * rendering/RenderFlexibleBox.cpp: use updateOverflowWithShadowAndReflection 19 (WebCore::RenderFlexibleBox::layoutBlock): 20 * rendering/RenderTable.cpp: 21 (WebCore::RenderTable::layout): use updateOverflowWithShadowAndReflection 22 1 23 2009-08-13 Mark Rowe <mrowe@apple.com> 2 24 -
trunk/WebCore/rendering/RenderBlock.cpp
r46889 r47200 731 731 } 732 732 733 void RenderBlock::updateOverflowWithShadowAndReflection() 734 { 735 if (hasOverflowClip()) 736 return; 737 738 int shadowLeft; 739 int shadowRight; 740 int shadowTop; 741 int shadowBottom; 742 style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); 743 744 m_overflowLeft = min(m_overflowLeft, shadowLeft); 745 m_overflowWidth = max(m_overflowWidth, width() + shadowRight); 746 m_overflowTop = min(m_overflowTop, shadowTop); 747 m_overflowHeight = max(m_overflowHeight, height() + shadowBottom); 748 749 if (hasReflection()) { 750 IntRect reflection(reflectionBox()); 751 m_overflowLeft = min(m_overflowLeft, reflection.x()); 752 m_overflowWidth = max(m_overflowWidth, reflection.right()); 753 m_overflowTop = min(m_overflowTop, reflection.y()); 754 m_overflowHeight = max(m_overflowHeight, reflection.bottom()); 755 } 756 } 757 733 758 void RenderBlock::layout() 734 759 { … … 869 894 m_overflowHeight = max(m_overflowHeight, height()); 870 895 871 if (!hasOverflowClip()) { 872 int shadowLeft; 873 int shadowRight; 874 int shadowTop; 875 int shadowBottom; 876 style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); 877 878 m_overflowLeft = min(m_overflowLeft, shadowLeft); 879 m_overflowWidth = max(m_overflowWidth, width() + shadowRight); 880 m_overflowTop = min(m_overflowTop, shadowTop); 881 m_overflowHeight = max(m_overflowHeight, height() + shadowBottom); 882 883 if (hasReflection()) { 884 IntRect reflection(reflectionBox()); 885 m_overflowLeft = min(m_overflowLeft, reflection.x()); 886 m_overflowWidth = max(m_overflowWidth, reflection.right()); 887 m_overflowTop = min(m_overflowTop, reflection.y()); 888 m_overflowHeight = max(m_overflowHeight, reflection.bottom()); 889 } 890 } 896 updateOverflowWithShadowAndReflection(); 891 897 892 898 statePusher.pop(); -
trunk/WebCore/rendering/RenderBlock.h
r46815 r47200 205 205 virtual bool hasLineIfEmpty() const; 206 206 bool layoutOnlyPositionedObjects(); 207 207 208 void updateOverflowWithShadowAndReflection(); 209 208 210 private: 209 211 virtual RenderObjectChildList* virtualChildren() { return children(); } -
trunk/WebCore/rendering/RenderFlexibleBox.cpp
r46553 r47200 279 279 m_overflowWidth = width(); 280 280 281 if (!hasOverflowClip()) { 282 int shadowLeft; 283 int shadowRight; 284 int shadowTop; 285 int shadowBottom; 286 style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); 287 288 m_overflowLeft = min(m_overflowLeft, shadowLeft); 289 m_overflowWidth = max(m_overflowWidth, width() + shadowRight); 290 m_overflowTop = min(m_overflowTop, shadowTop); 291 m_overflowHeight = max(m_overflowHeight, height() + shadowBottom); 292 293 if (hasReflection()) { 294 IntRect reflection(reflectionBox()); 295 m_overflowTop = min(m_overflowTop, reflection.y()); 296 m_overflowHeight = max(m_overflowHeight, reflection.bottom()); 297 m_overflowLeft = min(m_overflowLeft, reflection.x()); 298 m_overflowHeight = max(m_overflowWidth, reflection.right()); 299 } 300 } 281 updateOverflowWithShadowAndReflection(); 301 282 302 283 statePusher.pop(); -
trunk/WebCore/rendering/RenderTable.cpp
r46888 r47200 390 390 layoutPositionedObjects(true); 391 391 392 if (!hasOverflowClip()) { 393 int shadowLeft; 394 int shadowRight; 395 int shadowTop; 396 int shadowBottom; 397 style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); 398 399 m_overflowLeft = min(m_overflowLeft, shadowLeft); 400 m_overflowWidth = max(m_overflowWidth, width() + shadowRight); 401 m_overflowTop = min(m_overflowTop, shadowTop); 402 m_overflowHeight = max(m_overflowHeight, height() + shadowBottom); 403 404 if (hasReflection()) { 405 IntRect reflection(reflectionBox()); 406 m_overflowTop = min(m_overflowTop, reflection.y()); 407 m_overflowHeight = max(m_overflowHeight, reflection.bottom()); 408 m_overflowLeft = min(m_overflowLeft, reflection.x()); 409 m_overflowHeight = max(m_overflowWidth, reflection.right()); 410 } 411 } 392 updateOverflowWithShadowAndReflection(); 412 393 413 394 statePusher.pop();
Note: See TracChangeset
for help on using the changeset viewer.