Changeset 42191 in webkit


Ignore:
Timestamp:
Apr 2, 2009 5:39:18 PM (15 years ago)
Author:
adele@apple.com
Message:

WebCore:

2009-04-02 Adele Peterson <adele@apple.com>

Reviewed by Darin Adler.

Add a way to get a list of focusable nodes.

  • dom/Document.cpp: (WebCore::Document::setFocusedNode): (WebCore::Document::getFocusableNodes):
  • dom/Document.h:

WebKit:

2009-04-02 Adele Peterson <adele@apple.com>

Reviewed by Darin Adler.

  • WebKit.xcodeproj/project.pbxproj: Add WebDOMOperationsInternal.h and make WebDOMOperationsPrivate.h private.

WebKit/mac:

2009-04-02 Adele Peterson <adele@apple.com>

Reviewed by Darin Adler.

Add a way to get a list of focusable nodes.

  • DOM/WebDOMOperations.mm: (-[DOMDocument _focusableNodes]):
  • DOM/WebDOMOperationsInternal.h: Added.
  • DOM/WebDOMOperationsPrivate.h: Make this a private header. Move old methods to WebDOMOperationsInternal.h
  • WebView/WebHTMLView.mm: Use methods from WebDOMOperationsInternal.h
Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r42190 r42191  
     12009-04-02  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add a way to get a list of focusable nodes.
     6
     7        * dom/Document.cpp:
     8        (WebCore::Document::setFocusedNode):
     9        (WebCore::Document::getFocusableNodes):
     10        * dom/Document.h:
     11
    1122009-04-02  Darin Adler  <darin@apple.com>
    213
  • trunk/WebCore/dom/Document.cpp

    r42107 r42191  
    25612561    updateRendering();
    25622562    return !focusChangeBlocked;
    2563   }
     2563}
     2564   
     2565void Document::getFocusableNodes(Vector<RefPtr<Node> >& nodes)
     2566{
     2567    updateLayout();
     2568
     2569    for (Node* node = firstChild(); node; node = node->traverseNextNode()) {
     2570        if (node->isFocusable())
     2571            nodes.append(node);
     2572    }
     2573}
    25642574 
    25652575void Document::setCSSTarget(Element* n)
  • trunk/WebCore/dom/Document.h

    r42129 r42191  
    510510    Node* focusedNode() const { return m_focusedNode.get(); }
    511511
     512    void getFocusableNodes(Vector<RefPtr<Node> >&);
     513   
    512514    // The m_ignoreAutofocus flag specifies whether or not the document has been changed by the user enough
    513515    // for WebCore to ignore the autofocus attribute on any form controls
  • trunk/WebKit/ChangeLog

    r42152 r42191  
     12009-04-02  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        * WebKit.xcodeproj/project.pbxproj:
     6        Add WebDOMOperationsInternal.h and make WebDOMOperationsPrivate.h private.
     7
    182009-04-01  Greg Bolsinga  <bolsinga@apple.com>
    29
  • trunk/WebKit/WebKit.xcodeproj/project.pbxproj

    r42152 r42191  
    209209                9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 930D02BB06275F640076701E /* WebViewInternal.h */; };
    210210                9398109C0824BF01008DF038 /* WebFrameInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 930D02BD06275F710076701E /* WebFrameInternal.h */; };
    211                 9398109D0824BF01008DF038 /* WebDOMOperationsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */; };
     211                9398109D0824BF01008DF038 /* WebDOMOperationsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    212212                9398109E0824BF01008DF038 /* WebEditingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
    213213                939810A00824BF01008DF038 /* WebJavaPlugIn.h in Headers */ = {isa = PBXBuildFile; fileRef = 51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */; settings = {ATTRIBUTES = (Public, ); }; };
     
    303303                A7D3C5BC0B5773C5002CA450 /* WebPasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */; };
    304304                A7D3C5BD0B5773C5002CA450 /* WebPasteboardHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */; };
     305                AB9FBBBB0F8582B0006ADC43 /* WebDOMOperationsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = AB9FBBBA0F8582B0006ADC43 /* WebDOMOperationsInternal.h */; };
    305306                ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */; };
    306307                C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0167BF60D7F5DD00028696E /* WebScriptDebugger.h */; };
     
    548549                A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardHelper.h; sourceTree = "<group>"; };
    549550                A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPasteboardHelper.mm; sourceTree = "<group>"; };
     551                AB9FBBBA0F8582B0006ADC43 /* WebDOMOperationsInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDOMOperationsInternal.h; sourceTree = "<group>"; };
    550552                ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownloadInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
    551553                BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebEditingDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
     
    10871089                                846171F90624AE5B0071A4A3 /* WebDOMOperations.h */,
    10881090                                846171FA0624AE5B0071A4A3 /* WebDOMOperations.mm */,
     1091                                AB9FBBBA0F8582B0006ADC43 /* WebDOMOperationsInternal.h */,
    10891092                                84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */,
    10901093                        );
     
    14011404                                FEF52DFC0F6748F200FF70EE /* WebGeolocationPrivate.h in Headers */,
    14021405                                1C0456480F7D416F00BA7AA3 /* DOMDocumentPrivate.h in Headers */,
     1406                                AB9FBBBB0F8582B0006ADC43 /* WebDOMOperationsInternal.h in Headers */,
    14031407                        );
    14041408                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKit/mac/ChangeLog

    r42158 r42191  
     12009-04-02  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add a way to get a list of focusable nodes.
     6
     7        * DOM/WebDOMOperations.mm:
     8        (-[DOMDocument _focusableNodes]):
     9        * DOM/WebDOMOperationsInternal.h: Added.
     10        * DOM/WebDOMOperationsPrivate.h: Make this a private header.
     11        Move old methods to WebDOMOperationsInternal.h
     12        * WebView/WebHTMLView.mm: Use methods from WebDOMOperationsInternal.h
     13
    1142009-04-01  Darin Adler  <darin@apple.com>
    215
  • trunk/WebKit/mac/DOM/WebDOMOperations.mm

    r39065 r42191  
    6464@end
    6565
    66 @implementation DOMNode (WebDOMNodeOperationsPrivate)
     66/* This doesn't appear to be used by anyone.  We should consider removing this. */
     67@implementation DOMNode (WebDOMNodeOperationsInternal)
    6768
    6869- (NSArray *)_subresourceURLs
     
    102103@end
    103104
    104 @implementation DOMDocument (WebDOMDocumentOperationsPrivate)
     105@implementation DOMDocument (WebDOMDocumentOperationsInternal)
    105106
     107/* This doesn't appear to be used by anyone.  We should consider removing this. */
    106108- (DOMRange *)_createRangeWithNode:(DOMNode *)node
    107109{
     
    114116{
    115117    return [self _createRangeWithNode:[self documentElement]];
     118}
     119
     120@end
     121
     122@implementation DOMDocument (WebDOMDocumentOperationsPrivate)
     123
     124- (NSArray *)_focusableNodes
     125{
     126    Vector<RefPtr<Node> > nodes;
     127    core(self)->getFocusableNodes(nodes);
     128    NSMutableArray *array = [NSMutableArray arrayWithCapacity:nodes.size()];
     129    for (unsigned i = 0; i < nodes.size(); ++i)
     130        [array addObject:[DOMNode _wrapNode:nodes[i].get()]];
     131    return array;
    116132}
    117133
  • trunk/WebKit/mac/DOM/WebDOMOperationsPrivate.h

    r31357 r42191  
    11/*
    2  * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2005, 2008, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929#import <WebKit/WebDOMOperations.h>
    3030
    31 @interface DOMNode (WebDOMNodeOperationsPrivate)
    32 - (NSArray *)_subresourceURLs;
     31@interface DOMDocument (WebDOMDocumentOperationsPrivate)
     32- (NSArray *)_focusableNodes;
    3333@end
    34 
    35 @interface DOMDocument (WebDOMDocumentOperationsPrivate)
    36 - (DOMRange *)_createRangeWithNode:(DOMNode *)node;
    37 - (DOMRange *)_documentRange;
    38 @end
  • trunk/WebKit/mac/WebView/WebHTMLView.mm

    r42140 r42191  
    3434#import "WebArchive.h"
    3535#import "WebClipView.h"
    36 #import "WebDOMOperationsPrivate.h"
     36#import "WebDOMOperationsInternal.h"
    3737#import "WebDataSourceInternal.h"
    3838#import "WebDefaultUIDelegate.h"
Note: See TracChangeset for help on using the changeset viewer.