[webkit-changes] cvs commit: LayoutTests/fast/forms option-script-expected.checksum option-script-expected.png option-script-expected.txt option-script.html

Adele adele at opensource.apple.com
Mon Nov 7 14:30:23 PST 2005


adele       05/11/07 14:30:23

  Modified:    .        ChangeLog
               khtml/html html_formimpl.cpp html_formimpl.h
  Added:       fast/forms option-script-expected.checksum
                        option-script-expected.png
                        option-script-expected.txt option-script.html
  Log:
          Reviewed by Darin Adler.
          Committed by Adele Peterson.
  
          - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5398
          source visible when <script> used inside <option>
  
          Added:
          * fast/forms/option-select.html
  
          * khtml/html/html_formimpl.h: (DOM::HTMLOptionElementImpl::checkDTD): Allow <script> tags to be children of option elements
          * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Skip the script content when creating text string
  
  Revision  Changes    Path
  1.343     +14 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.342
  retrieving revision 1.343
  diff -u -r1.342 -r1.343
  --- ChangeLog	7 Nov 2005 21:21:03 -0000	1.342
  +++ ChangeLog	7 Nov 2005 22:30:17 -0000	1.343
  @@ -1,3 +1,17 @@
  +2005-11-07  Antti Koivisto  <koivisto at iki.fi>
  +
  +        Reviewed by Darin Adler.
  +        Committed by Adele Peterson.
  +
  +        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5398
  +        source visible when <script> used inside <option>
  +
  +        Added:
  +        * fast/forms/option-select.html
  +
  +        * khtml/html/html_formimpl.h: (DOM::HTMLOptionElementImpl::checkDTD): Allow <script> tags to be children of option elements
  +        * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Skip the script content when creating text string
  +
   2005-11-07  Geoffrey Garen  <ggaren at apple.com>
   	        
           - Added manual test cases for <rdar://problem/4161660> window.close
  
  
  
  1.201     +7 -2      WebCore/khtml/html/html_formimpl.cpp
  
  Index: html_formimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.cpp,v
  retrieving revision 1.200
  retrieving revision 1.201
  diff -u -r1.200 -r1.201
  --- html_formimpl.cpp	26 Oct 2005 19:44:06 -0000	1.200
  +++ html_formimpl.cpp	7 Nov 2005 22:30:20 -0000	1.201
  @@ -3452,10 +3452,15 @@
               return text;
       }
   
  -    const NodeImpl *n = this;
  -    while ((n = n->traverseNextNode(this))) {
  +    const NodeImpl *n = this->firstChild();
  +    while (n) {
           if (n->nodeType() == Node::TEXT_NODE || n->nodeType() == Node::CDATA_SECTION_NODE)
               text += n->nodeValue();
  +        // skip script content
  +        if (n->isElementNode() && n->hasTagName(HTMLNames::scriptTag))
  +            n = n->traverseNextSibling(this);
  +        else
  +            n = n->traverseNextNode(this);
       }
   
       return text;
  
  
  
  1.93      +1 -1      WebCore/khtml/html/html_formimpl.h
  
  Index: html_formimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.h,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- html_formimpl.h	26 Oct 2005 19:44:06 -0000	1.92
  +++ html_formimpl.h	7 Nov 2005 22:30:21 -0000	1.93
  @@ -694,7 +694,7 @@
   
       virtual HTMLTagStatus endTagRequirement() const { return TagStatusOptional; }
       virtual int tagPriority() const { return 2; }
  -    virtual bool checkDTD(const NodeImpl* newChild) { return newChild->isTextNode(); }
  +    virtual bool checkDTD(const NodeImpl* newChild) { return newChild->isTextNode() || newChild->hasTagName(HTMLNames::scriptTag); }
   
       virtual bool isFocusable() const;
   
  
  
  
  1.1                  LayoutTests/fast/forms/option-script-expected.checksum
  
  Index: option-script-expected.checksum
  ===================================================================
  54cc44fd8bf4d3ffab2c57c49540344f
  
  
  1.1                  LayoutTests/fast/forms/option-script-expected.png
  
  	<<Binary file>>
  
  
  1.1                  LayoutTests/fast/forms/option-script-expected.txt
  
  Index: option-script-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
        RenderText {TEXT} at (0,0) size 346x18
          text run at (0,0) width 112: "TEST PASSED: "
          text run at (112,0) width 234: "If the popup menu only says \"Text\". "
        RenderBR {BR} at (0,0) size 0x0
        RenderText {TEXT} at (0,18) size 425x18
          text run at (0,18) width 109: "TEST FAILED: "
          text run at (109,18) width 316: "If the popup menu says \"document.write('Text')\". "
        RenderBR {BR} at (0,0) size 0x0
        RenderSelect {SELECT} at (2,38) size 55x18
        RenderText {TEXT} at (0,0) size 0x0
        RenderText {TEXT} at (0,0) size 0x0
  
  
  
  1.1                  LayoutTests/fast/forms/option-script.html
  
  Index: option-script.html
  ===================================================================
  <html>
  <body>
  TEST PASSED:  If the popup menu only says "Text".
  <br>
  TEST FAILED:  If the popup menu says "document.write('Text')".
  <br>
  <select>
  <option>
  <script>document.write('Text')</script>
  </select>
  </button>
  
  
  



More information about the webkit-changes mailing list