Changeset 257569 in webkit
- Timestamp:
- Feb 27, 2020, 9:34:38 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r257568 r257569 1 2020-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 1 18 2020-02-27 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r248846 r257569 1 1 /* 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2008, 2011-2020 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 4 4 * … … 29 29 #include "Frame.h" 30 30 #include "FrameSelection.h" 31 #include "FrameTree.h"32 31 #include "HTMLAnchorElement.h" 33 32 #include "HTMLAttachmentElement.h" … … 35 34 #include "HTMLImageElement.h" 36 35 #include "HTMLInputElement.h" 37 #include "HTMLMediaElement.h"38 #include "HTMLNames.h"39 36 #include "HTMLObjectElement.h" 40 37 #include "HTMLParserIdioms.h" 41 #include "HTMLPlugInImageElement.h"42 38 #include "HTMLTextAreaElement.h" 43 39 #include "HTMLVideoElement.h" 44 #include "HitTestLocation.h"45 40 #include "PseudoElement.h" 46 41 #include "RenderBlockFlow.h" … … 60 55 using namespace HTMLNames; 61 56 62 HitTestResult::HitTestResult() 63 : m_isOverWidget(false) 64 { 65 } 57 HitTestResult::HitTestResult() = default; 66 58 67 59 HitTestResult::HitTestResult(const LayoutPoint& point) 68 60 : m_hitTestLocation(point) 69 61 , m_pointInInnerNodeFrame(point) 70 , m_isOverWidget(false)71 62 { 72 63 } … … 75 66 : m_hitTestLocation(centerPoint, topPadding, rightPadding, bottomPadding, leftPadding) 76 67 , m_pointInInnerNodeFrame(centerPoint) 77 , m_isOverWidget(false)78 68 { 79 69 } … … 82 72 : m_hitTestLocation(other) 83 73 , m_pointInInnerNodeFrame(m_hitTestLocation.point()) 84 , m_isOverWidget(false)85 74 { 86 75 } -
trunk/Source/WebCore/rendering/HitTestResult.h
r248762 r257569 1 1 /* 2 * Copyright (C) 2006 Apple Inc.2 * Copyright (C) 2006, 2014, 2020 Apple Inc. 3 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 4 4 * … … 22 22 #pragma once 23 23 24 #include "FloatRect.h"25 24 #include "HitTestLocation.h" 26 25 #include "HitTestRequest.h" 27 #include "LayoutRect.h"28 #include <memory>29 26 #include <wtf/Forward.h> 30 27 #include <wtf/ListHashSet.h> 31 #include <wtf/RefPtr.h>32 28 33 29 namespace WebCore { … … 45 41 WTF_MAKE_FAST_ALLOCATED; 46 42 public: 47 typedef ListHashSet<RefPtr<Node>> NodeSet;43 using NodeSet = ListHashSet<RefPtr<Node>>; 48 44 49 45 WEBCORE_EXPORT HitTestResult(); … … 54 50 WEBCORE_EXPORT HitTestResult(const HitTestResult&); 55 51 WEBCORE_EXPORT ~HitTestResult(); 52 56 53 WEBCORE_EXPORT HitTestResult& operator=(const HitTestResult&); 57 54 55 WEBCORE_EXPORT void setInnerNode(Node*); 58 56 Node* innerNode() const { return m_innerNode.get(); } 57 58 void setInnerNonSharedNode(Node*); 59 59 Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); } 60 60 61 WEBCORE_EXPORT Element* innerNonSharedElement() const; 62 63 void setURLElement(Element*); 61 64 Element* URLElement() const { return m_innerURLElement.get(); } 65 66 void setScrollbar(Scrollbar*); 62 67 Scrollbar* scrollbar() const { return m_scrollbar.get(); } 68 63 69 bool isOverWidget() const { return m_isOverWidget; } 70 void setIsOverWidget(bool isOverWidget) { m_isOverWidget = isOverWidget; } 64 71 65 72 WEBCORE_EXPORT String linkSuggestedFilename() const; … … 84 91 85 92 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; }92 93 93 94 WEBCORE_EXPORT Frame* targetFrame() const; … … 159 160 RefPtr<Element> m_innerURLElement; 160 161 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). 162 163 163 164 mutable std::unique_ptr<NodeSet> m_listBasedTestResult;
Note:
See TracChangeset
for help on using the changeset viewer.