From ad69f7e184758a458d23f221ce6f949a5282fe1f Mon Sep 17 00:00:00 2001 From: hyatt Date: Wed, 15 Dec 2004 01:13:40 +0000 Subject: [PATCH] Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position. This is actually a regression from my positioned object DHTML optimization. Reviewed by kocienda * khtml/rendering/render_object.cpp: (RenderObject::setStyle): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8211 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/fast/dynamic/012-expected.txt | 58 +++++++++++++++ LayoutTests/fast/dynamic/012.html | 68 ++++++++++++++++++ LayoutTests/fast/dynamic/resources/closed.png | Bin 0 -> 282 bytes LayoutTests/fast/dynamic/resources/open.png | Bin 0 -> 323 bytes WebCore/ChangeLog-2005-08-23 | 10 +++ WebCore/khtml/rendering/render_object.cpp | 5 ++ 6 files changed, 141 insertions(+) create mode 100644 LayoutTests/fast/dynamic/012-expected.txt create mode 100644 LayoutTests/fast/dynamic/012.html create mode 100644 LayoutTests/fast/dynamic/resources/closed.png create mode 100644 LayoutTests/fast/dynamic/resources/open.png diff --git a/LayoutTests/fast/dynamic/012-expected.txt b/LayoutTests/fast/dynamic/012-expected.txt new file mode 100644 index 000000000000..12ec83b04e5a --- /dev/null +++ b/LayoutTests/fast/dynamic/012-expected.txt @@ -0,0 +1,58 @@ +layer at (0,0) size 800x600 + RenderCanvas at (0,0) size 800x600 +layer at (0,0) size 800x600 + RenderBlock {HTML} at (0,0) size 800x600 + RenderBody {BODY} at (8,8) size 784x584 + RenderBlock {H2} at (0,0) size 784x28 + RenderText {TEXT} at (0,0) size 220x28 + text run at (0,0) width 220: "Block Collapse Demo" + RenderBlock {P} at (0,47) size 784x18 + RenderText {TEXT} at (0,0) size 687x18 + text run at (0,0) width 304: "This table below has three hierarchical sections. " + text run at (304,0) width 383: "Collapsing a section should cause those below it to move up." + RenderBlock {P} at (0,81) size 784x18 + RenderText {TEXT} at (0,0) size 765x18 + text run at (0,0) width 765: "This works on the latest Windows IE and Mozilla Firefox (Win and Mac) but not on Safari 1.2.3 (v125.9) {or 2.0 (146)}." + RenderBlock {P} at (0,115) size 784x18 + RenderText {TEXT} at (0,0) size 747x18 + text run at (0,0) width 579: "Note that the second section is collapsed when the page opens and expanding it works fine. " + text run at (579,0) width 168: "Just the collapse is broken." + RenderBlock {DIV} at (0,149) size 784x148 + RenderBlock {HR} at (0,0) size 784x2 [border: (1px inset #000000)] + RenderBlock {DIV} at (0,10) size 784x20 + RenderImage {IMG} at (0,0) size 16x16 + RenderText {TEXT} at (16,2) size 75x18 + text run at (16,2) width 75: " Block One" + RenderBlock {DIV} at (0,30) size 784x20 + RenderImage {IMG} at (0,0) size 16x16 + RenderText {TEXT} at (16,2) size 78x18 + text run at (16,2) width 78: " Block Two" + RenderBlock {DIV} at (0,50) size 784x20 + RenderImage {IMG} at (0,0) size 16x16 + RenderText {TEXT} at (16,2) size 88x18 + text run at (16,2) width 88: " Block Three" + RenderBlock {DIV} at (0,70) size 784x68 + RenderTable {TABLE} at (0,0) size 784x68 + RenderTableSection {TBODY} at (0,0) size 0x68 + RenderTableRow {TR} at (0,0) size 0x0 + RenderTableCell {TD} at (2,2) size 32x20 [r=0 c=0 rs=1 cs=1] + RenderText {TEXT} at (1,1) size 4x18 + text run at (1,1) width 4: " " + RenderTableCell {TD} at (36,2) size 746x20 [r=0 c=1 rs=1 cs=1] + RenderText {TEXT} at (1,1) size 65x18 + text run at (1,1) width 65: "This is the" + RenderTableRow {TR} at (0,0) size 0x0 + RenderTableCell {TD} at (2,24) size 32x20 [r=1 c=0 rs=1 cs=1] + RenderText {TEXT} at (1,1) size 4x18 + text run at (1,1) width 4: " " + RenderTableCell {TD} at (36,24) size 746x20 [r=1 c=1 rs=1 cs=1] + RenderText {TEXT} at (1,1) size 69x18 + text run at (1,1) width 69: "contents of" + RenderTableRow {TR} at (0,0) size 0x0 + RenderTableCell {TD} at (2,46) size 32x20 [r=2 c=0 rs=1 cs=1] + RenderText {TEXT} at (1,1) size 4x18 + text run at (1,1) width 4: " " + RenderTableCell {TD} at (36,46) size 746x20 [r=2 c=1 rs=1 cs=1] + RenderText {TEXT} at (1,1) size 74x18 + text run at (1,1) width 74: "block three." + RenderBlock {HR} at (0,146) size 784x2 [border: (1px inset #000000)] diff --git a/LayoutTests/fast/dynamic/012.html b/LayoutTests/fast/dynamic/012.html new file mode 100644 index 000000000000..74772b4fc3eb --- /dev/null +++ b/LayoutTests/fast/dynamic/012.html @@ -0,0 +1,68 @@ + + + Block Collapse Demo + + + +

Block Collapse Demo

+

This table below has three hierarchical sections. Collapsing a section should cause those below it to move up.

+

This works on the latest Windows IE and Mozilla Firefox (Win and Mac) but not on Safari 1.2.3 (v125.9) {or 2.0 (146)}.

+

Note that the second section is collapsed when the page opens and expanding it works fine. Just the collapse is broken.

+ + +
+
+
shown Block One
+
+ + + + +
 This is the
 contents of
 block one.
+
+ +
hidden Block Two
+ + + +
shown Block Three
+ +
+ + + + +
 This is the
 contents of
 block three.
+
+
+
+ + + diff --git a/LayoutTests/fast/dynamic/resources/closed.png b/LayoutTests/fast/dynamic/resources/closed.png new file mode 100644 index 0000000000000000000000000000000000000000..4fdba372ec149a092c9fd4391d4fa5d448579536 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`-Aj~-FC-YLEAbW|YuPgf%PDUY1?lR>|3xPt*JzX3_D&{P`Y|C}nfQR*gy8b&x zFU85{FD(q`l6<83#6>lFp{?i3v=^M4_VT?G=#c6RdEmOq?vJ+0Mjk;$&qm{>X(EDI zmF5?=UH@LL`ny4*fBBsEsx1jzS^t;~#pp+hZ+!R!%()}`;}qJ>Nc)=L*M z6-yrXUTkZ?ZZJL3V)a?Rgxxn8-lQ>nEttm4usg5nno#)Ht2MkHntN@|swn=id(N*I XI{U>W6|HALCo_1u`njxgN@xNAf<$An literal 0 HcmV?d00001 diff --git a/LayoutTests/fast/dynamic/resources/open.png b/LayoutTests/fast/dynamic/resources/open.png new file mode 100644 index 0000000000000000000000000000000000000000..7889e1e54f96dc9088d4de507c7f8e775827cbd0 GIT binary patch literal 323 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G_YAk0{w5<>&kwGlTpZsg*8L$H&Ez;r;B4q#hkN~ck>={5O7I1n5fKS z#k9(C2ZPrFZUNC4H})10Mj_stkHi@|_c|YNSNOnrl5x$JlUet;%eGEwvAVj#^?z#v zLzZsiqz7}Nd)z+P$&^>$cQ~HBZSL8&T+b(exl~N&uKS#3T&B1~!*A#Jm6Kf_WU{AC ztC+uQk;T)iA1uGym8Mc=poYHXhtF;Sxg P=r;yWS3j3^P6 + + Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position. + This is actually a regression from my positioned object DHTML optimization. + + Reviewed by kocienda + + * khtml/rendering/render_object.cpp: + (RenderObject::setStyle): + 2004-12-14 David Hyatt Make sure the class attribute works when newlines are present in the attribute. diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp index 74ba9bebde73..c5963aa1e3d6 100644 --- a/WebCore/khtml/rendering/render_object.cpp +++ b/WebCore/khtml/rendering/render_object.cpp @@ -1561,6 +1561,11 @@ void RenderObject::setStyle(RenderStyle *style) m_style->opacity() != style->opacity())) layer()->repaintIncludingDescendants(); + // When a layout hint happens and an object's position style changes, we have to do a layout + // to dirty the render tree using the old position value now. + if (d == RenderStyle::Layout && m_parent && m_style->position() != style->position()) + setNeedsLayoutAndMinMaxRecalc(); + if (isFloating() && (m_style->floating() != style->floating())) // For changes in float styles, we need to conceivably remove ourselves // from the floating objects list. -- 2.36.0