Modified: trunk/Source/WebCore/rendering/HitTestLocation.cpp (257501 => 257502)
--- trunk/Source/WebCore/rendering/HitTestLocation.cpp 2020-02-26 19:54:20 UTC (rev 257501)
+++ trunk/Source/WebCore/rendering/HitTestLocation.cpp 2020-02-26 20:05:05 UTC (rev 257502)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2008, 2011, 2020 Apple Inc. All rights reserved.
* Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
*
* This library is free software; you can redistribute it and/or
@@ -24,11 +24,7 @@
namespace WebCore {
-HitTestLocation::HitTestLocation()
- : m_isRectBased(false)
- , m_isRectilinear(true)
-{
-}
+HitTestLocation::HitTestLocation() = default;
HitTestLocation::HitTestLocation(const LayoutPoint& point)
: m_point(point)
@@ -35,29 +31,21 @@
, m_boundingBox(rectForPoint(point, 0, 0, 0, 0))
, m_transformedPoint(point)
, m_transformedRect(m_boundingBox)
- , m_isRectBased(false)
- , m_isRectilinear(true)
{
}
HitTestLocation::HitTestLocation(const FloatPoint& point)
- : m_point(flooredLayoutPoint(point))
- , m_boundingBox(rectForPoint(m_point, 0, 0, 0, 0))
- , m_transformedPoint(point)
- , m_transformedRect(m_boundingBox)
- , m_isRectBased(false)
- , m_isRectilinear(true)
+ : HitTestLocation::HitTestLocation { flooredLayoutPoint(point) }
{
}
HitTestLocation::HitTestLocation(const FloatPoint& point, const FloatQuad& quad)
- : m_transformedPoint(point)
- , m_transformedRect(quad)
- , m_isRectBased(true)
+ : m_point { flooredLayoutPoint(point) }
+ , m_boundingBox { quad.enclosingBoundingBox() }
+ , m_transformedPoint { point }
+ , m_transformedRect { quad }
+ , m_isRectilinear { quad.isRectilinear() }
{
- m_point = flooredLayoutPoint(point);
- m_boundingBox = enclosingIntRect(quad.boundingBox());
- m_isRectilinear = quad.isRectilinear();
}
HitTestLocation::HitTestLocation(const LayoutPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding)
@@ -64,10 +52,9 @@
: m_point(centerPoint)
, m_boundingBox(rectForPoint(centerPoint, topPadding, rightPadding, bottomPadding, leftPadding))
, m_transformedPoint(centerPoint)
+ , m_transformedRect(FloatQuad { m_boundingBox })
, m_isRectBased(topPadding || rightPadding || bottomPadding || leftPadding)
- , m_isRectilinear(true)
{
- m_transformedRect = FloatQuad(m_boundingBox);
}
HitTestLocation::HitTestLocation(const HitTestLocation& other, const LayoutSize& offset)
Modified: trunk/Source/WebCore/rendering/HitTestLocation.h (257501 => 257502)
--- trunk/Source/WebCore/rendering/HitTestLocation.h 2020-02-26 19:54:20 UTC (rev 257501)
+++ trunk/Source/WebCore/rendering/HitTestLocation.h 2020-02-26 20:05:05 UTC (rev 257502)
@@ -21,11 +21,7 @@
#pragma once
-#include "FloatQuad.h"
-#include "FloatRect.h"
-#include "LayoutRect.h"
#include "RoundedRect.h"
-#include <wtf/Forward.h>
namespace WebCore {
@@ -65,11 +61,11 @@
const FloatQuad& transformedRect() const { return m_transformedRect; }
private:
- template<typename RectType>
- bool intersectsRect(const RectType&) const;
- void move(const LayoutSize& offset);
+ template<typename RectType> bool intersectsRect(const RectType&) const;
- // This is cached forms of the more accurate point and area below.
+ void move(const LayoutSize&);
+
+ // These are the cached forms of the more accurate point and rect below.
LayoutPoint m_point;
IntRect m_boundingBox;
@@ -76,8 +72,8 @@
FloatPoint m_transformedPoint;
FloatQuad m_transformedRect;
- bool m_isRectBased;
- bool m_isRectilinear;
+ bool m_isRectBased { false };
+ bool m_isRectilinear { true };
};
} // namespace WebCore