Commit 0a17c026 authored by bdash's avatar bdash

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-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: http://svn.webkit.org/repository/webkit/trunk@16761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fb3f9561
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> 2006-10-03 Graham Dennis <graham.dennis@gmail.com>
Reviewed by Timothy. Reviewed by Timothy.
...@@ -358,6 +358,7 @@ typedef enum { ...@@ -358,6 +358,7 @@ typedef enum {
- (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText; - (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText;
- (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity; - (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity;
- (NSRect)firstRectForDOMRange:(DOMRange *)range; - (NSRect)firstRectForDOMRange:(DOMRange *)range;
- (void)scrollDOMRangeToVisible:(DOMRange *)range;
- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity closeTyping:(BOOL)closeTyping; - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity closeTyping:(BOOL)closeTyping;
- (DOMRange *)selectedDOMRange; - (DOMRange *)selectedDOMRange;
......
/* /*
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2005, 2006 Alexey Proskuryakov (ap@nypop.com) * 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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -1429,6 +1430,18 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element) ...@@ -1429,6 +1430,18 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
startCaretRect.height()); 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; - (NSImage *)selectionImageForcingWhiteText:(BOOL)forceWhiteText;
{ {
return m_frame->selectionImage(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> 2006-10-03 Graham Dennis <graham.dennis@gmail.com>
Reviewed by Timothy. Reviewed by Timothy.
......
/* /*
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. * 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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -3063,6 +3064,11 @@ - (DOMCSSStyleDeclaration *)computedStyleForElement:(DOMElement *)element pseudo ...@@ -3063,6 +3064,11 @@ - (DOMCSSStyleDeclaration *)computedStyleForElement:(DOMElement *)element pseudo
@implementation WebView (WebViewEditing) @implementation WebView (WebViewEditing)
- (void)scrollDOMRangeToVisible:(DOMRange *)range
{
[[[range startContainer] _bridge] scrollDOMRangeToVisible:range];
}
- (DOMRange *)editableDOMRangeForPoint:(NSPoint)point - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point
{ {
WebFrameBridge *bridge = [self _bridgeAtPoint:point]; WebFrameBridge *bridge = [self _bridgeAtPoint:point];
......
...@@ -78,6 +78,8 @@ typedef enum { ...@@ -78,6 +78,8 @@ typedef enum {
- (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements; - (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements;
- (BOOL)tabKeyCyclesThroughElements; - (BOOL)tabKeyCyclesThroughElements;
- (void)scrollDOMRangeToVisible:(DOMRange *)range;
/*! /*!
@method setScriptDebugDelegate: @method setScriptDebugDelegate:
@abstract Set the WebView's WebScriptDebugDelegate delegate. @abstract Set the WebView's WebScriptDebugDelegate delegate.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment