author stransky <stransky@redhat.com>
Thu, 21 Oct 2021 13:15:02 +0000
changeset 596578 aceba6246b0e588f6fb1071dabb4d97159306b3c
parent 583580 36647ef6f014ee7199a0bad93851750ead132473
permissions -rw-r--r--
Bug 1735095 [Wayland] When font/text scale factor is used, don't reposition popups for +-1 pixel moves, r=jhorak When font scale is used, move-to-rect popup positiong may end up in endless loop due to rounding error while popup position oscilates around layout position. We don't have a fox for that so let's disable such small popup movements when font scale is used. Depends on D129153 Differential Revision: https://phabricator.services.mozilla.com/D129154

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: set ts=8 sts=2 et sw=2 tw=80:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

 * JIT info so SpiderMonkey can efficiently work with Gecko XrayWrapper
 * instances.
 * This header is completely irrelevant to non-Gecko embedders.

#ifndef js_friend_XrayJitInfo_h
#define js_friend_XrayJitInfo_h

#include <stddef.h>  // size_t

#include "jstypes.h"  // JS_PUBLIC_API

class JS_PUBLIC_API JSObject;

namespace js {

class JS_PUBLIC_API BaseProxyHandler;

}  // namespace js

namespace JS {

// Callbacks and other information for use by the JITs when optimizing accesses
// on xray wrappers.
struct XrayJitInfo {
  // Test whether a proxy handler is a cross compartment xray with no
  // security checks.
  bool (*isCrossCompartmentXray)(const js::BaseProxyHandler* handler);

  // Test whether xrays in |obj|'s compartment have expandos of their own,
  // instead of sharing them with Xrays from other compartments.
  bool (*compartmentHasExclusiveExpandos)(JSObject* obj);

  // Proxy reserved slot used by xrays in sandboxes to store their holder
  // object.
  size_t xrayHolderSlot;

  // Reserved slot used by xray holders to store the xray's expando object.
  size_t holderExpandoSlot;

  // Reserved slot used by xray expandos to store a custom prototype.
  size_t expandoProtoSlot;

extern JS_PUBLIC_API void SetXrayJitInfo(XrayJitInfo* info);

}  // namespace JS

#endif  // js_friend_XrayJitInfo_h