[webkit-changes] cvs commit: WebCore/manual-tests scrollToAnchor.html scrollToAnchorWithNewline.html

Vicki vicki at opensource.apple.com
Wed Sep 7 11:10:38 PDT 2005


vicki       05/09/07 11:10:38

  Modified:    .        ChangeLog
               khtml/xml dom_nodeimpl.cpp
  Added:       manual-tests scrollToAnchor.html
  Removed:     manual-tests scrollToAnchorWithNewline.html
  Log:
          Reviewed by Justin.
  
          - fix <rdar://problem/4246096> REGRESSION links to named anchors don't scroll to the right place (4825)
  
          This is really just a better fix for 4233844. Also consolidated manual-tests/scrollToAnchorWithNewline.html
  	and the test case from Bugzilla bug 4825 into manual-tests/scrollToAnchor.html.
  
          Test cases added:
          * manual-tests/scrollToAnchor.html: Added.
  
          * khtml/xml/dom_nodeimpl.cpp:
          (DOM::ContainerNodeImpl::getUpperLeftCorner): when calculating scroll position, skip child nodes of the anchor
          if they do not have text boxes.
  
  Revision  Changes    Path
  1.101     +16 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- ChangeLog	7 Sep 2005 08:00:26 -0000	1.100
  +++ ChangeLog	7 Sep 2005 18:10:36 -0000	1.101
  @@ -1,3 +1,19 @@
  +2005-09-07 Vicki Murley  <vicki at apple.com>
  +
  +        Reviewed by Justin.
  + 
  +        - fix <rdar://problem/4246096> REGRESSION links to named anchors don't scroll to the right place (4825)
  +
  +        This is really just a better fix for 4233844. Also consolidated manual-tests/scrollToAnchorWithNewline.html
  +	and the test case from Bugzilla bug 4825 into manual-tests/scrollToAnchor.html.
  +
  +        Test cases added:
  +        * manual-tests/scrollToAnchor.html: Added.
  +
  +        * khtml/xml/dom_nodeimpl.cpp:
  +        (DOM::ContainerNodeImpl::getUpperLeftCorner): when calculating scroll position, skip child nodes of the anchor
  +        if they do not have text boxes.
  +
   2005-09-07  Eric Seidel  <eseidel at apple.com>
           Fix by Tobias Lidskog <tobiaslidskog at mac.com>
   
  
  
  
  1.186     +4 -1      WebCore/khtml/xml/dom_nodeimpl.cpp
  
  Index: dom_nodeimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
  retrieving revision 1.185
  retrieving revision 1.186
  diff -u -r1.185 -r1.186
  --- dom_nodeimpl.cpp	7 Sep 2005 02:38:35 -0000	1.185
  +++ dom_nodeimpl.cpp	7 Sep 2005 18:10:37 -0000	1.186
  @@ -2238,7 +2238,10 @@
               }
               o = next;
           }
  -        if((o->isText() && !o->isBR() && static_cast<RenderText*>(o)->firstTextBox()) || o->isReplaced()) {
  +        if (o->parent()->element() == this && !static_cast<RenderText*>(o)->firstTextBox() ) {
  +            // do nothing - skip child node of the named anchor if it doesn't have a text box rdar://problems/4233844&4246096
  +        }
  +        else if((o->isText() && !o->isBR()) || o->isReplaced()) {
               o->container()->absolutePosition( xPos, yPos );
               if (o->isText())
                   xPos += static_cast<RenderText *>(o)->minXPos();
  
  
  
  1.1                  WebCore/manual-tests/scrollToAnchor.html
  
  Index: scrollToAnchor.html
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
          "http://www.w3.org/TR/html4/strict.dtd">
  <html lang="en">
  <head>
  </head>
  <body>
  <p><b>BUG IDs:</b></p>
  <a href="rdar://4233844">4233844</a> in some cases, HTML href named anchors don't scroll to the right place<br>
  <a href="rdar://problem/4246096">4246096</a> REGRESSION links to named anchors don't scroll to the right place (4825)
  
  <p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b> 
  Manually resize window to about 800 x 600.  Click on the links below.
  </p>
  
  <p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
  Page will scroll as indicated.
  </p>
  
  <p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
  Page will NOT scroll, or will not scroll to the position indicated.
  </p>
  
  <a href="#0">1. Click here.  Page should scroll to TARGET TEXT.</a>
  
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum consectetuer nulla a ligula. Vestibulum aliquet neque ac nunc. Sed ornare, ipsum sed blandit iaculis, nulla urna suscipit felis, id elementum dolor mi ac velit. Etiam quis velit vitae felis pretium venenatis. Donec lobortis, dui eget imperdiet tristique, velit pede rhoncus sapien, sed interdum quam felis mattis lectus. Sed quis sem. Curabitur pharetra felis eu eros suscipit egestas. Aenean tempus varius urna. Ut dolor. Fusce sem dolor, facilisis et, mollis ac, adipiscing ac, ipsum. Morbi fringilla, diam eget tincidunt consectetuer, mauris lectus vulputate quam, id ornare enim magna in pede. Vivamus commodo, sapien eget aliquam convallis, purus eros blandit libero, eget viverra diam nibh vel mi. Duis iaculis mollis ipsum. Duis accumsan posuere urna. Cras tempus. Pellentesque eu ante. Vestibulum nunc erat, tempus id, nonummy et, ullamcorper ac, odio. Aenean tincidunt enim sed ligula pellentesque lobortis. Do
 nec pellentesque luctus nisl. Maecenas blandit lacus et lacus.
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum consectetuer nulla a ligula. Vestibulum aliquet neque ac nunc. Sed ornare, ipsum sed blandit iaculis, nulla urna suscipit felis, id elementum dolor mi ac velit. Etiam quis velit vitae felis pretium venenatis. Donec lobortis, dui eget imperdiet tristique, velit pede rhoncus sapien, sed interdum quam felis mattis lectus. Sed quis sem. Curabitur pharetra felis eu eros suscipit egestas. Aenean tempus varius urna. Ut dolor. Fusce sem dolor, facilisis et, mollis ac, adipiscing ac, ipsum. Morbi fringilla, diam eget tincidunt consectetuer, mauris lectus vulputate quam, id ornare enim magna in pede. Vivamus commodo, sapien eget aliquam convallis, purus eros blandit libero, eget viverra diam nibh vel mi. Duis iaculis mollis ipsum. Duis accumsan posuere urna. Cras tempus. Pellentesque eu ante. Vestibulum nunc erat, tempus id, nonummy et, ullamcorper ac, odio. Aenean tincidunt enim sed ligula pellentesque lobortis. Do
 nec pellentesque luctus nisl. Maecenas blandit lacus et lacus.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum consectetuer nulla a ligula. Vestibulum aliquet neque ac nunc. Sed ornare, ipsum sed blandit iaculis, nulla urna suscipit felis, id elementum dolor mi ac velit. Etiam quis velit vitae felis pretium venenatis. Donec lobortis, dui eget imperdiet tristique, velit pede rhoncus sapien, sed interdum quam felis mattis lectus. Sed quis sem. Curabitur pharetra felis eu eros suscipit egestas. Aenean tempus varius urna. Ut dolor. Fusce sem dolor, facilisis et, mollis ac, adipiscing ac, ipsum. Morbi fringilla, diam eget tincidunt consectetuer, mauris lectus vulputate quam, id ornare enim magna in pede. Vivamus commodo, sapien eget aliquam convallis, purus eros blandit libero, eget viverra diam nibh vel mi. Duis iaculis mollis ipsum. Duis accumsan posuere urna. Cras tempus. Pellentesque eu ante. Vestibulum nunc erat, tempus id, nonummy et, ullamcorper ac, odi
 o. Aenean tincidunt enim sed ligula pellentesque lobortis. Donec pellentesque luctus nisl. Maecenas blandit lacus et lacus.
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum consectetuer nulla a ligula. Vestibulum aliquet neque ac nunc. Sed ornare, ipsum sed blandit iaculis, nulla urna suscipit felis, id elementum dolor mi ac velit. Etiam quis velit vitae felis pretium venenatis. Donec lobortis, dui eget imperdiet tristique, velit pede rhoncus sapien, sed interdum quam felis mattis lectus. Sed quis sem. Curabitur pharetra felis eu eros suscipit egestas. Aenean tempus varius urna. Ut dolor. Fusce sem dolor, facilisis et, mollis ac, adipiscing ac, ipsum. Morbi fringilla, diam eget tincidunt consectetuer, mauris lectus vulputate quam, id ornare enim magna in pede. Vivamus commodo, sapien eget aliquam convallis, purus eros blandit libero, eget viverra diam nibh vel mi. Duis iaculis mollis ipsum. Duis accumsan posuere urna. Cras tempus. Pellentesque eu ante. Vestibulum nunc erat, tempus id, nonummy et, ullamcorper ac, odio. Aenean tincidunt enim sed ligula pellentesque lobortis. 
  <a name="0">
  </a>
  TARGET TEXT
  <p><a href="#anchor">2. Click here. Page should scroll just a little bit, to the top of the red box below.</a></p>
  <a name="anchor"></a>
  <div style="width:100%; border:1px red solid; height:1000px;"></div>
  
  
  </body>
  </html>
  
  
  



More information about the webkit-changes mailing list