[webkit-changes] cvs commit: LayoutTests/fast/css margin-top-bottom-dynamic-expected.checksum margin-top-bottom-dynamic-expected.png margin-top-bottom-dynamic-expected.txt margin-top-bottom-dynamic.html

Darin darin at opensource.apple.com
Thu Dec 29 22:46:58 PST 2005


darin       05/12/29 22:46:57

  Modified:    .        ChangeLog
               khtml/rendering render_block.h
               .        ChangeLog
  Added:       fast/css margin-top-bottom-dynamic-expected.checksum
                        margin-top-bottom-dynamic-expected.png
                        margin-top-bottom-dynamic-expected.txt
                        margin-top-bottom-dynamic.html
  Log:
  LayoutTests:
  
          Reviewed and refined by Darin.
  
          - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=3579
            In-place style-switching is leaving junk behind, messing up styles
  
          * fast/css/margin-top-bottom-dynamic-expected.checksum: Added.
          * fast/css/margin-top-bottom-dynamic-expected.png: Added.
          * fast/css/margin-top-bottom-dynamic-expected.txt: Added.
          * fast/css/margin-top-bottom-dynamic.html: Added.
  
  WebCore:
  
          Reviewed by Hyatt.
  
          - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3579
            In-place style-switching is leaving junk behind, messing up styles
  
          * khtml/rendering/render_block.h: (khtml::RenderBlock::initMaxMarginValues):
          Set all margin values in all cases.
  
  Revision  Changes    Path
  1.64      +10 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- ChangeLog	30 Dec 2005 05:43:23 -0000	1.63
  +++ ChangeLog	30 Dec 2005 06:46:55 -0000	1.64
  @@ -1,3 +1,13 @@
  +2005-12-29  Graham Dennis  <Graham.Dennis at gmail.com>
  +
  +        Reviewed by Hyatt.
  +
  +        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3579
  +          In-place style-switching is leaving junk behind, messing up styles
  +
  +        * khtml/rendering/render_block.h: (khtml::RenderBlock::initMaxMarginValues):
  +        Set all margin values in all cases.
  +
   2005-12-29  Eric Seidel  <eseidel at apple.com>
   
           Reviewed by mjs.
  
  
  
  1.74      +10 -4     WebCore/khtml/rendering/render_block.h
  
  Index: render_block.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_block.h,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- render_block.h	27 Nov 2005 22:52:08 -0000	1.73
  +++ render_block.h	30 Dec 2005 06:46:56 -0000	1.74
  @@ -90,14 +90,20 @@
       }
   
       void initMaxMarginValues() {
  -        if (m_marginTop >= 0)
  +        if (m_marginTop >= 0) {
               m_maxTopPosMargin = m_marginTop;
  -        else
  +            m_maxTopNegMargin = 0;
  +        } else {
               m_maxTopNegMargin = -m_marginTop;
  -        if (m_marginBottom >= 0)
  +            m_maxTopPosMargin = 0;
  +        }
  +        if (m_marginBottom >= 0) {
               m_maxBottomPosMargin = m_marginBottom;
  -        else
  +            m_maxBottomNegMargin = 0;
  +        } else {
               m_maxBottomNegMargin = -m_marginBottom;
  +            m_maxBottomPosMargin = 0;
  +        }
       }
   
       virtual void addChildToFlow(RenderObject* newChild, RenderObject* beforeChild);
  
  
  
  1.201     +12 -0     LayoutTests/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/LayoutTests/ChangeLog,v
  retrieving revision 1.200
  retrieving revision 1.201
  diff -u -r1.200 -r1.201
  --- ChangeLog	30 Dec 2005 05:51:37 -0000	1.200
  +++ ChangeLog	30 Dec 2005 06:46:56 -0000	1.201
  @@ -1,3 +1,15 @@
  +2005-12-29  Graham Dennis  <Graham.Dennis at gmail.com>
  +
  +        Reviewed and refined by Darin.
  +
  +        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=3579
  +          In-place style-switching is leaving junk behind, messing up styles
  +
  +        * fast/css/margin-top-bottom-dynamic-expected.checksum: Added.
  +        * fast/css/margin-top-bottom-dynamic-expected.png: Added.
  +        * fast/css/margin-top-bottom-dynamic-expected.txt: Added.
  +        * fast/css/margin-top-bottom-dynamic.html: Added.
  +
   2005-12-29  Eric Seidel  <eseidel at apple.com>
   
           Reviewed by mjs.
  
  
  
  1.1                  LayoutTests/fast/css/margin-top-bottom-dynamic-expected.checksum
  
  Index: margin-top-bottom-dynamic-expected.checksum
  ===================================================================
  e31144e36735ab0af649d9f406e75dd9
  
  
  1.1                  LayoutTests/fast/css/margin-top-bottom-dynamic-expected.png
  
  	<<Binary file>>
  
  
  1.1                  LayoutTests/fast/css/margin-top-bottom-dynamic-expected.txt
  
  Index: margin-top-bottom-dynamic-expected.txt
  ===================================================================
  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 {P} at (0,0) size 784x18
          RenderText {TEXT} at (0,0) size 249x18
            text run at (0,0) width 249: "What it should look like (positive case):"
        RenderBlock {DIV} at (0,34) size 784x72 [border: (1px solid #008000)]
          RenderBlock {DIV} at (1,11) size 782x20 [border: (1px solid #0000FF)]
            RenderText {TEXT} at (1,1) size 84x18
              text run at (1,1) width 84: "Lorem ipsum"
          RenderBlock {DIV} at (1,41) size 782x20 [border: (1px dotted #0000FF)]
            RenderText {TEXT} at (1,1) size 84x18
              text run at (1,1) width 84: "Lorem ipsum"
        RenderBlock {P} at (0,122) size 784x18
          RenderText {TEXT} at (0,0) size 253x18
            text run at (0,0) width 253: "What it should look like (negative case):"
        RenderBlock {DIV} at (0,156) size 784x32 [border: (1px solid #008000)]
          RenderBlock {DIV} at (1,11) size 782x20 [border: (1px solid #0000FF)]
            RenderText {TEXT} at (1,1) size 84x18
              text run at (1,1) width 84: "Lorem ipsum"
          RenderBlock {DIV} at (1,21) size 782x20 [border: (1px dotted #0000FF)]
            RenderText {TEXT} at (1,1) size 84x18
              text run at (1,1) width 84: "Lorem ipsum"
        RenderBlock {P} at (0,204) size 784x18
          RenderText {TEXT} at (0,0) size 369x18
            text run at (0,0) width 369: "Dynamic case (automatically testing positive --> negative):"
        RenderBlock {DIV} at (0,238) size 784x32 [border: (1px solid #008000)]
          RenderBlock {DIV} at (1,11) size 782x20 [border: (1px solid #0000FF)]
            RenderText {TEXT} at (1,1) size 84x18
              text run at (1,1) width 84: "Lorem ipsum"
          RenderBlock {DIV} at (1,21) size 782x20 [border: (1px dotted #0000FF)]
            RenderText {TEXT} at (1,1) size 84x18
              text run at (1,1) width 84: "Lorem ipsum"
        RenderBlock (anonymous) at (0,270) size 784x40
          RenderBR {BR} at (0,0) size 0x18
          RenderButton {INPUT} at (2,20) size 104x18 [bgcolor=#C0C0C0]
            RenderBlock (anonymous) at (8,2) size 88x13
              RenderText at (0,0) size 88x13
                text run at (0,0) width 88: "Negative margin"
          RenderText {TEXT} at (108,19) size 4x18
            text run at (108,19) width 4: " "
          RenderButton {INPUT} at (114,20) size 98x18 [bgcolor=#C0C0C0]
            RenderBlock (anonymous) at (8,2) size 82x13
              RenderText at (0,0) size 82x13
                text run at (0,0) width 82: "Positive margin"
          RenderText {TEXT} at (0,0) size 0x0
        RenderBlock {P} at (0,326) size 784x18
          RenderText {TEXT} at (0,0) size 445x18
            text run at (0,0) width 445: "Dynamic case (automatically testing positive --> negative --> positive):"
        RenderBlock {DIV} at (0,360) size 784x72 [border: (1px solid #008000)]
          RenderBlock {DIV} at (1,11) size 782x20 [border: (1px solid #0000FF)]
            RenderText {TEXT} at (1,1) size 84x18
              text run at (1,1) width 84: "Lorem ipsum"
          RenderBlock {DIV} at (1,41) size 782x20 [border: (1px dotted #0000FF)]
            RenderText {TEXT} at (1,1) size 84x18
              text run at (1,1) width 84: "Lorem ipsum"
        RenderBlock (anonymous) at (0,432) size 784x40
          RenderBR {BR} at (0,0) size 0x18
          RenderButton {INPUT} at (2,20) size 104x18 [bgcolor=#C0C0C0]
            RenderBlock (anonymous) at (8,2) size 88x13
              RenderText at (0,0) size 88x13
                text run at (0,0) width 88: "Negative margin"
          RenderText {TEXT} at (108,19) size 4x18
            text run at (108,19) width 4: " "
          RenderButton {INPUT} at (114,20) size 98x18 [bgcolor=#C0C0C0]
            RenderBlock (anonymous) at (8,2) size 82x13
              RenderText at (0,0) size 82x13
                text run at (0,0) width 82: "Positive margin"
          RenderText {TEXT} at (0,0) size 0x0
          RenderText {TEXT} at (0,0) size 0x0
          RenderText {TEXT} at (0,0) size 0x0
  
  
  
  1.1                  LayoutTests/fast/css/margin-top-bottom-dynamic.html
  
  Index: margin-top-bottom-dynamic.html
  ===================================================================
  <html><head>
  <script type="text/javascript">
  <!--
  function setNegativeMargin(element)
  {
      document.getElementById(element).style["margin"] = "-10px 0px -10px 0px";
  }
  
  function setPositiveMargin(element)
  {
      document.getElementById(element).style["margin"] = "10px 0px 10px 0px";
  }
  
  function test()
  {
      setNegativeMargin("bar");
  
      // The following line forces a layout in Safari.
      window.scrollX;
  
      setNegativeMargin("foo");
      setPositiveMargin("bar");
  }
  //-->
  </script></head>
      <body onLoad="test();">
          <p>What it should look like (positive case): </p>
          <div style="border: 1px solid green; ">
              <div style="margin-top: 10px; border:1px solid blue;">Lorem ipsum</div>
              <div style="margin-top: 10px; margin-bottom: 10px; border:1px dotted blue;">Lorem ipsum</div>
          </div>
  
          <p>What it should look like (negative case):</p>
          <div style="border: 1px solid green; ">
              <div style="margin-top: 10px; border:1px solid blue;">Lorem ipsum</div>
              <div style="margin-top: -10px; margin-bottom: -10px; border:1px dotted blue;">Lorem ipsum</div>
          </div>
          <p>Dynamic case (automatically testing positive --&gt; negative):</p>
          <div style="border: 1px solid green; ">
              <div style="margin-top: 10px; border:1px solid blue;">Lorem ipsum</div>
              <div style="margin-top: 10px; margin-bottom: 10px; border:1px dotted blue;" id="foo">Lorem ipsum</div>
          </div>
          <br />
          <input type="submit" value="Negative margin" onClick="setNegativeMargin('foo');"/>
          <input type="submit" value="Positive margin" onClick="setPositiveMargin('foo');"/>
          <p>Dynamic case (automatically testing positive --&gt; negative --&gt; positive):</p>
          <div style="border: 1px solid green; ">
              <div style="margin-top: 10px; border:1px solid blue;">Lorem ipsum</div>
              <div style="margin-top: 10px; margin-bottom: 10px; border:1px dotted blue;" id="bar">Lorem ipsum</div>
          </div>
          <br />
          <input type="submit" value="Negative margin" onClick="setNegativeMargin('bar');"/>
          <input type="submit" value="Positive margin" onClick="setPositiveMargin('bar');"/>
  
      </body>
  </html>
  
  
  



More information about the webkit-changes mailing list