diff --git a/src/3rdparty/chromium/third_party/blink/renderer/core/dom/element_rare_data_vector.cc b/src/3rdparty/chromium/third_party/blink/renderer/core/dom/element_rare_data_vector.cc
index 5680187326b..816600005b8 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/core/dom/element_rare_data_vector.cc
+++ b/src/3rdparty/chromium/third_party/blink/renderer/core/dom/element_rare_data_vector.cc
@@ -45,12 +45,27 @@ ElementRareDataVector::~ElementRareDataVector() {
 unsigned ElementRareDataVector::GetFieldIndex(FieldId field_id) const {
   unsigned field_id_int = static_cast<unsigned>(field_id);
   DCHECK(fields_bitfield_ & (static_cast<BitfieldType>(1) << field_id_int));
+#if defined(__GNUC__) || defined(__clang__)
+  return __builtin_popcount(fields_bitfield_ &
+                            ~(~static_cast<BitfieldType>(0) << field_id_int));
+#elif _MSVC_LANG >= 202002L // C++20
+    return std::popcount(fields_bitfield_ &
+                         ~(~static_cast<BitfieldType>(0) << field_id_int));
+#else
+    uint32_t v = (fields_bitfield_ &
+                  ~(~static_cast<BitfieldType>(0) << field_id_int));
+    uint32_t c = v - ((v >> 1) & 0x55555555);
+    c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
+    c = ((c >> 4) + c) & 0x0F0F0F0F;
+    c = ((c >> 8) + c) & 0x00FF00FF;
+    c = ((c >> 16) + c) & 0x0000FFFF;
+    return c;
+#endif
+
 #ifdef _MSC_VER
   return __popcnt(fields_bitfield_ &
                             ~(~static_cast<BitfieldType>(0) << field_id_int));
 #else
-  return __builtin_popcount(fields_bitfield_ &
-                            ~(~static_cast<BitfieldType>(0) << field_id_int));
 #endif
 }

diff --git a/src/3rdparty/chromium/third_party/blink/renderer/core/paint/sparse_vector.h b/src/3rdparty/chromium/third_party/blink/renderer/core/paint/sparse_vector.h
index 983d49f249e..ebc1c2a17bc 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/core/paint/sparse_vector.h
+++ b/src/3rdparty/chromium/third_party/blink/renderer/core/paint/sparse_vector.h
@@ -108,10 +108,18 @@ class CORE_EXPORT SparseVector {
     // Then count the total population of field IDs lower than that one we
     // are looking for. The target field ID should be located at the index of
     // of the total population.
-#ifdef _MSC_VER
-    return __popcnt(fields_bitfield_ & mask);
-#else
+#if defined(__GNUC__) || defined(__clang__)
     return __builtin_popcount(fields_bitfield_ & mask);
+#elif _MSVC_LANG >= 202002L // C++20
+    return std::popcount(fields_bitfield_ & mask);
+#else
+    uint32_t v = (fields_bitfield_ & mask);
+    uint32_t c = v - ((v >> 1) & 0x55555555);
+    c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
+    c = ((c >> 4) + c) & 0x0F0F0F0F;
+    c = ((c >> 8) + c) & 0x00FF00FF;
+    c = ((c >> 16) + c) & 0x0000FFFF;
+    return c;
 #endif
   }

diff --git a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/compiler.h.orig b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/compiler.h
--- a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/compiler.h.orig
+++ b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/compiler.h
@@ -76,9 +76,31 @@

 #if defined(__GNUC__) || defined(__clang__)
 #define PERFETTO_POPCOUNT(x) __builtin_popcountll(x)
-#else
+#elif defined(__AVX__) || defined(__SSE4_2__) || defined(__POPCNT__)
 #include <intrin.h>
 #define PERFETTO_POPCOUNT(x) __popcnt64(x)
+#else
+#if __has_include(<bit>) && __cplusplus > 201703L
+#include <bit>
+#endif
+template <typename ValueType, std::enable_if_t<std::is_unsigned_v<ValueType>, int> = 0>
+inline uint32_t qPopulationCount(const ValueType v) noexcept
+{
+#if defined(__cpp_lib_bitops) // && __cpp_lib_bitops >= 201907L
+    return std::popcount(v);
+#else
+    // we static_cast these bit patterns in order to truncate them to the correct size
+    v = static_cast<ValueType>(v - ((v >> 1) & static_cast<ValueType>(0x5555'5555'5555'5555ull)));
+    v = static_cast<ValueType>((v & static_cast<ValueType>(0x3333'3333'3333'3333ull))
+      + ((v >> 2) & static_cast<ValueType>(0x3333'3333'3333'3333ull)));
+    v = static_cast<ValueType>((v + (v >> 4)) & static_cast<ValueType>(0x0F0F'0F0F'0F0F'0F0Full));
+    // Multiply by one in each byte, so that it will have the sum of all source bytes in the highest byte
+    v = static_cast<ValueType>(v * static_cast<ValueType>(0x0101'0101'0101'0101ull));
+    // Extract highest byte
+    return static_cast<uint32_t>(v >> (sizeof(ValueType) * CHAR_BIT - 8));
+#endif
+}
+#define PERFETTO_POPCOUNT(x) qPopulationCount(x)
 #endif
 

diff --git a/src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig
+++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
@@ -2402,6 +2402,7 @@ if (is_win && !is_mingw) {
     "/Ob2",  # Both explicit and auto inlining.
     "/Oy-",  # Disable omitting frame pointers, must be after /O2.
     "/Zc:inline",  # Remove unreferenced COMDAT (faster links).
+    "/Zc:__cplusplus"
   ]
   if (!is_asan) {
     common_optimize_on_cflags += [

diff --git a/src/3rdparty/chromium/build/config/win/BUILD.gn.orig b/src/3rdparty/chromium/build/config/win/BUILD.gn
index ea5e60d..9facdc4 100644
--- a/src/3rdparty/chromium/build/config/win/BUILD.gn.orig
+++ b/src/3rdparty/chromium/build/config/win/BUILD.gn
@@ -91,6 +91,7 @@ config("compiler") {
   cflags += [
     "/Zc:preprocessor",
     "/wd5105",
+    "/Zc:__cplusplus"
   ]
 
   if (is_clang) {

