Changeset 45723 in webkit


Ignore:
Timestamp:
Jul 10, 2009 1:32:43 PM (15 years ago)
Author:
bolsinga@apple.com
Message:

WebCore:

2009-07-10 Greg Bolsinga <bolsinga@apple.com>

Reviewed by Antti Koivisto.

Add delegate methods about focus and blur and state change
https://bugs.webkit.org/show_bug.cgi?id=27153

Call the appropriate new ChromeClient methods for focus and blur.

  • html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::dispatchFocusEvent): (WebCore::HTMLFormControlElement::dispatchBlurEvent):
  • html/HTMLFormControlElement.h:
  • loader/EmptyClients.h: (WebCore::EmptyChromeClient::formDidFocus): (WebCore::EmptyChromeClient::formDidBlur):
  • page/ChromeClient.h:

WebKit/mac:

2009-07-10 Greg Bolsinga <bolsinga@apple.com>

Reviewed by Antti Koivisto.

Add delegate methods about focus and blur and state change
https://bugs.webkit.org/show_bug.cgi?id=27153

Call the appropriate private delegate methods from the ChromeClient.

  • WebCoreSupport/WebChromeClient.h:
  • WebCoreSupport/WebChromeClient.mm: (WebChromeClient::formStateDidChange): (WebChromeClient::formDidFocus): (WebChromeClient::formDidBlur):
  • WebView/WebUIDelegatePrivate.h:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r45721 r45723  
     12009-07-10  Greg Bolsinga  <bolsinga@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Add delegate methods about focus and blur and state change
     6        https://bugs.webkit.org/show_bug.cgi?id=27153
     7
     8        Call the appropriate new ChromeClient methods for focus and blur.
     9
     10        * html/HTMLFormControlElement.cpp:
     11        (WebCore::HTMLFormControlElement::dispatchFocusEvent):
     12        (WebCore::HTMLFormControlElement::dispatchBlurEvent):
     13        * html/HTMLFormControlElement.h:
     14        * loader/EmptyClients.h:
     15        (WebCore::EmptyChromeClient::formDidFocus):
     16        (WebCore::EmptyChromeClient::formDidBlur):
     17        * page/ChromeClient.h:
     18
    1192009-07-10  Steve Falkenburg  <sfalken@apple.com>
    220
  • trunk/WebCore/html/HTMLFormControlElement.cpp

    r44758 r45723  
    2626#include "HTMLFormControlElement.h"
    2727
     28#include "ChromeClient.h"
    2829#include "Document.h"
    2930#include "EventHandler.h"
     
    3637#include "HTMLTokenizer.h"
    3738#include "MappedAttribute.h"
     39#include "Page.h"
    3840#include "RenderBox.h"
    3941#include "RenderTheme.h"
     
    243245}
    244246   
     247void HTMLFormControlElement::dispatchFocusEvent()
     248{
     249    if (document()->frame() && document()->frame()->page())
     250        document()->frame()->page()->chrome()->client()->formDidFocus(this);
     251
     252    HTMLElement::dispatchFocusEvent();
     253}
     254
     255void HTMLFormControlElement::dispatchBlurEvent()
     256{
     257    if (document()->frame() && document()->frame()->page())
     258        document()->frame()->page()->chrome()->client()->formDidBlur(this);
     259
     260    HTMLElement::dispatchBlurEvent();
     261}
     262
    245263bool HTMLFormControlElement::supportsFocus() const
    246264{
  • trunk/WebCore/html/HTMLFormControlElement.h

    r44100 r45723  
    101101    void formDestroyed() { m_form = 0; }
    102102
     103    virtual void dispatchFocusEvent();
     104    virtual void dispatchBlurEvent();
     105
    103106protected:
    104107    void removeFromForm();
  • trunk/WebCore/loader/EmptyClients.h

    r45679 r45723  
    138138    virtual void formStateDidChange(const Node*) { }
    139139
     140    virtual void formDidFocus(const Node*) { }
     141    virtual void formDidBlur(const Node*) { }
     142
    140143    virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
    141144
  • trunk/WebCore/page/ChromeClient.h

    r44096 r45723  
    169169        // will be called frequently, so handling should be very fast.
    170170        virtual void formStateDidChange(const Node*) = 0;
     171       
     172        virtual void formDidFocus(const Node*) = 0;
     173        virtual void formDidBlur(const Node*) = 0;
    171174
    172175        virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() = 0;
  • trunk/WebKit/mac/ChangeLog

    r45712 r45723  
     12009-07-10  Greg Bolsinga  <bolsinga@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Add delegate methods about focus and blur and state change
     6        https://bugs.webkit.org/show_bug.cgi?id=27153
     7
     8        Call the appropriate private delegate methods from the ChromeClient.
     9       
     10        * WebCoreSupport/WebChromeClient.h:
     11        * WebCoreSupport/WebChromeClient.mm:
     12        (WebChromeClient::formStateDidChange):
     13        (WebChromeClient::formDidFocus):
     14        (WebChromeClient::formDidBlur):
     15        * WebView/WebUIDelegatePrivate.h:
     16
    1172009-07-09  Brian Weinstein  <bweinstein@apple.com>
    218
  • trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h

    r44096 r45723  
    134134    virtual WebCore::String generateReplacementFile(const WebCore::String& path);
    135135
    136     virtual void formStateDidChange(const WebCore::Node*) { }
     136    virtual void formStateDidChange(const WebCore::Node*);
     137
     138    virtual void formDidFocus(const WebCore::Node*);
     139    virtual void formDidBlur(const WebCore::Node*);
    137140
    138141    virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
  • trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm

    r44451 r45723  
    657657}
    658658
     659void WebChromeClient::formStateDidChange(const WebCore::Node* node)
     660{
     661    CallUIDelegate(m_webView, @selector(webView:formStateDidChangeForNode:), kit(const_cast<WebCore::Node*>(node)));
     662}
     663
     664void WebChromeClient::formDidFocus(const WebCore::Node* node)
     665{
     666    CallUIDelegate(m_webView, @selector(webView:formStateDidFocusNode:), kit(const_cast<WebCore::Node*>(node)));
     667}
     668
     669void WebChromeClient::formDidBlur(const WebCore::Node* node)
     670{
     671    CallUIDelegate(m_webView, @selector(webView:formStateDidBlurNode:), kit(const_cast<WebCore::Node*>(node)));
     672}
     673
    659674#if USE(ACCELERATED_COMPOSITING)
    660675
  • trunk/WebKit/mac/WebView/WebUIDelegatePrivate.h

    r44379 r45723  
    127127- (BOOL)webView:(WebView *)sender frame:(WebFrame *)frame requestGeolocationPermission:(WebGeolocation *)geolocation securityOrigin:(WebSecurityOrigin *)origin;
    128128
     129- (void)webView:(WebView *) formStateDidChangeForNode:(DOMNode *)node;
     130- (void)webView:(WebView *) formStateDidFocusNode:(DOMNode *)node;
     131- (void)webView:(WebView *) formStateDidBlurNode:(DOMNode *)node;
     132
    129133/*!
    130134    @method webView:printFrame:
Note: See TracChangeset for help on using the changeset viewer.