[webkit-changes] cvs commit: WebCore/khtml/html html_formimpl.cpp html_formimpl.h

Adele adele at opensource.apple.com
Mon Jul 11 17:45:46 PDT 2005


adele       05/07/11 17:45:46

  Modified:    .        Tag: Safari-2-0-branch ChangeLog
               khtml/dom Tag: Safari-2-0-branch html_form.cpp html_form.h
               khtml/ecma Tag: Safari-2-0-branch kjs_html.cpp kjs_html.h
                        kjs_html.lut.h
               khtml/html Tag: Safari-2-0-branch html_formimpl.cpp
                        html_formimpl.h
  Log:
          Merged fix from TOT to Safari-2-0-branch
          <rdar://problem/4164926> no focus or blur methods on HTML button elements
  
      2005-04-04  Vicki Murley  <vicki at apple.com>
  
          Reviewed by Maciej.
  
  	- fixed <rdar://problem/3871669> no focus or blur methods on HTML button elements
  
          * khtml/dom/html_form.cpp:
          (HTMLButtonElement::focus):
          (HTMLButtonElement::blur):
          * khtml/dom/html_form.h:
          * khtml/ecma/kjs_html.cpp:
          (KJS::HTMLElementFunction::tryCall):
          * khtml/ecma/kjs_html.h:
          (KJS::HTMLElement::):
          * khtml/ecma/kjs_html.lut.h:
          (KJS::):
          * khtml/html/html_formimpl.cpp:
          (DOM::HTMLButtonElementImpl::blur):
          (DOM::HTMLButtonElementImpl::focus):
          * khtml/html/html_formimpl.h:
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4104.2.45 +26 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4104.2.44
  retrieving revision 1.4104.2.45
  diff -u -r1.4104.2.44 -r1.4104.2.45
  --- ChangeLog	12 Jul 2005 00:35:50 -0000	1.4104.2.44
  +++ ChangeLog	12 Jul 2005 00:45:36 -0000	1.4104.2.45
  @@ -1,6 +1,32 @@
   2005-07-11  Adele Peterson  <adele at apple.com>
   
           Merged fix from TOT to Safari-2-0-branch
  +        <rdar://problem/4164926> no focus or blur methods on HTML button elements
  +
  +    2005-04-04  Vicki Murley  <vicki at apple.com>
  +
  +        Reviewed by Maciej.
  +
  +	- fixed <rdar://problem/3871669> no focus or blur methods on HTML button elements
  +
  +        * khtml/dom/html_form.cpp:
  +        (HTMLButtonElement::focus): 
  +        (HTMLButtonElement::blur): 
  +        * khtml/dom/html_form.h: 
  +        * khtml/ecma/kjs_html.cpp:
  +        (KJS::HTMLElementFunction::tryCall):
  +        * khtml/ecma/kjs_html.h:
  +        (KJS::HTMLElement::):
  +        * khtml/ecma/kjs_html.lut.h:
  +        (KJS::):
  +        * khtml/html/html_formimpl.cpp:
  +        (DOM::HTMLButtonElementImpl::blur):
  +        (DOM::HTMLButtonElementImpl::focus):
  +        * khtml/html/html_formimpl.h:
  +
  +2005-07-11  Adele Peterson  <adele at apple.com>
  +
  +        Merged fix from TOT to Safari-2-0-branch
           <rdar://problem/4164913> implement Mozilla "DOMParser" extension for use with XMLHTTPRequest
   
       2005-06-08  Anders Carlsson  <andersca at mac.com>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.6.1   +12 -0     WebCore/khtml/dom/html_form.cpp
  
  Index: html_form.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/dom/html_form.cpp,v
  retrieving revision 1.9
  retrieving revision 1.9.6.1
  diff -u -r1.9 -r1.9.6.1
  --- html_form.cpp	19 Mar 2005 00:34:06 -0000	1.9
  +++ html_form.cpp	12 Jul 2005 00:45:42 -0000	1.9.6.1
  @@ -100,6 +100,18 @@
       if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_NAME, value);
   }
   
  +void HTMLButtonElement::focus(  )
  +{
  +    if(impl)
  +	((HTMLButtonElementImpl*)impl)->focus();
  +}
  +
  +void HTMLButtonElement::blur(  )
  +{
  +    if(impl)
  +	((HTMLButtonElementImpl*)impl)->blur();
  +}
  +
   long HTMLButtonElement::tabIndex() const
   {
       if(!impl) return 0;
  
  
  
  1.3.78.1  +13 -2     WebCore/khtml/dom/html_form.h
  
  Index: html_form.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/dom/html_form.h,v
  retrieving revision 1.3
  retrieving revision 1.3.78.1
  diff -u -r1.3 -r1.3.78.1
  --- html_form.h	15 Apr 2002 23:41:59 -0000	1.3
  +++ html_form.h	12 Jul 2005 00:45:42 -0000	1.3.78.1
  @@ -109,7 +109,7 @@
        * see @ref name
        */
       void setName( const DOMString & );
  -
  +    
       /**
        * Index that represents the element's position in the tabbing
        * order. See the <a
  @@ -144,8 +144,19 @@
        * see @ref value
        */
       void setValue( const DOMString & );
  +    
  +    /**
  +     * Removes keyboard focus from this element.
  +     *
  +     */
  +    void blur (  );
  +        
  +    /**
  +     * Gives keyboard focus to this element.
  +     *
  +     */
  +    void focus (  );
   };
  -
   // --------------------------------------------------------------------------
   
   class HTMLFieldSetElementImpl;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.108.6.2 +15 -0     WebCore/khtml/ecma/kjs_html.cpp
  
  Index: kjs_html.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.cpp,v
  retrieving revision 1.108.6.1
  retrieving revision 1.108.6.2
  diff -u -r1.108.6.1 -r1.108.6.2
  --- kjs_html.cpp	24 May 2005 17:06:41 -0000	1.108.6.1
  +++ kjs_html.cpp	12 Jul 2005 00:45:43 -0000	1.108.6.2
  @@ -818,6 +818,8 @@
     tabIndex	KJS::HTMLElement::ButtonTabIndex	DontDelete
     type		KJS::HTMLElement::ButtonType		DontDelete|ReadOnly
     value		KJS::HTMLElement::ButtonValue		DontDelete
  +  blur		KJS::HTMLElement::ButtonBlur		DontDelete|Function 0
  +  focus		KJS::HTMLElement::ButtonFocus		DontDelete|Function 0
   @end
   @begin HTMLLabelElementTable 3
     form		KJS::HTMLElement::LabelForm		DontDelete|ReadOnly
  @@ -2169,6 +2171,19 @@
         }
       }
       break;
  +    case ID_BUTTON: {
  +      DOM::HTMLButtonElement button = element;
  +      
  +      if (id == KJS::HTMLElement::ButtonBlur) {
  +        button.blur();
  +        return Undefined();
  +      }
  +      else if (id == KJS::HTMLElement::ButtonFocus) {
  +        button.focus();
  +        return Undefined();
  +      }
  +    }
  +    break;
       case ID_TEXTAREA: {
         DOM::HTMLTextAreaElement textarea = element;
         if (id == KJS::HTMLElement::TextAreaBlur) {
  
  
  
  1.41.6.1  +1 -1      WebCore/khtml/ecma/kjs_html.h
  
  Index: kjs_html.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.h,v
  retrieving revision 1.41
  retrieving revision 1.41.6.1
  diff -u -r1.41 -r1.41.6.1
  --- kjs_html.h	10 Mar 2005 04:04:46 -0000	1.41
  +++ kjs_html.h	12 Jul 2005 00:45:43 -0000	1.41.6.1
  @@ -107,7 +107,7 @@
              TextAreaAccessKey, TextAreaName, TextAreaDefaultValue, TextAreaSelect,
              TextAreaCols, TextAreaDisabled, TextAreaForm, TextAreaType,
              TextAreaTabIndex, TextAreaReadOnly, TextAreaRows, TextAreaValue,
  -           TextAreaBlur, TextAreaFocus, ButtonForm, ButtonTabIndex, ButtonName,
  +           TextAreaBlur, TextAreaFocus, ButtonBlur, ButtonFocus, ButtonForm, ButtonTabIndex, ButtonName,
              ButtonDisabled, ButtonAccessKey, ButtonType, ButtonValue, LabelHtmlFor,
              LabelForm, LabelAccessKey, FieldSetForm, LegendForm, LegendAccessKey,
              LegendAlign, UListType, UListCompact, OListStart, OListCompact,
  
  
  
  1.29.8.1  +6 -4      WebCore/khtml/ecma/Attic/kjs_html.lut.h
  
  Index: kjs_html.lut.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/Attic/kjs_html.lut.h,v
  retrieving revision 1.29
  retrieving revision 1.29.8.1
  diff -u -r1.29 -r1.29.8.1
  --- kjs_html.lut.h	25 Oct 2004 18:26:01 -0000	1.29
  +++ kjs_html.lut.h	12 Jul 2005 00:45:43 -0000	1.29.8.1
  @@ -362,15 +362,17 @@
      { 0, 0, 0, 0, 0 },
      { 0, 0, 0, 0, 0 },
      { "form", KJS::HTMLElement::ButtonForm, DontDelete|ReadOnly, 0, &HTMLButtonElementTableEntries[7] },
  -   { "tabIndex", KJS::HTMLElement::ButtonTabIndex, DontDelete, 0, 0 },
  +   { "tabIndex", KJS::HTMLElement::ButtonTabIndex, DontDelete, 0, &HTMLButtonElementTableEntries[9] },
      { "name", KJS::HTMLElement::ButtonName, DontDelete, 0, 0 },
  -   { "disabled", KJS::HTMLElement::ButtonDisabled, DontDelete, 0, 0 },
  +   { "disabled", KJS::HTMLElement::ButtonDisabled, DontDelete, 0, &HTMLButtonElementTableEntries[10] },
      { "accessKey", KJS::HTMLElement::ButtonAccessKey, DontDelete, 0, 0 },
      { "type", KJS::HTMLElement::ButtonType, DontDelete|ReadOnly, 0, &HTMLButtonElementTableEntries[8] },
  -   { "value", KJS::HTMLElement::ButtonValue, DontDelete, 0, 0 }
  +   { "value", KJS::HTMLElement::ButtonValue, DontDelete, 0, 0 },
  +   { "blur", KJS::HTMLElement::ButtonBlur, DontDelete|Function, 0, 0 },
  +   { "focus", KJS::HTMLElement::ButtonFocus, DontDelete|Function, 0, 0 }
   };
   
  -const struct HashTable HTMLButtonElementTable = { 2, 9, HTMLButtonElementTableEntries, 7 };
  +const struct HashTable HTMLButtonElementTable = { 2, 11, HTMLButtonElementTableEntries, 7 };
   
   } // namespace
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.156.6.1 +11 -0     WebCore/khtml/html/html_formimpl.cpp
  
  Index: html_formimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.cpp,v
  retrieving revision 1.156
  retrieving revision 1.156.6.1
  diff -u -r1.156 -r1.156.6.1
  --- html_formimpl.cpp	19 Mar 2005 00:34:06 -0000	1.156
  +++ html_formimpl.cpp	12 Jul 2005 00:45:44 -0000	1.156.6.1
  @@ -1109,6 +1109,17 @@
       return getAttribute(ATTR_TYPE);
   }
   
  +void HTMLButtonElementImpl::blur()
  +{
  +    if(getDocument()->focusNode() == this)
  +	getDocument()->setFocusNode(0);
  +}
  +
  +void HTMLButtonElementImpl::focus()
  +{
  +    getDocument()->setFocusNode(this);
  +}
  +
   void HTMLButtonElementImpl::parseHTMLAttribute(HTMLAttributeImpl *attr)
   {
       switch(attr->id())
  
  
  
  1.67.6.1  +2 -0      WebCore/khtml/html/html_formimpl.h
  
  Index: html_formimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.h,v
  retrieving revision 1.67
  retrieving revision 1.67.6.1
  diff -u -r1.67 -r1.67.6.1
  --- html_formimpl.h	19 Mar 2005 00:34:07 -0000	1.67
  +++ html_formimpl.h	12 Jul 2005 00:45:45 -0000	1.67.6.1
  @@ -236,6 +236,8 @@
   
       virtual void click(bool sendMouseEvents);
       virtual void accessKeyAction(bool sendToAnyElement);
  +    void blur();
  +    void focus();
       
   protected:
       DOMString m_value;
  
  
  



More information about the webkit-changes mailing list