Changeset 149262 in webkit


Ignore:
Timestamp:
Apr 28, 2013 3:21:55 PM (11 years ago)
Author:
rniwa@webkit.org
Message:

StaticHashSetNodeList is unnecessary
https://bugs.webkit.org/show_bug.cgi?id=115219

Reviewed by Antonio Gomes.

Source/WebCore:

Moved Document::nodesFromRect into Internals::nodesFromRect per
https://chromium.googlesource.com/chromium/blink/+/78207c5c34383fbb807bb9347deb67168f09bb04.

Also made TouchAdjustment functions use HashListSet directly instead of wrapping it inside
a StaticHashSetNodeList since there was no need to use the latter.

With these two changes, I deleted StaticHashSetNodeList.

  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.exp.in:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Document.cpp:

(WebCore):

  • dom/Document.h:

(Document):

  • dom/StaticHashSetNodeList.cpp: Removed.
  • dom/StaticHashSetNodeList.h: Removed.
  • page/EventHandler.cpp:

(WebCore::EventHandler::bestClickableNodeForTouchPoint):
(WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
(WebCore::EventHandler::bestZoomableAreaForTouchPoint):

  • page/TouchAdjustment.cpp:

(WebCore::TouchAdjustment::compileSubtargetList):
(WebCore::TouchAdjustment::compileZoomableSubtargets):
(WebCore::findBestClickableCandidate):
(WebCore::findBestContextMenuCandidate):
(WebCore::findBestZoomableArea):

  • page/TouchAdjustment.h:

(WebCore):

  • testing/Internals.cpp:

(WebCore::Internals::nodesFromRect):

Source/WebKit:

  • WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Source/WebKit/win:

  • WebKit.vcproj/WebKitExports.def.in:
Location:
trunk/Source
Files:
2 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r148921 r149262  
    12331233    dom/ShadowRoot.cpp
    12341234    dom/SpaceSplitString.cpp
    1235     dom/StaticHashSetNodeList.cpp
    12361235    dom/StaticNodeList.cpp
    12371236    dom/StringCallback.cpp
  • trunk/Source/WebCore/ChangeLog

    r149261 r149262  
     12013-04-25  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        StaticHashSetNodeList is unnecessary
     4        https://bugs.webkit.org/show_bug.cgi?id=115219
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Moved Document::nodesFromRect into Internals::nodesFromRect per
     9        https://chromium.googlesource.com/chromium/blink/+/78207c5c34383fbb807bb9347deb67168f09bb04.
     10
     11        Also made TouchAdjustment functions use HashListSet directly instead of wrapping it inside
     12        a StaticHashSetNodeList since there was no need to use the latter.
     13
     14        With these two changes, I deleted StaticHashSetNodeList.
     15
     16        * GNUmakefile.list.am:
     17        * Target.pri:
     18        * WebCore.exp.in:
     19        * WebCore.xcodeproj/project.pbxproj:
     20        * dom/Document.cpp:
     21        (WebCore):
     22        * dom/Document.h:
     23        (Document):
     24        * dom/StaticHashSetNodeList.cpp: Removed.
     25        * dom/StaticHashSetNodeList.h: Removed.
     26        * page/EventHandler.cpp:
     27        (WebCore::EventHandler::bestClickableNodeForTouchPoint):
     28        (WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
     29        (WebCore::EventHandler::bestZoomableAreaForTouchPoint):
     30        * page/TouchAdjustment.cpp:
     31        (WebCore::TouchAdjustment::compileSubtargetList):
     32        (WebCore::TouchAdjustment::compileZoomableSubtargets):
     33        (WebCore::findBestClickableCandidate):
     34        (WebCore::findBestContextMenuCandidate):
     35        (WebCore::findBestZoomableArea):
     36        * page/TouchAdjustment.h:
     37        (WebCore):
     38        * testing/Internals.cpp:
     39        (WebCore::Internals::nodesFromRect):
     40
    1412013-04-28  Dean Jackson  <dino@apple.com>
    242
  • trunk/Source/WebCore/GNUmakefile.list.am

    r149129 r149262  
    30743074        Source/WebCore/dom/SpaceSplitString.cpp \
    30753075        Source/WebCore/dom/SpaceSplitString.h \
    3076         Source/WebCore/dom/StaticHashSetNodeList.cpp \
    3077         Source/WebCore/dom/StaticHashSetNodeList.h \
    30783076        Source/WebCore/dom/StaticNodeList.cpp \
    30793077        Source/WebCore/dom/StaticNodeList.h \
  • trunk/Source/WebCore/Target.pri

    r149007 r149262  
    455455    dom/NodeTraversal.cpp \
    456456    dom/Notation.cpp \
    457     dom/StaticHashSetNodeList.cpp \
    458457    dom/OverflowEvent.cpp \
    459458    dom/PageTransitionEvent.cpp \
     
    16841683    dom/NodeTraversal.h \
    16851684    dom/Notation.h \
    1686     dom/StaticHashSetNodeList.h \
    16871685    dom/OverflowEvent.h \
    16881686    dom/PageTransitionEvent.h \
  • trunk/Source/WebCore/WebCore.exp.in

    r149209 r149262  
    258258__ZN7WebCore13HitTestResultC1ERKS0_
    259259__ZN7WebCore13HitTestResultC1ERKNS_11LayoutPointE
     260__ZN7WebCore13HitTestResultC1ERKNS_11LayoutPointEjjjj
    260261__ZN7WebCore13HitTestResultD1Ev
    261262__ZN7WebCore13IdentifierRep3getEPKc
     
    465466__ZN7WebCore15GraphicsContext9translateEff
    466467__ZN7WebCore15GraphicsContextD1Ev
     468__ZN7WebCore15HitTestLocation12rectForPointERKNS_11LayoutPointEjjjj
    467469__ZN7WebCore15JSDOMWindowBase8commonVMEv
    468470__ZN7WebCore15PlatformCALayer18setGeometryFlippedEb
     
    13151317__ZNK7WebCore13HitTestResult17isContentEditableEv
    13161318__ZNK7WebCore13HitTestResult18titleDisplayStringEv
     1319__ZNK7WebCore13HitTestResult19rectBasedTestResultEv
    13171320__ZNK7WebCore13HitTestResult5imageEv
    13181321__ZNK7WebCore13HitTestResult5titleERNS_13TextDirectionE
     
    14771480__ZNK7WebCore4Node14isDescendantOfEPKS0_
    14781481__ZNK7WebCore4Node18getSubresourceURLsERN3WTF11ListHashSetINS_4KURLELm256ENS_8KURLHashEEE
     1482__ZNK7WebCore4Node28deprecatedShadowAncestorNodeEv
    14791483__ZNK7WebCore4Node31numberOfScopedHTMLStyleChildrenEv
    14801484__ZNK7WebCore4Node9nodeIndexEv
     
    15541558__ZNK7WebCore8Document11completeURLERKN3WTF6StringE
    15551559__ZNK7WebCore8Document13axObjectCacheEv
    1556 __ZNK7WebCore8Document13nodesFromRectEiijjjjj
    15571560__ZNK7WebCore8Document14getElementByIdERKN3WTF12AtomicStringE
    15581561__ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE
     
    16031606__ZTVN7WebCore12ChromeClientE
    16041607__ZTVN7WebCore14LoaderStrategyE
     1608__ZTVN7WebCore14StaticNodeListE
    16051609__ZTVN7WebCore15StorageStrategyE
    16061610__ZTVN7WebCore16DatabaseStrategyE
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r149155 r149262  
    52745274                CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
    52755275                CE7B2DB61586ABAD0098B3FA /* TextAlternativeWithRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */; };
    5276                 CEA3949C11D45CDA003094CF /* StaticHashSetNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3949A11D45CDA003094CF /* StaticHashSetNodeList.cpp */; };
    5277                 CEA3949D11D45CDA003094CF /* StaticHashSetNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = CEA3949B11D45CDA003094CF /* StaticHashSetNodeList.h */; };
    52785276                CECADFC6153778FF00E37068 /* DictationAlternative.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CECADFC2153778FF00E37068 /* DictationAlternative.cpp */; };
    52795277                CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */ = {isa = PBXBuildFile; fileRef = CECADFC3153778FF00E37068 /* DictationAlternative.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1206312061                CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextAlternativeWithRange.h; path = mac/TextAlternativeWithRange.h; sourceTree = "<group>"; };
    1206412062                CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TextAlternativeWithRange.mm; path = mac/TextAlternativeWithRange.mm; sourceTree = "<group>"; };
    12065                 CEA3949A11D45CDA003094CF /* StaticHashSetNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaticHashSetNodeList.cpp; sourceTree = "<group>"; };
    12066                 CEA3949B11D45CDA003094CF /* StaticHashSetNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticHashSetNodeList.h; sourceTree = "<group>"; };
    1206712063                CECADFC2153778FF00E37068 /* DictationAlternative.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationAlternative.cpp; sourceTree = "<group>"; };
    1206812064                CECADFC3153778FF00E37068 /* DictationAlternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictationAlternative.h; sourceTree = "<group>"; };
     
    2056120557                                D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */,
    2056220558                                D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */,
    20563                                 CEA3949A11D45CDA003094CF /* StaticHashSetNodeList.cpp */,
    20564                                 CEA3949B11D45CDA003094CF /* StaticHashSetNodeList.h */,
    2056520559                                BC7FA62C0D1F0EFF00DB22A9 /* StaticNodeList.cpp */,
    2056620560                                BC7FA62B0D1F0EFF00DB22A9 /* StaticNodeList.h */,
     
    2350823502                                1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */,
    2350923503                                93F1996308245E59001E9ABC /* SSLKeyGenerator.h in Headers */,
    23510                                 CEA3949D11D45CDA003094CF /* StaticHashSetNodeList.h in Headers */,
    2351123504                                BC7FA62D0D1F0EFF00DB22A9 /* StaticNodeList.h in Headers */,
    2351223505                                A5AFB350115151A700B045CB /* StepRange.h in Headers */,
     
    2657526568                                1A2E6E590CC55213004A2062 /* SQLValue.cpp in Sources */,
    2657626569                                93F19AE608245E59001E9ABC /* SSLKeyGeneratorMac.cpp in Sources */,
    26577                                 CEA3949C11D45CDA003094CF /* StaticHashSetNodeList.cpp in Sources */,
    2657826570                                BC7FA62E0D1F0EFF00DB22A9 /* StaticNodeList.cpp in Sources */,
    2657926571                                A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */,
  • trunk/Source/WebCore/dom/DOMAllInOne.cpp

    r143422 r149262  
    131131#include "ShadowRoot.cpp"
    132132#include "SpaceSplitString.cpp"
    133 #include "StaticHashSetNodeList.cpp"
    134133#include "StaticNodeList.cpp"
    135134#include "StyleElement.cpp"
  • trunk/Source/WebCore/dom/Document.cpp

    r149185 r149262  
    157157#include "Settings.h"
    158158#include "ShadowRoot.h"
    159 #include "StaticHashSetNodeList.h"
    160159#include "StylePropertySet.h"
    161160#include "StyleResolver.h"
     
    14061405        return documentLoader->responseMIMEType();
    14071406    return String();
    1408 }
    1409 
    1410 // FIXME: We need to discuss the DOM API here at some point. Ideas:
    1411 // * making it receive a rect as parameter, i.e. nodesFromRect(x, y, w, h);
    1412 // * making it receive the expading size of each direction separately,
    1413 //   i.e. nodesFromRect(x, y, topSize, rightSize, bottomSize, leftSize);
    1414 PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, HitTestRequest::HitTestRequestType hitType) const
    1415 {
    1416     // FIXME: Share code between this, elementFromPoint and caretRangeFromPoint.
    1417     if (!renderer())
    1418         return 0;
    1419     Frame* frame = this->frame();
    1420     if (!frame)
    1421         return 0;
    1422     FrameView* frameView = frame->view();
    1423     if (!frameView)
    1424         return 0;
    1425 
    1426     float zoomFactor = frame->pageZoomFactor();
    1427     LayoutPoint point = roundedLayoutPoint(FloatPoint(centerX * zoomFactor + view()->scrollX(), centerY * zoomFactor + view()->scrollY()));
    1428 
    1429     HitTestRequest request(hitType);
    1430 
    1431     // When ignoreClipping is false, this method returns null for coordinates outside of the viewport.
    1432     if (!request.ignoreClipping() && !frameView->visibleContentRect().intersects(HitTestLocation::rectForPoint(point, topPadding, rightPadding, bottomPadding, leftPadding)))
    1433         return 0;
    1434 
    1435     // Passing a zero padding will trigger a rect hit test, however for the purposes of nodesFromRect,
    1436     // we special handle this case in order to return a valid NodeList.
    1437     if (!topPadding && !rightPadding && !bottomPadding && !leftPadding) {
    1438         HitTestResult result(point);
    1439         return handleZeroPadding(request, result);
    1440     }
    1441 
    1442     HitTestResult result(point, topPadding, rightPadding, bottomPadding, leftPadding);
    1443     renderView()->hitTest(request, result);
    1444 
    1445     return StaticHashSetNodeList::adopt(result.rectBasedTestResult());
    1446 }
    1447 
    1448 PassRefPtr<NodeList> Document::handleZeroPadding(const HitTestRequest& request, HitTestResult& result) const
    1449 {
    1450     renderView()->hitTest(request, result);
    1451 
    1452     Node* node = result.innerNode();
    1453     if (!node)
    1454         return 0;
    1455 
    1456     node = node->deprecatedShadowAncestorNode();
    1457     ListHashSet<RefPtr<Node> > list;
    1458     list.add(node);
    1459     return StaticHashSetNodeList::adopt(list);
    14601407}
    14611408
  • trunk/Source/WebCore/dom/Document.h

    r149185 r149262  
    362362    bool cssGridLayoutEnabled() const;
    363363
    364     /**
    365      * Retrieve all nodes that intersect a rect in the window's document, until it is fully enclosed by
    366      * the boundaries of a node.
    367      *
    368      * @param centerX x reference for the rectangle in CSS pixels
    369      * @param centerY y reference for the rectangle in CSS pixels
    370      * @param topPadding How much to expand the top of the rectangle
    371      * @param rightPadding How much to expand the right of the rectangle
    372      * @param bottomPadding How much to expand the bottom of the rectangle
    373      * @param leftPadding How much to expand the left of the rectangle
    374      */
    375     PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY,
    376         unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding,
    377         HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent) const;
    378364    Element* elementFromPoint(int x, int y) const;
    379365    PassRefPtr<Range> caretRangeFromPoint(int x, int y);
     
    12671253    void seamlessParentUpdatedStylesheets();
    12681254
    1269     PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult&) const;
    1270 
    12711255    void loadEventDelayTimerFired(Timer<Document>*);
    12721256
  • trunk/Source/WebCore/page/EventHandler.cpp

    r149254 r149262  
    8080#include "ShadowRoot.h"
    8181#include "SpatialNavigation.h"
    82 #include "StaticHashSetNodeList.h"
    8382#include "StyleCachedImage.h"
    8483#include "TextEvent.h"
     
    28362835
    28372836    IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
    2838     RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
    28392837
    28402838    // FIXME: Should be able to handle targetNode being a shadow DOM node to avoid performing uncessary hit tests
     
    28422840    // regression in touchadjustment/html-label.html. Some refinement is required to testing/internals to
    28432841    // handle targetNode being a shadow DOM node.
    2844     bool success = findBestClickableCandidate(targetNode, targetPoint, touchCenter, touchRect, *nodeList.get());
     2842    bool success = findBestClickableCandidate(targetNode, targetPoint, touchCenter, touchRect, result.rectBasedTestResult());
    28452843    if (success && targetNode)
    28462844        targetNode = targetNode->deprecatedShadowAncestorNode();
     
    28542852
    28552853    IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
    2856     RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
    2857     return findBestContextMenuCandidate(targetNode, targetPoint, touchCenter, touchRect, *nodeList.get());
     2854    return findBestContextMenuCandidate(targetNode, targetPoint, touchCenter, touchRect, result.rectBasedTestResult());
    28582855}
    28592856
     
    28642861
    28652862    IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
    2866     RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
    2867     return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect, *nodeList.get());
     2863    return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect, result.rectBasedTestResult());
    28682864}
    28692865
  • trunk/Source/WebCore/page/TouchAdjustment.cpp

    r148545 r149262  
    234234
    235235// Compiles a list of subtargets of all the relevant target nodes.
    236 void compileSubtargetList(const NodeList& intersectedNodes, SubtargetGeometryList& subtargets, NodeFilter nodeFilter, AppendSubtargetsForNode appendSubtargetsForNode)
     236void compileSubtargetList(const NodeListHashSet& intersectedNodes, SubtargetGeometryList& subtargets, NodeFilter nodeFilter, AppendSubtargetsForNode appendSubtargetsForNode)
    237237{
    238238    // Find candidates responding to tap gesture events in O(n) time.
     
    245245    // responder or have an ancestor that is a responder.
    246246    // This iteration tests all ancestors at most once by caching earlier results.
    247     unsigned length = intersectedNodes.length();
    248     for (unsigned i = 0; i < length; ++i) {
    249         Node* const node = intersectedNodes.item(i);
     247    NodeListHashSet::const_iterator end = intersectedNodes.end();
     248    for (NodeListHashSet::const_iterator it = intersectedNodes.begin(); it != end; ++it) {
     249        Node* const node = it->get();
    250250        Vector<Node*> visitedNodes;
    251251        Node* respondingNode = 0;
     
    278278    // We compile the list of component absolute quads instead of using the bounding rect
    279279    // to be able to perform better hit-testing on inline links on line-breaks.
    280     length = candidates.size();
     280    unsigned length = candidates.size();
    281281    for (unsigned i = 0; i < length; i++) {
    282282        Node* candidate = candidates[i];
     
    311311
    312312// Compiles a list of zoomable subtargets.
    313 void compileZoomableSubtargets(const NodeList& intersectedNodes, SubtargetGeometryList& subtargets)
    314 {
    315     unsigned length = intersectedNodes.length();
    316     for (unsigned i = 0; i < length; ++i) {
    317         Node* const candidate = intersectedNodes.item(i);
     313void compileZoomableSubtargets(const NodeListHashSet& intersectedNodes, SubtargetGeometryList& subtargets)
     314{
     315    NodeListHashSet::const_iterator end = intersectedNodes.end();
     316    for (NodeListHashSet::const_iterator it = intersectedNodes.begin(); it != end; ++it) {
     317        Node* const candidate = it->get();
    318318        if (nodeIsZoomTarget(candidate))
    319319            appendZoomableSubtargets(candidate, subtargets);
     
    477477} // namespace TouchAdjustment
    478478
    479 bool findBestClickableCandidate(Node*& targetNode, IntPoint &targetPoint, const IntPoint &touchHotspot, const IntRect &touchArea, const NodeList& nodeList)
     479bool findBestClickableCandidate(Node*& targetNode, IntPoint &targetPoint, const IntPoint &touchHotspot, const IntRect &touchArea, const NodeListHashSet& nodeList)
    480480{
    481481    IntRect targetArea;
     
    485485}
    486486
    487 bool findBestContextMenuCandidate(Node*& targetNode, IntPoint &targetPoint, const IntPoint &touchHotspot, const IntRect &touchArea, const NodeList& nodeList)
     487bool findBestContextMenuCandidate(Node*& targetNode, IntPoint &targetPoint, const IntPoint &touchHotspot, const IntRect &touchArea, const NodeListHashSet& nodeList)
    488488{
    489489    IntRect targetArea;
     
    493493}
    494494
    495 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeList& nodeList)
     495bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeListHashSet& nodeList)
    496496{
    497497    IntPoint targetPoint;
  • trunk/Source/WebCore/page/TouchAdjustment.h

    r125898 r149262  
    2929namespace WebCore {
    3030
    31 bool findBestClickableCandidate(Node*& targetNode, IntPoint& targetPoint, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeList&);
    32 bool findBestContextMenuCandidate(Node*& targetNode, IntPoint& targetPoint, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeList&);
    33 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeList&);
     31typedef ListHashSet<RefPtr<Node> > NodeListHashSet;
     32
     33bool findBestClickableCandidate(Node*& targetNode, IntPoint& targetPoint, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeListHashSet&);
     34bool findBestContextMenuCandidate(Node*& targetNode, IntPoint& targetPoint, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeListHashSet&);
     35bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeListHashSet&);
    3436// FIXME: Implement the similar functions for other gestures here as well.
    3537
  • trunk/Source/WebCore/testing/Internals.cpp

    r148921 r149262  
    8282#include "RenderObject.h"
    8383#include "RenderTreeAsText.h"
     84#include "RenderView.h"
    8485#include "RuntimeEnabledFeatures.h"
    8586#include "SchemeRegistry.h"
     
    9091#include "ShadowRoot.h"
    9192#include "SpellChecker.h"
     93#include "StaticNodeList.h"
    9294#include "StyleSheetContents.h"
    9395#include "TextIterator.h"
     
    14151417#endif
    14161418
    1417 PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding,
     1419PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int centerX, int centerY, unsigned topPadding, unsigned rightPadding,
    14181420    unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode& ec) const
    14191421{
     
    14221424        return 0;
    14231425    }
     1426
     1427    Frame* frame = document->frame();
     1428    FrameView* frameView = document->view();
     1429    RenderView* renderView = document->renderView();
     1430    if (!renderView)
     1431        return 0;
     1432
     1433    float zoomFactor = frame->pageZoomFactor();
     1434    LayoutPoint point = roundedLayoutPoint(FloatPoint(centerX * zoomFactor + frameView->scrollX(), centerY * zoomFactor + frameView->scrollY()));
    14241435
    14251436    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
     
    14311442        hitType |= HitTestRequest::AllowChildFrameContent;
    14321443
    1433     return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, hitType);
     1444    HitTestRequest request(hitType);
     1445
     1446    // When ignoreClipping is false, this method returns null for coordinates outside of the viewport.
     1447    if (!request.ignoreClipping() && !frameView->visibleContentRect().intersects(HitTestLocation::rectForPoint(point, topPadding, rightPadding, bottomPadding, leftPadding)))
     1448        return 0;
     1449
     1450    Vector<RefPtr<Node> > matches;
     1451
     1452    // Need padding to trigger a rect based hit test, but we want to return a NodeList
     1453    // so we special case this.
     1454    if (!topPadding && !rightPadding && !bottomPadding && !leftPadding) {
     1455        HitTestResult result(point);
     1456        renderView->hitTest(request, result);
     1457        if (result.innerNode())
     1458            matches.append(result.innerNode()->deprecatedShadowAncestorNode());
     1459    } else {
     1460        HitTestResult result(point, topPadding, rightPadding, bottomPadding, leftPadding);
     1461        renderView->hitTest(request, result);
     1462        copyToVector(result.rectBasedTestResult(), matches);
     1463    }
     1464
     1465    return StaticNodeList::adopt(matches);
    14341466}
    14351467
  • trunk/Source/WebKit/ChangeLog

    r149220 r149262  
     12013-04-25  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        StaticHashSetNodeList is unnecessary
     4        https://bugs.webkit.org/show_bug.cgi?id=115219
     5
     6        Reviewed by Antonio Gomes.
     7
     8        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
     9
    1102013-04-26  Roger Fong  <roger_fong@apple.com>
    211
  • trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in

    r149220 r149262  
    114114        ??0Mutex@WTF@@QAE@XZ
    115115        ??0ThreadCondition@WTF@@QAE@XZ
     116        ??1HitTestResult@WebCore@@QAE@XZ
    116117        ??1Mutex@WTF@@QAE@XZ
    117118        ??1ThreadCondition@WTF@@QAE@XZ
     
    191192        ?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVNode@2@PBVRange@2@AAI2@Z
    192193        ?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
     194        ?item@StaticNodeList@WebCore@@UBEPAVNode@2@I@Z
    193195        ?selectTag@HTMLNames@WebCore@@3VQualifiedName@2@B
    194196#if ENABLE(INSPECTOR)
     
    227229        ?firstChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ
    228230        ?lastChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ
     231        ?length@StaticNodeList@WebCore@@UBEIXZ
     232        ?namedItem@StaticNodeList@WebCore@@UBEPAVNode@2@ABVAtomicString@WTF@@@Z
    229233        ?next@ComposedShadowTreeWalker@WebCore@@QAEXXZ
    230234        ?previous@ComposedShadowTreeWalker@WebCore@@QAEXXZ
     
    304308        ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ
    305309        ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z
    306         ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIIII@Z
    307310        ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
    308311        ?isContinuousSpellCheckingEnabled@Editor@WebCore@@QBE_NXZ
  • trunk/Source/WebKit/win/ChangeLog

    r149125 r149262  
     12013-04-25  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        StaticHashSetNodeList is unnecessary
     4        https://bugs.webkit.org/show_bug.cgi?id=115219
     5
     6        Reviewed by Antonio Gomes.
     7
     8        * WebKit.vcproj/WebKitExports.def.in:
     9
    1102013-04-25  Joseph Pecoraro  <pecoraro@apple.com>
    211
  • trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in

    r148940 r149262  
    114114        ??0Mutex@WTF@@QAE@XZ
    115115        ??0ThreadCondition@WTF@@QAE@XZ
     116        ??1HitTestResult@WebCore@@QAE@XZ
    116117        ??1Mutex@WTF@@QAE@XZ
    117118        ??1ThreadCondition@WTF@@QAE@XZ
     
    192193        ?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVNode@2@PBVRange@2@AAI2@Z
    193194        ?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
     195        ?item@StaticNodeList@WebCore@@UBEPAVNode@2@I@Z
    194196        ?selectTag@HTMLNames@WebCore@@3VQualifiedName@2@B
    195197#if ENABLE(INSPECTOR)
     
    228230        ?firstChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ
    229231        ?lastChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ
     232        ?length@StaticNodeList@WebCore@@UBEIXZ
     233        ?namedItem@StaticNodeList@WebCore@@UBEPAVNode@2@ABVAtomicString@WTF@@@Z
    230234        ?next@ComposedShadowTreeWalker@WebCore@@QAEXXZ
    231235        ?previous@ComposedShadowTreeWalker@WebCore@@QAEXXZ
     
    305309        ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ
    306310        ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z
    307         ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIIII@Z
    308311        ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
    309312        ?isContinuousSpellCheckingEnabled@Editor@WebCore@@QBE_NXZ
  • trunk/Source/autotools/symbols.filter

    r148921 r149262  
    6060_ZN7WebCore10ClientRectC1ERKNS_7IntRectE;
    6161_ZN7WebCore10ShadowRoot6createEPNS_7ElementERi;
     62_ZN7WebCore10RenderView7hitTestERKNS_14HitTestRequestERNS_13HitTestResultE;
    6263_ZN7WebCore11memoryCacheEv;
    6364_ZN7WebCore11EventTarget17toGeneratedStreamEv;
     
    6970_ZN7WebCore12PrintContext20pageNumberForElementEPNS_7ElementERKNS_9FloatSizeE;
    7071_ZN7WebCore12WorkerThread17workerThreadCountEv;
     72_ZN7WebCore13HitTestResultC1ERKNS_11LayoutPointE;
     73_ZN7WebCore13HitTestResultD1Ev;
    7174_ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE;
    7275_ZN7WebCore14ClientRectListC1Ev;
     
    257260_ZN7WebCore11FrameLoader6reloadEb;
    258261_ZN7WebCore13toArrayBufferEN3JSC7JSValueE;
     262_ZN7WebCore13HitTestResultC1ERKNS_11LayoutPointEjjjj;
     263_ZN7WebCore15HitTestLocation12rectForPointERKNS_11LayoutPointEjjjj;
    259264_ZN7WebCore21SerializedScriptValue6createERKN3WTF6StringE;
    260265_ZN7WebCore21SerializedScriptValueD1Ev;
     
    302307_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE;
    303308_ZNK7WebCore10TimeRanges7nearestEd;
     309_ZNK7WebCore13HitTestResult19rectBasedTestResultEv;
     310_ZNK7WebCore4Node28deprecatedShadowAncestorNodeEv;
     311_ZNK7WebCore7IntRect10intersectsERKS0_;
     312_ZNK7WebCore8Document13nodesFromRectEiijjjjj;
     313_ZTVN7WebCore14StaticNodeListE;
    304314
    305315local:
Note: See TracChangeset for help on using the changeset viewer.