Changeset 69459 in webkit


Ignore:
Timestamp:
Oct 9, 2010 2:30:22 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-09 Varun Jain <varunjain@chromium.org>

Reviewed by Darin Fisher.

Adding one method to the WebView interface: method to inform the
renderer to scroll the currently focused element into view, for
instance, when it is hidden due to window resizing.
Also adding methods to WebNode and WebElement to expose more
features of the underlying WebCore::Node.
https://bugs.webkit.org/show_bug.cgi?id=46296

  • public/WebElement.h:
  • public/WebNode.h:
  • public/WebView.h:
  • src/WebElement.h: (WebKit::WebElement::isTextFormControlElement):
  • src/WebNode.cpp: (WebKit::WebNode::isContentEditable):
  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::scrollFocusedNodeIntoView):
  • src/WebViewImpl.h:
Location:
trunk/WebKit/chromium
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r69435 r69459  
     12010-10-09  Varun Jain  <varunjain@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Adding one method to the WebView interface: method to inform the
     6        renderer to scroll the currently focused element into view, for
     7        instance, when it is hidden due to window resizing.
     8        Also adding methods to WebNode and WebElement to expose more
     9        features of the underlying WebCore::Node.
     10        https://bugs.webkit.org/show_bug.cgi?id=46296
     11
     12        * public/WebElement.h:
     13        * public/WebNode.h:
     14        * public/WebView.h:
     15        * src/WebElement.h:
     16        (WebKit::WebElement::isTextFormControlElement):
     17        * src/WebNode.cpp:
     18        (WebKit::WebNode::isContentEditable):
     19        * src/WebViewImpl.cpp:
     20        (WebKit::WebViewImpl::scrollFocusedNodeIntoView):
     21        * src/WebViewImpl.h:
     22
    1232010-10-08  Andrei Popescu  <andreip@google.com>
    224
  • trunk/WebKit/chromium/public/WebElement.h

    r66647 r69459  
    5151
    5252        WEBKIT_API bool isFormControlElement() const;
     53        WEBKIT_API bool isTextFormControlElement() const;
    5354        WEBKIT_API WebString tagName() const;
    5455        WEBKIT_API bool hasTagName(const WebString&) const;
  • trunk/WebKit/chromium/public/WebNode.h

    r65743 r69459  
    9797    WEBKIT_API WebString createMarkup() const;
    9898    WEBKIT_API bool isTextNode() const;
     99    WEBKIT_API bool isContentEditable() const;
    99100    WEBKIT_API bool isElementNode() const;
    100101    WEBKIT_API void addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture);
  • trunk/WebKit/chromium/public/WebView.h

    r69154 r69459  
    162162    virtual void clearFocusedNode() = 0;
    163163
     164    // Scrolls the node currently in focus into view.
     165    virtual void scrollFocusedNodeIntoView() = 0;
     166
    164167
    165168    // Zoom ----------------------------------------------------------------
  • trunk/WebKit/chromium/src/WebElement.cpp

    r66647 r69459  
    4646{
    4747    return constUnwrap<Element>()->isFormControlElement();
     48}
     49
     50bool WebElement::isTextFormControlElement() const
     51{
     52    return constUnwrap<Element>()->isTextFormControl();
    4853}
    4954
  • trunk/WebKit/chromium/src/WebNode.cpp

    r65856 r69459  
    3333
    3434#include "Document.h"
     35#include "Element.h"
    3536#include "Frame.h"
    3637#include "FrameLoaderClientImpl.h"
     
    145146}
    146147
     148bool WebNode::isContentEditable() const
     149{
     150    return m_private->isContentEditable();
     151}
     152
    147153bool WebNode::isElementNode() const
    148154{
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r69162 r69459  
    15261526}
    15271527
     1528void WebViewImpl::scrollFocusedNodeIntoView()
     1529{
     1530    Node* focusedNode = focusedWebCoreNode();
     1531    if (focusedNode && focusedNode->isElementNode()) {
     1532        Element* elementNode = static_cast<Element*>(focusedNode);
     1533        elementNode->scrollIntoViewIfNeeded(true);
     1534    }
     1535}
     1536
    15281537double WebViewImpl::zoomLevel()
    15291538{
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r69053 r69459  
    133133    virtual void setInitialFocus(bool reverse);
    134134    virtual void clearFocusedNode();
     135    virtual void scrollFocusedNodeIntoView();
    135136    virtual double zoomLevel();
    136137    virtual double setZoomLevel(bool textOnly, double zoomLevel);
Note: See TracChangeset for help on using the changeset viewer.