Changeset 95890 in webkit
- Timestamp:
- Sep 23, 2011 5:23:55 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r95849 r95890 1 2011-09-23 Varun Jain <varunjain@google.com> 2 3 Refactor WebViewImpl::scrollFocusedNodeIntoRect to a better place and add tests 4 https://bugs.webkit.org/show_bug.cgi?id=68198 5 6 Reviewed by Dimitri Glazkov. 7 8 * Source/autotools/symbols.filter: 9 1 10 2011-09-23 Mark Hahnenberg <mhahnenberg@apple.com> 2 11 -
trunk/LayoutTests/ChangeLog
r95888 r95890 1 2011-09-23 Varun Jain <varunjain@google.com> 2 3 Refactor WebViewImpl::scrollFocusedNodeIntoRect to a better place and add tests 4 https://bugs.webkit.org/show_bug.cgi?id=68198 5 6 Reviewed by Dimitri Glazkov. 7 8 * fast/dom/scroll-element-to-rect-centered-expected.txt: Added. 9 * fast/dom/scroll-element-to-rect-centered.html: Added. 10 * fast/dom/scroll-element-to-rect-expected.txt: Added. 11 * fast/dom/scroll-element-to-rect.html: Added. 12 1 13 2011-09-23 Dean Jackson <dino@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r95889 r95890 1 2011-09-23 Varun Jain <varunjain@google.com> 2 3 Refactor WebViewImpl::scrollFocusedNodeIntoRect to a better place and add tests 4 https://bugs.webkit.org/show_bug.cgi?id=68198 5 6 Reviewed by Dimitri Glazkov. 7 8 Tests: fast/dom/scroll-element-to-rect-centered.html 9 fast/dom/scroll-element-to-rect.html 10 11 * WebCore.exp.in: 12 * page/FrameView.cpp: 13 (WebCore::FrameView::scrollElementToRect): 14 * page/FrameView.h: 15 * testing/Internals.cpp: 16 (WebCore::Internals::scrollElementToRect): 17 * testing/Internals.h: 18 * testing/Internals.idl: 19 1 20 2011-09-23 Mihai Parparita <mihaip@chromium.org> 2 21 -
trunk/Source/WebCore/WebCore.exp.in
r95849 r95890 986 986 __ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE 987 987 __ZN7WebCore9FrameView17paintControlTintsEv 988 __ZN7WebCore9FrameView19scrollElementToRectEPNS_7ElementERKNS_7IntRectE 988 989 __ZN7WebCore9HTMLNames10listingTagE 989 990 __ZN7WebCore9HTMLNames11textareaTagE -
trunk/Source/WebCore/page/FrameView.cpp
r95738 r95890 1623 1623 } 1624 1624 1625 void FrameView::scrollElementToRect(Element* element, const IntRect& rect) 1626 { 1627 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 1628 1629 LayoutRect bounds = element->boundsInWindowSpace(); 1630 int centeringOffsetX = (rect.width() - bounds.width()) / 2; 1631 int centeringOffsetY = (rect.height() - bounds.height()) / 2; 1632 scrollBy(IntSize(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y())); 1633 } 1634 1625 1635 void FrameView::setScrollPosition(const LayoutPoint& scrollPoint) 1626 1636 { -
trunk/Source/WebCore/page/FrameView.h
r95738 r95890 37 37 38 38 class Color; 39 class Element; 39 40 class Event; 40 41 class FloatSize; … … 261 262 bool scrollToAnchor(const String&); 262 263 void maintainScrollPositionAtAnchor(Node*); 264 void scrollElementToRect(Element*, const IntRect&); 263 265 264 266 // Methods to convert points and rects between the coordinate space of the renderer, and this view. -
trunk/Source/WebCore/testing/Internals.cpp
r95685 r95890 38 38 #include "HTMLTextAreaElement.h" 39 39 #include "InspectorController.h" 40 #include "IntRect.h" 40 41 #include "MemoryCache.h" 41 42 #include "NodeRenderingContext.h" … … 377 378 } 378 379 379 } 380 void Internals::scrollElementToRect(Element* element, long x, long y, long w, long h, ExceptionCode& ec) 381 { 382 if (!element || !element->document() || !element->document()->view()) { 383 ec = INVALID_ACCESS_ERR; 384 return; 385 } 386 FrameView* frameView = element->document()->view(); 387 frameView->scrollElementToRect(element, IntRect(x, y, w, h)); 388 } 389 390 } -
trunk/Source/WebCore/testing/Internals.h
r95685 r95890 88 88 String suggestedValue(Element* inputElement, ExceptionCode&); 89 89 void setSuggestedValue(Element* inputElement, const String&, ExceptionCode&); 90 void scrollElementToRect(Element*, long x, long y, long w, long h, ExceptionCode&); 90 91 91 92 static const char* internalsId; -
trunk/Source/WebCore/testing/Internals.idl
r95685 r95890 64 64 65 65 void paintControlTints(in Document document) raises (DOMException); 66 67 void scrollElementToRect(in Element element, in long x, in long y, in long w, in long h) raises (DOMException); 66 68 }; 67 69 } -
trunk/Source/WebKit/chromium/ChangeLog
r95889 r95890 1 2011-09-23 Varun Jain <varunjain@google.com> 2 3 Refactor WebViewImpl::scrollFocusedNodeIntoRect to a better place and add tests 4 https://bugs.webkit.org/show_bug.cgi?id=68198 5 6 Reviewed by Dimitri Glazkov. 7 8 * public/WebView.h: 9 (WebKit::WebView::scrollFocusedNodeIntoRect): 10 * src/WebViewImpl.cpp: 11 (WebKit::WebViewImpl::scrollFocusedNodeIntoRect): 12 1 13 2011-09-23 Mihai Parparita <mihaip@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/public/WebView.h
r95252 r95890 176 176 177 177 // Scrolls the node currently in focus into |rect|, where |rect| is in 178 // screenspace.179 virtual void scrollFocusedNodeIntoRect(const WebRect& rect) { }178 // window space. 179 virtual void scrollFocusedNodeIntoRect(const WebRect&) { } 180 180 181 181 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r95861 r95890 1821 1821 void WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rect) 1822 1822 { 1823 Frame* frame = page()->mainFrame(); 1823 1824 Node* focusedNode = focusedWebCoreNode(); 1824 if (!f ocusedNode || !focusedNode->isElementNode())1825 if (!frame || !frame->view() || !focusedNode || !focusedNode->isElementNode()) 1825 1826 return; 1826 1827 Element* elementNode = static_cast<Element*>(focusedNode); 1827 LayoutRect bounds = elementNode->boundsInWindowSpace(); 1828 int centeringOffsetX = (rect.width - bounds.width()) / 2; 1829 int centeringOffsetY = (rect.height - bounds.height()) / 2; 1830 IntSize scrollOffset(bounds.x() - centeringOffsetX, bounds.y() - centeringOffsetY); 1831 Frame* frame = mainFrameImpl()->frame(); 1832 if (frame && frame->view()) 1833 frame->view()->scrollBy(scrollOffset); 1828 frame->view()->scrollElementToRect(elementNode, IntRect(rect.x, rect.y, rect.width, rect.height)); 1834 1829 } 1835 1830 -
trunk/Source/WebKit2/ChangeLog
r95878 r95890 1 2011-09-23 Varun Jain <varunjain@google.com> 2 3 Refactor WebViewImpl::scrollFocusedNodeIntoRect to a better place and add tests 4 https://bugs.webkit.org/show_bug.cgi?id=68198 5 6 Reviewed by Dimitri Glazkov. 7 8 * win/WebKit2.def: 9 * win/WebKit2CFLite.def: 10 1 11 2011-09-23 Chang Shu <cshu@webkit.org> 2 12 -
trunk/Source/WebKit2/win/WebKit2.def
r95685 r95890 163 163 ?page@Document@WebCore@@QBEPAVPage@2@XZ 164 164 ?paintControlTints@FrameView@WebCore@@AAEXXZ 165 ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z 165 166 ?removeShadowRoot@Element@WebCore@@QAEXXZ 166 167 ?setDisabled@MemoryCache@WebCore@@QAEX_N@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r95685 r95890 157 157 ?page@Document@WebCore@@QBEPAVPage@2@XZ 158 158 ?paintControlTints@FrameView@WebCore@@AAEXXZ 159 ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z 159 160 ?removeShadowRoot@Element@WebCore@@QAEXXZ 160 161 ?setDisabled@MemoryCache@WebCore@@QAEX_N@Z -
trunk/Source/autotools/symbols.filter
r95849 r95890 78 78 _ZN7WebCore10ScrollView23setScrollbarsSuppressedEbb; 79 79 _ZN7WebCore9FrameView17paintControlTintsEv; 80 _ZN7WebCore9FrameView19scrollElementToRectEPNS_7ElementERKNS_7IntRectE; 80 81 local: 81 82 _Z*;
Note: See TracChangeset
for help on using the changeset viewer.