Changeset 257569 in webkit


Ignore:
Timestamp:
Feb 27, 2020, 9:34:38 AM (5 years ago)
Author:
dbates@webkit.org
Message:

Cleanup HitTestResult.{h, cpp}
https://bugs.webkit.org/show_bug.cgi?id=208269
<rdar://problem/59824186>

Reviewed by Alex Christensen.

Use modern C++ features to remove duplicate code.

  • rendering/HitTestLocation.cpp:

(WebCore::HitTestLocation::HitTestLocation):

  • rendering/HitTestLocation.h:
  • rendering/HitTestResult.cpp: Remove unnecessary #includes.
  • rendering/HitTestResult.h: Remove unnecessary #includes.

(WebCore::HitTestResult::setIsOverWidget):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r257568 r257569  
     12020-02-27  Daniel Bates  <dabates@apple.com>
     2
     3        Cleanup HitTestResult.{h, cpp}
     4        https://bugs.webkit.org/show_bug.cgi?id=208269
     5        <rdar://problem/59824186>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Use modern C++ features to remove duplicate code.
     10
     11        * rendering/HitTestLocation.cpp:
     12        (WebCore::HitTestLocation::HitTestLocation):
     13        * rendering/HitTestLocation.h:
     14        * rendering/HitTestResult.cpp: Remove unnecessary #includes.
     15        * rendering/HitTestResult.h: Remove unnecessary #includes.
     16        (WebCore::HitTestResult::setIsOverWidget):
     17
    1182020-02-27  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r248846 r257569  
    11/*
    2  * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2008, 2011-2020 Apple Inc. All rights reserved.
    33 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
    44 *
     
    2929#include "Frame.h"
    3030#include "FrameSelection.h"
    31 #include "FrameTree.h"
    3231#include "HTMLAnchorElement.h"
    3332#include "HTMLAttachmentElement.h"
     
    3534#include "HTMLImageElement.h"
    3635#include "HTMLInputElement.h"
    37 #include "HTMLMediaElement.h"
    38 #include "HTMLNames.h"
    3936#include "HTMLObjectElement.h"
    4037#include "HTMLParserIdioms.h"
    41 #include "HTMLPlugInImageElement.h"
    4238#include "HTMLTextAreaElement.h"
    4339#include "HTMLVideoElement.h"
    44 #include "HitTestLocation.h"
    4540#include "PseudoElement.h"
    4641#include "RenderBlockFlow.h"
     
    6055using namespace HTMLNames;
    6156
    62 HitTestResult::HitTestResult()
    63     : m_isOverWidget(false)
    64 {
    65 }
     57HitTestResult::HitTestResult() = default;
    6658
    6759HitTestResult::HitTestResult(const LayoutPoint& point)
    6860    : m_hitTestLocation(point)
    6961    , m_pointInInnerNodeFrame(point)
    70     , m_isOverWidget(false)
    7162{
    7263}
     
    7566    : m_hitTestLocation(centerPoint, topPadding, rightPadding, bottomPadding, leftPadding)
    7667    , m_pointInInnerNodeFrame(centerPoint)
    77     , m_isOverWidget(false)
    7868{
    7969}
     
    8272    : m_hitTestLocation(other)
    8373    , m_pointInInnerNodeFrame(m_hitTestLocation.point())
    84     , m_isOverWidget(false)
    8574{
    8675}
  • trunk/Source/WebCore/rendering/HitTestResult.h

    r248762 r257569  
    11/*
    2  * Copyright (C) 2006 Apple Inc.
     2 * Copyright (C) 2006, 2014, 2020 Apple Inc.
    33 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
    44 *
     
    2222#pragma once
    2323
    24 #include "FloatRect.h"
    2524#include "HitTestLocation.h"
    2625#include "HitTestRequest.h"
    27 #include "LayoutRect.h"
    28 #include <memory>
    2926#include <wtf/Forward.h>
    3027#include <wtf/ListHashSet.h>
    31 #include <wtf/RefPtr.h>
    3228
    3329namespace WebCore {
     
    4541    WTF_MAKE_FAST_ALLOCATED;
    4642public:
    47     typedef ListHashSet<RefPtr<Node>> NodeSet;
     43    using NodeSet = ListHashSet<RefPtr<Node>>;
    4844
    4945    WEBCORE_EXPORT HitTestResult();
     
    5450    WEBCORE_EXPORT HitTestResult(const HitTestResult&);
    5551    WEBCORE_EXPORT ~HitTestResult();
     52
    5653    WEBCORE_EXPORT HitTestResult& operator=(const HitTestResult&);
    5754
     55    WEBCORE_EXPORT void setInnerNode(Node*);
    5856    Node* innerNode() const { return m_innerNode.get(); }
     57
     58    void setInnerNonSharedNode(Node*);
    5959    Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); }
     60
    6061    WEBCORE_EXPORT Element* innerNonSharedElement() const;
     62
     63    void setURLElement(Element*);
    6164    Element* URLElement() const { return m_innerURLElement.get(); }
     65
     66    void setScrollbar(Scrollbar*);
    6267    Scrollbar* scrollbar() const { return m_scrollbar.get(); }
     68
    6369    bool isOverWidget() const { return m_isOverWidget; }
     70    void setIsOverWidget(bool isOverWidget) { m_isOverWidget = isOverWidget; }
    6471
    6572    WEBCORE_EXPORT String linkSuggestedFilename() const;
     
    8491
    8592    const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; }
    86 
    87     WEBCORE_EXPORT void setInnerNode(Node*);
    88     void setInnerNonSharedNode(Node*);
    89     void setURLElement(Element*);
    90     void setScrollbar(Scrollbar*);
    91     void setIsOverWidget(bool b) { m_isOverWidget = b; }
    9293
    9394    WEBCORE_EXPORT Frame* targetFrame() const;
     
    159160    RefPtr<Element> m_innerURLElement;
    160161    RefPtr<Scrollbar> m_scrollbar;
    161     bool m_isOverWidget; // Returns true if we are over a widget (and not in the border/padding area of a RenderWidget for example).
     162    bool m_isOverWidget { false }; // Returns true if we are over a widget (and not in the border/padding area of a RenderWidget for example).
    162163
    163164    mutable std::unique_ptr<NodeSet> m_listBasedTestResult;
Note: See TracChangeset for help on using the changeset viewer.