Reviewed by Timothy.
http://bugzilla.opendarwin.org/show_bug.cgi?id=3723
Add -scrollDOMRangeToVisible:
No automated tests are possible as this code path isn't reachable from JavaScript.
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge scrollDOMRangeToVisible:]):
2006-09-26 David Smith <catfish.man@gmail.com>
Reviewed by Timothy.
http://bugzilla.opendarwin.org/show_bug.cgi?id=3723
Add -scrollDOMRangeToVisible:
* WebView/WebView.m:
(-[WebView scrollDOMRangeToVisible:]):
* WebView/WebViewPrivate.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16761
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-26 David Smith <catfish.man@gmail.com>
+
+ Reviewed by Timothy.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=3723
+ Add -scrollDOMRangeToVisible:
+
+ No automated tests are possible as this code path isn't reachable from JavaScript.
+
+ * bridge/mac/WebCoreFrameBridge.h:
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge scrollDOMRangeToVisible:]):
+
2006-10-03 Graham Dennis <graham.dennis@gmail.com>
Reviewed by Timothy.
- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText;
- (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity;
- (NSRect)firstRectForDOMRange:(DOMRange *)range;
+- (void)scrollDOMRangeToVisible:(DOMRange *)range;
- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity closeTyping:(BOOL)closeTyping;
- (DOMRange *)selectedDOMRange;
/*
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2005, 2006 Alexey Proskuryakov (ap@nypop.com)
+ * Copyright (C) 2006 David Smith (catfish.man@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
startCaretRect.height());
}
+- (void)scrollDOMRangeToVisible:(DOMRange *)range
+{
+ NSRect rangeRect = [self firstRectForDOMRange:range];
+ Node *startNode = [[range startContainer] _node];
+
+ if (startNode && startNode->renderer()) {
+ RenderLayer *layer = startNode->renderer()->enclosingLayer();
+ if (layer)
+ layer->scrollRectToVisible(enclosingIntRect(rangeRect), RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignToEdgeIfNeeded);
+ }
+}
+
- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText;
{
return m_frame->selectionImage(forceWhiteText);
+2006-09-26 David Smith <catfish.man@gmail.com>
+
+ Reviewed by Timothy.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=3723
+ Add -scrollDOMRangeToVisible:
+
+ * WebView/WebView.m:
+ (-[WebView scrollDOMRangeToVisible:]):
+ * WebView/WebViewPrivate.h:
+
2006-10-03 Graham Dennis <graham.dennis@gmail.com>
Reviewed by Timothy.
/*
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006 David Smith (catfish.man@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@implementation WebView (WebViewEditing)
+- (void)scrollDOMRangeToVisible:(DOMRange *)range
+{
+ [[[range startContainer] _bridge] scrollDOMRangeToVisible:range];
+}
+
- (DOMRange *)editableDOMRangeForPoint:(NSPoint)point
{
WebFrameBridge *bridge = [self _bridgeAtPoint:point];
- (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements;
- (BOOL)tabKeyCyclesThroughElements;
+- (void)scrollDOMRangeToVisible:(DOMRange *)range;
+
/*!
@method setScriptDebugDelegate:
@abstract Set the WebView's WebScriptDebugDelegate delegate.