[webkit-changes] cvs commit: WebCore/layout-tests/dom/html/level2/html HTMLSelectElement20-expected.txt

Darin darin at opensource.apple.com
Sun Aug 14 01:07:24 PDT 2005


darin       05/08/14 01:07:24

  Modified:    .        ChangeLog Makefile.am
               khtml/ecma kjs_html.cpp
               khtml/html html_formimpl.cpp html_formimpl.h
               kwq      DOMHTML.mm
               layout-tests/dom/html/level2/html
                        HTMLSelectElement20-expected.txt
  Log:
          Reviewed and landed by Darin.
  
          Test cases added:
          * layout-tests/dom/html/level2/html/HTMLSelectElement20-expected.txt:
  	This passes now.
  
          * khtml/ecma/kjs_html.cpp:
          (KJS::KJS::HTMLElementFunction::callAsFunction):
          (KJS::KJS::HTMLSelectCollection::put):
  	Handle exceptions.
  
          * khtml/html/html_formimpl.cpp:
          (DOM::HTMLSelectElementImpl::add):
          * khtml/html/html_formimpl.h:
  	Make ::add raise an exception if before isn't a descendant
  	of the select element.
  
          * kwq/DOMHTML.mm:
          (-[DOMHTMLSelectElement add::]):
  	Handle the exception.
  
  Revision  Changes    Path
  1.4566    +23 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4565
  retrieving revision 1.4566
  diff -u -r1.4565 -r1.4566
  --- ChangeLog	12 Aug 2005 22:43:36 -0000	1.4565
  +++ ChangeLog	14 Aug 2005 08:07:18 -0000	1.4566
  @@ -1,3 +1,26 @@
  +2005-08-14  Anders Carlsson  <andersca at mac.com>
  +
  +        Reviewed and landed by Darin.
  +
  +        Test cases added:
  +        * layout-tests/dom/html/level2/html/HTMLSelectElement20-expected.txt:
  +	This passes now.
  +
  +        * khtml/ecma/kjs_html.cpp:
  +        (KJS::KJS::HTMLElementFunction::callAsFunction):
  +        (KJS::KJS::HTMLSelectCollection::put):
  +	Handle exceptions.
  +
  +        * khtml/html/html_formimpl.cpp:
  +        (DOM::HTMLSelectElementImpl::add):
  +        * khtml/html/html_formimpl.h:
  +	Make ::add raise an exception if before isn't a descendant
  +	of the select element.
  +
  +        * kwq/DOMHTML.mm:
  +        (-[DOMHTMLSelectElement add::]):
  +	Handle the exception.
  +
   2005-08-12  Geoffrey Garen  <ggaren at apple.com>
   
           Reviewed by adele.
  
  
  
  1.37      +3 -1      WebCore/Makefile.am
  
  Index: Makefile.am
  ===================================================================
  RCS file: /cvs/root/WebCore/Makefile.am,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- Makefile.am	26 Jul 2005 17:28:58 -0000	1.36
  +++ Makefile.am	14 Aug 2005 08:07:20 -0000	1.37
  @@ -1,8 +1,10 @@
   all-am:
   	defaults write com.apple.Xcode PBXProductDirectory "$(SYMROOTS)"
   	defaults write com.apple.Xcode PBXIntermediatesDirectory "$(SYMROOTS)"
  +	../WebKitTools/Scripts/set-webkit-configuration --$(BUILDSTYLE)
   	xcodebuild -configuration $(BUILDSTYLE)
   clean-am:
   	defaults write com.apple.Xcode PBXProductDirectory "$(SYMROOTS)"
   	defaults write com.apple.Xcode PBXIntermediatesDirectory "$(SYMROOTS)"
  -	xcodebuild clean -configuration ${BUILDSTYLE}
  +	../WebKitTools/Scripts/set-webkit-configuration --$(BUILDSTYLE)
  +	xcodebuild clean -configuration $(BUILDSTYLE)
  
  
  
  1.134     +9 -5      WebCore/khtml/ecma/kjs_html.cpp
  
  Index: kjs_html.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.cpp,v
  retrieving revision 1.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- kjs_html.cpp	8 Aug 2005 04:07:41 -0000	1.133
  +++ kjs_html.cpp	14 Aug 2005 08:07:22 -0000	1.134
  @@ -2352,7 +2352,7 @@
       else if (element.hasLocalName(selectTag)) {
           HTMLSelectElementImpl &select = static_cast<HTMLSelectElementImpl &>(element);
           if (id == KJS::HTMLElement::SelectAdd) {
  -            select.add(toHTMLElement(args[0]), toHTMLElement(args[1]));
  +            select.add(toHTMLElement(args[0]), toHTMLElement(args[1]), exception);
               return Undefined();
           }
           else if (id == KJS::HTMLElement::SelectRemove) {
  @@ -3498,7 +3498,9 @@
       if (diff < 0) { // add dummy elements
         do {
           ElementImpl *option = m_element->ownerDocument()->createElement("option", exception);
  -        m_element->add(static_cast<HTMLElementImpl *>(option), 0);
  +        if (exception)
  +          break;         
  +        m_element->add(static_cast<HTMLElementImpl *>(option), 0, exception);
           if (exception)
             break;
         } while (++diff);
  @@ -3535,8 +3537,10 @@
       while (diff--) {
         ElementImpl *dummyOption = m_element->ownerDocument()->createElement("option", exception);
         if (!dummyOption)
  -        break;
  -      m_element->add(static_cast<HTMLElementImpl *>(dummyOption), 0);
  +        break;      
  +      m_element->add(static_cast<HTMLElementImpl *>(dummyOption), 0, exception);
  +      if (exception) 
  +          break;
       }
       // replace an existing entry ?
     } else if (diff < 0) {
  @@ -3545,7 +3549,7 @@
     }
     // finally add the new element
     if (exception == 0)
  -    m_element->add(static_cast<HTMLOptionElementImpl *>(option), before);
  +    m_element->add(static_cast<HTMLOptionElementImpl *>(option), before, exception);
   
     setDOMException(exec, exception);
   }
  
  
  
  1.185     +3 -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.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- html_formimpl.cpp	8 Aug 2005 21:11:59 -0000	1.184
  +++ html_formimpl.cpp	14 Aug 2005 08:07:22 -0000	1.185
  @@ -2800,12 +2800,13 @@
       return len;
   }
   
  -void HTMLSelectElementImpl::add( HTMLElementImpl *element, HTMLElementImpl *before )
  +void HTMLSelectElementImpl::add( HTMLElementImpl *element, HTMLElementImpl *before, int &exceptioncode )
   {
  +    SharedPtr<HTMLElementImpl> protectNewChild(element); // make sure the element is ref'd and deref'd so we don't leak it
  +
       if (!element || !element->hasLocalName(optionTag))
           return;
   
  -    int exceptioncode = 0;
       insertBefore(element, before, exceptioncode);
       if (!exceptioncode)
           setRecalcListItems();
  
  
  
  1.86      +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.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- html_formimpl.h	8 Aug 2005 21:11:59 -0000	1.85
  +++ html_formimpl.h	14 Aug 2005 08:07:23 -0000	1.86
  @@ -563,7 +563,7 @@
   
       bool multiple() const { return m_multiple; }
   
  -    void add ( HTMLElementImpl *element, HTMLElementImpl *before );
  +    void add ( HTMLElementImpl *element, HTMLElementImpl *before, int &exceptioncode );
       void remove ( long index );
       void blur();
       void focus();
  
  
  
  1.26      +3 -1      WebCore/kwq/DOMHTML.mm
  
  Index: DOMHTML.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMHTML.mm,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DOMHTML.mm	1 Aug 2005 16:12:03 -0000	1.25
  +++ DOMHTML.mm	14 Aug 2005 08:07:23 -0000	1.26
  @@ -1133,7 +1133,9 @@
   
   - (void)add:(DOMHTMLElement *)element :(DOMHTMLElement *)before
   {
  -    [self _selectElementImpl]->add([element _HTMLElementImpl], [before _HTMLElementImpl]);
  +    int exceptionCode = 0;
  +    [self _selectElementImpl]->add([element _HTMLElementImpl], [before _HTMLElementImpl], exceptionCode);
  +    raiseOnDOMError(exceptionCode);
   }
   
   - (void)remove:(long)index
  
  
  
  1.2       +2 -3      WebCore/layout-tests/dom/html/level2/html/HTMLSelectElement20-expected.txt
  
  Index: HTMLSelectElement20-expected.txt
  ===================================================================
  RCS file: /cvs/root/WebCore/layout-tests/dom/html/level2/html/HTMLSelectElement20-expected.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTMLSelectElement20-expected.txt	26 Jul 2005 08:35:49 -0000	1.1
  +++ HTMLSelectElement20-expected.txt	14 Aug 2005 08:07:23 -0000	1.2
  @@ -1,3 +1,2 @@
  -Test:	http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLSelectElement20	
  -Status:	failure
  -Detail:	throw_NOT_FOUND_ERR: assertTrue failed
  +Test:	http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLSelectElement20
  +Status:	Success
  
  
  



More information about the webkit-changes mailing list