summaryrefslogtreecommitdiff
path: root/www-client/chromium/files/chromium-82-gcc-constexpr.patch
blob: 30a83395d0870a9d0d93b8f8c9001493a75ddd0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 5812cd9bc2c15a034db24e0d2a43cc923d8a66cc Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Thu, 20 Feb 2020 13:00:16 +0100
Subject: [PATCH] GCC: DOMRect constexpr equal operator depends on non constexpr operators

Make accessors of DOMRectReadOnly constexpr so the equal operator can be
also constexpr.

../../third_party/blink/renderer/core/geometry/dom_rect.h: In function ‘constexpr bool blink::operator==(const blink::DOMRect&, const blink::DOMRect&)’:
../../third_party/blink/renderer/core/geometry/dom_rect.h:38:15: error: call to non-‘constexpr’ function ‘double blink::DOMRectReadOnly::x() const’

Bug: 819294
Change-Id: Ic1fed89c5480ce4eedaaf7add2779d000b77cc48
---

diff --git a/third_party/blink/renderer/core/geometry/dom_rect_read_only.h b/third_party/blink/renderer/core/geometry/dom_rect_read_only.h
index 0c3f84c..71f193e 100644
--- a/third_party/blink/renderer/core/geometry/dom_rect_read_only.h
+++ b/third_party/blink/renderer/core/geometry/dom_rect_read_only.h
@@ -31,10 +31,10 @@ class CORE_EXPORT DOMRectReadOnly : public ScriptWrappable {
 
   DOMRectReadOnly(double x, double y, double width, double height);
 
-  double x() const { return x_; }
-  double y() const { return y_; }
-  double width() const { return width_; }
-  double height() const { return height_; }
+  constexpr double x() const { return x_; }
+  constexpr double y() const { return y_; }
+  constexpr double width() const { return width_; }
+  constexpr double height() const { return height_; }
 
   double top() const { return geometry_util::NanSafeMin(y_, y_ + height_); }
   double right() const { return geometry_util::NanSafeMax(x_, x_ + width_); }