[webkit-changes] cvs commit: WebCore/layout-tests/fast/dom no-elements-expected.txt no-elements.html

Darin darin at opensource.apple.com
Tue Aug 23 15:53:21 PDT 2005


darin       05/08/23 15:53:21

  Modified:    .        ChangeLog
               khtml/html htmlparser.cpp
               layout-tests/fast/dom no-elements-expected.txt
                        no-elements.html
  Log:
          Reviewed by John.
  
          - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4545
            REGRESSION: content inside <nolayer> does not get in the DOM tree, but should
  
          * khtml/html/htmlparser.cpp: (HTMLParser::getNode): Remove code to omit children of <nolayer>.
  
          * layout-tests/fast/dom/no-elements.html: Update test for new behavior.
          * layout-tests/fast/dom/no-elements-expected.txt: Updated test results.
  
  Revision  Changes    Path
  1.3       +12 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ChangeLog	23 Aug 2005 22:42:33 -0000	1.2
  +++ ChangeLog	23 Aug 2005 22:53:20 -0000	1.3
  @@ -1,3 +1,15 @@
  +2005-08-20  Darin Adler  <darin at apple.com>
  +
  +        Reviewed by John.
  +
  +        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4545
  +          REGRESSION: content inside <nolayer> does not get in the DOM tree, but should
  +
  +        * khtml/html/htmlparser.cpp: (HTMLParser::getNode): Remove code to omit children of <nolayer>.
  +
  +        * layout-tests/fast/dom/no-elements.html: Update test for new behavior.
  +        * layout-tests/fast/dom/no-elements-expected.txt: Updated test results.
  +
   2005-08-23  Darin Adler  <darin at apple.com>
   
           - fixed test that was accessing a remote resource by accident
  
  
  
  1.104     +0 -7      WebCore/khtml/html/htmlparser.cpp
  
  Index: htmlparser.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/htmlparser.cpp,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- htmlparser.cpp	19 Aug 2005 23:58:27 -0000	1.103
  +++ htmlparser.cpp	23 Aug 2005 22:53:20 -0000	1.104
  @@ -758,12 +758,6 @@
       return true;
   }
   
  -bool HTMLParser::nolayerCreateErrorCheck(Token* t, NodeImpl*& result)
  -{
  -    setSkipMode(nolayerTag);
  -    return true;
  -}
  -
   NodeImpl *HTMLParser::getNode(Token* t)
   {
       // Init our error handling table.
  @@ -801,7 +795,6 @@
           gFunctionMap.insert(noembedTag.localName().implementation(), &HTMLParser::noembedCreateErrorCheck);
           gFunctionMap.insert(noframesTag.localName().implementation(), &HTMLParser::noframesCreateErrorCheck);
           gFunctionMap.insert(noscriptTag.localName().implementation(), &HTMLParser::noscriptCreateErrorCheck);
  -        gFunctionMap.insert(nolayerTag.localName().implementation(), &HTMLParser::nolayerCreateErrorCheck);
       }
   
       bool proceed = true;
  
  
  
  1.2       +7 -2      WebCore/layout-tests/fast/dom/no-elements-expected.txt
  
  Index: no-elements-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/dom/no-elements-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- no-elements-expected.txt	19 Aug 2005 23:58:28 -0000	1.1
  +++ no-elements-expected.txt	23 Aug 2005 22:53:20 -0000	1.2
  @@ -1,3 +1,8 @@
  -This tests that the elements noframes, nolayer, noscript and noembed are created as elements and put in the DOM tree. The elements should not contain any children. If the test is successful, the text "Success" will be seen below.
  -Success
  +This tests that the elements noframes, nolayer, noscript and noembed are created as elements and put in the DOM tree. The elements other than <nolayer> should not contain any children. If the test is successful, the four messages below will list 0, 0, 0, and 1 child.
  +
  +This is nolayer.
  +noframes has 0 children.
  +noscript has 0 children.
  +noembed has 0 children.
  +nolayer has 1 children.
   
  
  
  
  1.2       +25 -34    WebCore/layout-tests/fast/dom/no-elements.html
  
  Index: no-elements.html
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/fast/dom/no-elements.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- no-elements.html	19 Aug 2005 23:58:28 -0000	1.1
  +++ no-elements.html	23 Aug 2005 22:53:20 -0000	1.2
  @@ -1,47 +1,38 @@
   <html>
   <head>
  -<style>
  -</style>
   <script>
  -function debug(str) {
  -	li = document.createElement('li');
  -	li.appendChild(document.createTextNode(str));
  -	document.getElementById('console').appendChild(li);
  +function print(str) {
  +    li = document.createElement('li');
  +    li.appendChild(document.createTextNode(str));
  +    document.getElementById('console').appendChild(li);
   }
  -
  -function checkElement(id) {
  -	t = document.getElementById(id);
  -	
  -	if (t == null)
  -		return false;
  -		
  -	if (t.firstChild != null)
  -		return false;
  -		
  -	return true;
  +function printNumChildren(id)
  +{
  +    t = document.getElementById(id);
  +    if (t == null) {
  +        print("Can't find " + id + ".");
  +    } else {
  +        print(id + " has " + t.childNodes.length + " children.");
  +    }
   }
  -
   function runTests() {
  -	if (window.layoutTestController)
  -		layoutTestController.dumpAsText();
  -		
  -	if (!checkElement('noframes') ||
  -		!checkElement('nolayer') ||
  -		!checkElement('noscript') ||
  -		!checkElement('noembed')) 
  -		debug("Failure");
  -	else
  -		debug("Success");
  +    if (window.layoutTestController)
  +        layoutTestController.dumpAsText();
  +    printNumChildren('noframes');
  +    printNumChildren('noscript');
  +    printNumChildren('noembed');
  +    printNumChildren('nolayer');
   }
  -
   </script>
   </head>
   <body onload="runTests()">
  -This tests that the elements noframes, nolayer, noscript and noembed are created as elements and put in the DOM tree. The elements should not contain any children. If the test is successful, the text "Success" will be seen below.
  -<noframes id="noframes">This is noframes</noframes>
  -<nolayer id="nolayer">This is nolayer</nolayer>
  -<noscript id="noscript">This is noscript</noscript>
  -<noembed id="noembed">This is noembed</noembed>
  +<p>This tests that the elements noframes, nolayer, noscript and noembed are created as elements and put in the DOM tree.
  +The elements other than &lt;nolayer&gt; should not contain any children.
  +If the test is successful, the four messages below will list 0, 0, 0, and 1 child.</p>
  +<noframes id="noframes">This is noframes.</noframes>
  +<noscript id="noscript">This is noscript.</noscript>
  +<noembed id="noembed">This is noembed.</noembed>
  +<nolayer id="nolayer">This is nolayer.</nolayer>
   <ul id="console">
   </ul>
   </body>
  
  
  



More information about the webkit-changes mailing list