[webkit-changes] cvs commit: WebCore/kwq KWQTextField.h KWQTextField.mm

Timothy thatcher at opensource.apple.com
Fri Nov 11 00:17:19 PST 2005


thatcher    05/11/11 00:17:19

  Modified:    khtml/dom Tag: Safari-2-0-branch html_form.cpp html_form.h
               khtml/ecma Tag: Safari-2-0-branch kjs_html.cpp
               kwq      Tag: Safari-2-0-branch KWQTextField.h
                        KWQTextField.mm
  Log:
  Build fix for merge differences with the TOT version.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.9.6.2   +66 -0     WebCore/khtml/dom/Attic/html_form.cpp
  
  Index: html_form.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/dom/Attic/html_form.cpp,v
  retrieving revision 1.9.6.1
  retrieving revision 1.9.6.2
  diff -u -r1.9.6.1 -r1.9.6.2
  --- html_form.cpp	12 Jul 2005 00:45:42 -0000	1.9.6.1
  +++ html_form.cpp	11 Nov 2005 08:17:15 -0000	1.9.6.2
  @@ -552,6 +552,42 @@
   	((HTMLInputElementImpl *)impl)->select(  );
   }
   
  +bool HTMLInputElement::canHaveSelection()
  +{
  +    if(!impl) return false;
  +	return ((HTMLInputElementImpl *)impl)->canHaveSelection(  );
  +}
  +
  +long HTMLInputElement::selectionStart()
  +{
  +    if(!impl) return 0;
  +	return ((HTMLInputElementImpl *)impl)->selectionStart(  );
  +}
  +
  +long HTMLInputElement::selectionEnd()
  +{
  +    if(!impl) return 0;
  +	return ((HTMLInputElementImpl *)impl)->selectionEnd(  );
  +}
  +
  +void HTMLInputElement::setSelectionStart(long start)
  +{
  +    if(impl)
  +	((HTMLInputElementImpl *)impl)->setSelectionStart(start);
  +}
  +
  +void HTMLInputElement::setSelectionEnd(long end)
  +{
  +    if(impl)
  +	((HTMLInputElementImpl *)impl)->setSelectionStart(end);
  +}
  +
  +void HTMLInputElement::setSelectionRange(long start, long end)
  +{
  +    if(impl)
  +	((HTMLInputElementImpl *)impl)->setSelectionRange(start, end);
  +}
  +
   void HTMLInputElement::click(  )
   {
       if(impl)
  @@ -1055,12 +1091,42 @@
   	((HTMLTextAreaElementImpl*)impl)->focus();
   }
   
  +long HTMLTextAreaElement::selectionStart()
  +{
  +    if(!impl) return 0;
  +	return ((HTMLTextAreaElementImpl *)impl)->selectionStart(  );
  +}
  +
  +long HTMLTextAreaElement::selectionEnd()
  +{
  +    if(!impl) return 0;
  +	return ((HTMLTextAreaElementImpl *)impl)->selectionEnd(  );
  +}
  +
  +void HTMLTextAreaElement::setSelectionStart(long start)
  +{
  +    if(impl)
  +	((HTMLTextAreaElementImpl *)impl)->setSelectionStart(start);
  +}
  +
  +void HTMLTextAreaElement::setSelectionEnd(long start)
  +{
  +    if(impl)
  +	((HTMLTextAreaElementImpl *)impl)->setSelectionEnd(start);
  +}
  +
   void HTMLTextAreaElement::select(  )
   {
       if(impl)
   	((HTMLTextAreaElementImpl *)impl)->select(  );
   }
   
  +void HTMLTextAreaElement::setSelectionRange(long start, long end)
  +{
  +    if(impl)
  +	((HTMLTextAreaElementImpl *)impl)->setSelectionRange(start, end);
  +}
  +
   // --------------------------------------------------------------------------
   
   HTMLOptionElement::HTMLOptionElement() : HTMLElement()
  
  
  
  1.3.78.2  +13 -0     WebCore/khtml/dom/Attic/html_form.h
  
  Index: html_form.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/dom/Attic/html_form.h,v
  retrieving revision 1.3.78.1
  retrieving revision 1.3.78.2
  diff -u -r1.3.78.1 -r1.3.78.2
  --- html_form.h	12 Jul 2005 00:45:42 -0000	1.3.78.1
  +++ html_form.h	11 Nov 2005 08:17:15 -0000	1.3.78.2
  @@ -626,6 +626,13 @@
        */
       void select (  );
   
  +    bool canHaveSelection();
  +    long selectionStart();
  +    long selectionEnd();
  +    void setSelectionStart(long start);
  +    void setSelectionEnd(long start);
  +    void setSelectionRange(long start, long end);
  +
       /**
        * Simulate a mouse-click. For <code> INPUT </code> elements whose
        * <code> type </code> attribute has one of the following values:
  @@ -1161,6 +1168,12 @@
        */
       void focus (  );
   
  +    long selectionStart();
  +    long selectionEnd();
  +    void setSelectionStart(long start);
  +    void setSelectionEnd(long start);
  +    void setSelectionRange(long start, long end);
  +
       /**
        * Select the contents of the <code> TEXTAREA </code> .
        */
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.108.6.12 +15 -7     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.11
  retrieving revision 1.108.6.12
  diff -u -r1.108.6.11 -r1.108.6.12
  --- kjs_html.cpp	11 Nov 2005 06:39:26 -0000	1.108.6.11
  +++ kjs_html.cpp	11 Nov 2005 08:17:16 -0000	1.108.6.12
  @@ -34,6 +34,7 @@
   #include "html/html_baseimpl.h"
   #include "html/html_canvasimpl.h"
   #include "html/html_documentimpl.h"
  +#include "html/html_formimpl.h"
   #include "html/html_imageimpl.h"
   #include "html/html_objectimpl.h"
   
  @@ -68,8 +69,15 @@
   
   using DOM::DocumentImpl;
   using DOM::DOMString;
  +using DOM::ElementImpl;
   using DOM::HTMLFrameElementImpl;
  +using DOM::HTMLGenericFormElementImpl;
  +using DOM::HTMLHtmlElementImpl;
   using DOM::HTMLIFrameElementImpl;
  +using DOM::HTMLInputElement;
  +using DOM::HTMLInputElementImpl;
  +using DOM::HTMLTextAreaElement;
  +using DOM::HTMLTextAreaElementImpl;
   
   IMPLEMENT_PROTOFUNC(HTMLDocFunction)
   
  @@ -1272,7 +1280,7 @@
   }
   #endif
   
  -static Value getInputSelectionStart(HTMLInputElementImpl &input)
  +static Value getInputSelectionStart(HTMLInputElement &input)
   {
     if (input.canHaveSelection()) {
       return Number(input.selectionStart());
  @@ -1280,7 +1288,7 @@
     return Undefined();
   }
   
  -static Value getInputSelectionEnd(HTMLInputElementImpl &input)
  +static Value getInputSelectionEnd(HTMLInputElement &input)
   {
     if (input.canHaveSelection()) {
       return Number(input.selectionEnd());
  @@ -2031,7 +2039,7 @@
           return true;
       }
       case ID_INPUT: {
  -      HTMLInputElementImpl &input = static_cast<HTMLInputElementImpl &>(element);
  +      HTMLInputElement input = static_cast<HTMLInputElement>(element);
         const HashTable* table = classInfo()->propHashTable;
         const HashEntry* entry = Lookup::findEntry(table, propertyName);
         if (entry) {
  @@ -2171,10 +2179,6 @@
           form.reset();
           return Undefined();
         }
  -      else if (id == KJS::HTMLElement::InputSetSelectionRange) {
  -        input.setSelectionRange(args[0].toInt32(exec), args[1].toInt32(exec));
  -        return Undefined();
  -      }
       }
       break;
       case ID_SELECT: {
  @@ -2215,6 +2219,10 @@
           input.click();
           return Undefined();
         }
  +      else if (id == KJS::HTMLElement::InputSetSelectionRange) {
  +        input.setSelectionRange(args[0].toInt32(exec), args[1].toInt32(exec));
  +        return Undefined();
  +      }
       }
       break;
       case ID_BUTTON: {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.20.8.2  +2 -0      WebCore/kwq/KWQTextField.h
  
  Index: KWQTextField.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextField.h,v
  retrieving revision 1.20.8.1
  retrieving revision 1.20.8.2
  diff -u -r1.20.8.1 -r1.20.8.2
  --- KWQTextField.h	11 Nov 2005 06:39:35 -0000	1.20.8.1
  +++ KWQTextField.h	11 Nov 2005 08:17:18 -0000	1.20.8.2
  @@ -44,6 +44,8 @@
   
   - (void)detachQLineEdit;
   
  +- (BOOL)hasSelection;
  +
   - (void)setHasFocus:(BOOL)hasFocus;
   
   - (void)setMaximumLength:(int)len;
  
  
  
  1.77.8.3  +5 -0      WebCore/kwq/KWQTextField.mm
  
  Index: KWQTextField.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextField.mm,v
  retrieving revision 1.77.8.2
  retrieving revision 1.77.8.3
  diff -u -r1.77.8.2 -r1.77.8.3
  --- KWQTextField.mm	11 Nov 2005 06:39:35 -0000	1.77.8.2
  +++ KWQTextField.mm	11 Nov 2005 08:17:18 -0000	1.77.8.3
  @@ -390,6 +390,11 @@
       }
   }
   
  +- (BOOL)hasSelection
  +{
  +    return [self selectedRange].length > 0;
  +}
  +
   - (void)setHasFocus:(BOOL)nowHasFocus
   {
       if (!widget || nowHasFocus == hasFocus)
  
  
  



More information about the webkit-changes mailing list