2015-11-25 04:14:39 +03:00
|
|
|
/* -*- 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_ServoBindings_h
|
|
|
|
#define mozilla_ServoBindings_h
|
|
|
|
|
2016-10-24 12:16:46 +03:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-10-20 13:31:13 +03:00
|
|
|
#include "mozilla/AtomArray.h"
|
2016-09-22 01:42:45 +03:00
|
|
|
#include "mozilla/ServoTypes.h"
|
2016-10-24 12:16:46 +03:00
|
|
|
#include "mozilla/ServoBindingTypes.h"
|
2018-05-16 08:35:59 +03:00
|
|
|
#include "mozilla/ServoComputedDataInlines.h"
|
2016-07-19 04:02:55 +03:00
|
|
|
#include "mozilla/ServoElementSnapshot.h"
|
2018-07-19 13:56:27 +03:00
|
|
|
#include "mozilla/css/DocumentMatchingFunction.h"
|
2018-02-28 11:09:00 +03:00
|
|
|
#include "mozilla/css/SheetLoadData.h"
|
2016-04-28 02:15:56 +03:00
|
|
|
#include "mozilla/css/SheetParsingMode.h"
|
2017-01-24 10:33:10 +03:00
|
|
|
#include "mozilla/EffectCompositor.h"
|
2017-04-06 04:34:51 +03:00
|
|
|
#include "mozilla/ComputedTimingFunction.h"
|
2016-07-19 04:02:55 +03:00
|
|
|
#include "nsChangeHint.h"
|
2017-06-28 19:04:49 +03:00
|
|
|
#include "nsIDocument.h"
|
2015-11-25 04:14:39 +03:00
|
|
|
|
|
|
|
/*
|
2018-02-02 18:49:10 +03:00
|
|
|
* API for Servo to access Gecko data structures.
|
2015-11-25 04:14:39 +03:00
|
|
|
*
|
|
|
|
* Functions beginning with Gecko_ are implemented in Gecko and invoked from Servo.
|
|
|
|
* Functions beginning with Servo_ are implemented in Servo and invoked from Gecko.
|
|
|
|
*/
|
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
class nsAtom;
|
2016-05-21 03:02:54 +03:00
|
|
|
class nsIPrincipal;
|
|
|
|
class nsIURI;
|
2016-06-07 22:13:24 +03:00
|
|
|
struct nsFont;
|
|
|
|
namespace mozilla {
|
|
|
|
class FontFamilyList;
|
2017-10-03 07:27:45 +03:00
|
|
|
struct FontFamilyName;
|
2018-05-25 16:07:57 +03:00
|
|
|
enum FontFamilyType : uint8_t;
|
2017-10-03 07:27:45 +03:00
|
|
|
class SharedFontList;
|
2017-05-14 19:39:22 +03:00
|
|
|
enum class CSSPseudoElementType : uint8_t;
|
2017-01-29 06:58:39 +03:00
|
|
|
struct Keyframe;
|
2017-04-26 12:41:45 +03:00
|
|
|
struct StyleTransition;
|
2017-02-10 04:43:52 +03:00
|
|
|
namespace css {
|
2018-02-01 07:04:04 +03:00
|
|
|
class ErrorReporter;
|
2017-02-10 04:43:52 +03:00
|
|
|
struct URLValue;
|
2017-04-28 16:38:27 +03:00
|
|
|
struct ImageValue;
|
2017-05-26 10:59:01 +03:00
|
|
|
class LoaderReusableStyleSheets;
|
2017-02-10 04:43:52 +03:00
|
|
|
};
|
2017-05-24 05:14:35 +03:00
|
|
|
namespace dom {
|
|
|
|
enum class IterationCompositeOperation : uint8_t;
|
|
|
|
};
|
2017-03-27 13:43:16 +03:00
|
|
|
enum class UpdateAnimationsTasks : uint8_t;
|
2017-04-04 21:11:27 +03:00
|
|
|
struct LangGroupFontPrefs;
|
2017-07-19 03:30:53 +03:00
|
|
|
class SeenPtrs;
|
2018-03-22 21:20:41 +03:00
|
|
|
class ComputedStyle;
|
2018-04-30 18:50:03 +03:00
|
|
|
class StyleSheet;
|
2017-05-07 17:36:47 +03:00
|
|
|
class ServoElementSnapshotTable;
|
2016-06-07 22:13:24 +03:00
|
|
|
}
|
|
|
|
using mozilla::FontFamilyList;
|
2017-10-03 07:27:45 +03:00
|
|
|
using mozilla::FontFamilyName;
|
2016-06-07 22:13:24 +03:00
|
|
|
using mozilla::FontFamilyType;
|
2016-07-19 04:02:55 +03:00
|
|
|
using mozilla::ServoElementSnapshot;
|
2017-10-03 07:27:45 +03:00
|
|
|
using mozilla::SharedFontList;
|
2017-01-15 01:33:40 +03:00
|
|
|
struct nsMediaFeature;
|
2017-10-23 23:36:59 +03:00
|
|
|
class nsSimpleContentList;
|
2016-05-27 01:18:09 +03:00
|
|
|
struct nsStyleList;
|
|
|
|
struct nsStyleImage;
|
|
|
|
struct nsStyleGradientStop;
|
|
|
|
class nsStyleGradient;
|
|
|
|
class nsStyleCoord;
|
|
|
|
struct nsStyleDisplay;
|
2017-06-05 09:00:27 +03:00
|
|
|
class nsXBLBinding;
|
2016-08-23 03:32:20 +03:00
|
|
|
|
2017-11-29 01:42:59 +03:00
|
|
|
#ifdef NIGHTLY_BUILD
|
|
|
|
const bool GECKO_IS_NIGHTLY = true;
|
|
|
|
#else
|
|
|
|
const bool GECKO_IS_NIGHTLY = false;
|
|
|
|
#endif
|
|
|
|
|
2016-05-21 03:02:54 +03:00
|
|
|
#define NS_DECL_THREADSAFE_FFI_REFCOUNTING(class_, name_) \
|
|
|
|
void Gecko_AddRef##name_##ArbitraryThread(class_* aPtr); \
|
|
|
|
void Gecko_Release##name_##ArbitraryThread(class_* aPtr);
|
|
|
|
#define NS_IMPL_THREADSAFE_FFI_REFCOUNTING(class_, name_) \
|
2016-06-22 02:57:43 +03:00
|
|
|
static_assert(class_::HasThreadSafeRefCnt::value, \
|
|
|
|
"NS_DECL_THREADSAFE_FFI_REFCOUNTING can only be used with " \
|
|
|
|
"classes that have thread-safe refcounting"); \
|
2016-05-21 03:02:54 +03:00
|
|
|
void Gecko_AddRef##name_##ArbitraryThread(class_* aPtr) \
|
|
|
|
{ NS_ADDREF(aPtr); } \
|
|
|
|
void Gecko_Release##name_##ArbitraryThread(class_* aPtr) \
|
|
|
|
{ NS_RELEASE(aPtr); }
|
|
|
|
|
2017-03-24 06:42:18 +03:00
|
|
|
#define NS_DECL_FFI_REFCOUNTING(class_, name_) \
|
|
|
|
void Gecko_##name_##_AddRef(class_* aPtr); \
|
|
|
|
void Gecko_##name_##_Release(class_* aPtr);
|
|
|
|
#define NS_IMPL_FFI_REFCOUNTING(class_, name_) \
|
2017-04-07 04:07:04 +03:00
|
|
|
void Gecko_##name_##_AddRef(class_* aPtr) \
|
|
|
|
{ MOZ_ASSERT(NS_IsMainThread()); NS_ADDREF(aPtr); } \
|
|
|
|
void Gecko_##name_##_Release(class_* aPtr) \
|
|
|
|
{ MOZ_ASSERT(NS_IsMainThread()); NS_RELEASE(aPtr); }
|
2017-03-24 06:42:18 +03:00
|
|
|
|
2016-11-23 02:26:20 +03:00
|
|
|
#define DEFINE_ARRAY_TYPE_FOR(type_) \
|
|
|
|
struct nsTArrayBorrowed_##type_ { \
|
|
|
|
nsTArray<type_>* mArray; \
|
|
|
|
MOZ_IMPLICIT nsTArrayBorrowed_##type_(nsTArray<type_>* aArray) \
|
|
|
|
: mArray(aArray) {} \
|
|
|
|
}
|
|
|
|
DEFINE_ARRAY_TYPE_FOR(uintptr_t);
|
|
|
|
#undef DEFINE_ARRAY_TYPE_FOR
|
|
|
|
|
2015-11-25 04:14:39 +03:00
|
|
|
extern "C" {
|
|
|
|
|
2017-02-10 04:43:52 +03:00
|
|
|
class ServoBundledURI
|
|
|
|
{
|
|
|
|
public:
|
2018-03-01 17:37:23 +03:00
|
|
|
// NOTE(emilio): Not calling IntoCssUrl or IntoCssImage will cause to leak the
|
|
|
|
// string, so don't do that :)
|
2017-02-10 04:43:52 +03:00
|
|
|
already_AddRefed<mozilla::css::URLValue> IntoCssUrl();
|
2018-03-01 17:37:23 +03:00
|
|
|
already_AddRefed<mozilla::css::ImageValue> IntoCssImage(mozilla::CORSMode);
|
|
|
|
mozilla::ServoRawOffsetArc<RustString> mURLString;
|
2017-04-04 03:04:13 +03:00
|
|
|
mozilla::URLExtraData* mExtraData;
|
2017-02-23 04:19:04 +03:00
|
|
|
};
|
|
|
|
|
2017-04-04 21:11:27 +03:00
|
|
|
struct FontSizePrefs
|
|
|
|
{
|
|
|
|
void CopyFrom(const mozilla::LangGroupFontPrefs&);
|
|
|
|
nscoord mDefaultVariableSize;
|
|
|
|
nscoord mDefaultFixedSize;
|
|
|
|
nscoord mDefaultSerifSize;
|
|
|
|
nscoord mDefaultSansSerifSize;
|
|
|
|
nscoord mDefaultMonospaceSize;
|
|
|
|
nscoord mDefaultCursiveSize;
|
|
|
|
nscoord mDefaultFantasySize;
|
|
|
|
};
|
|
|
|
|
2018-02-06 18:52:22 +03:00
|
|
|
struct MediumFeaturesChangedResult {
|
|
|
|
bool mAffectsDocumentRules;
|
|
|
|
bool mAffectsNonDocumentRules;
|
|
|
|
bool mUsesViewportUnits;
|
|
|
|
};
|
|
|
|
|
2018-07-27 18:44:48 +03:00
|
|
|
// Debugging stuff.
|
|
|
|
void Gecko_Element_DebugListAttributes(RawGeckoElementBorrowed, nsCString*);
|
|
|
|
void Gecko_Snapshot_DebugListAttributes(const ServoElementSnapshot*, nsCString*);
|
|
|
|
|
2018-02-28 04:54:01 +03:00
|
|
|
bool Gecko_IsSignificantChild(RawGeckoNodeBorrowed node, bool whitespace_is_significant);
|
2016-08-23 16:11:02 +03:00
|
|
|
RawGeckoNodeBorrowedOrNull Gecko_GetLastChild(RawGeckoNodeBorrowed node);
|
2018-08-06 22:29:27 +03:00
|
|
|
RawGeckoNodeBorrowedOrNull Gecko_GetPreviousSibling(RawGeckoNodeBorrowed node);
|
2017-06-20 11:08:10 +03:00
|
|
|
RawGeckoNodeBorrowedOrNull Gecko_GetFlattenedTreeParentNode(RawGeckoNodeBorrowed node);
|
2017-06-18 20:39:57 +03:00
|
|
|
RawGeckoElementBorrowedOrNull Gecko_GetBeforeOrAfterPseudo(RawGeckoElementBorrowed element, bool is_before);
|
|
|
|
nsTArray<nsIContent*>* Gecko_GetAnonymousContentForElement(RawGeckoElementBorrowed element);
|
2018-06-04 20:14:20 +03:00
|
|
|
const nsTArray<RefPtr<nsINode>>* Gecko_GetAssignedNodes(RawGeckoElementBorrowed element);
|
2017-06-18 20:39:57 +03:00
|
|
|
void Gecko_DestroyAnonymousContentList(nsTArray<nsIContent*>* anon_content);
|
2015-11-25 04:14:39 +03:00
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
void Gecko_ComputedStyle_Init(mozilla::ComputedStyle* context,
|
2018-07-13 15:06:05 +03:00
|
|
|
RawGeckoPresContextBorrowed pres_context,
|
|
|
|
ServoComputedDataBorrowed values,
|
|
|
|
mozilla::CSSPseudoElementType pseudo_type,
|
|
|
|
nsAtom* pseudo_tag);
|
2018-03-22 21:20:41 +03:00
|
|
|
void Gecko_ComputedStyle_Destroy(mozilla::ComputedStyle* context);
|
2017-07-17 21:42:00 +03:00
|
|
|
|
2016-08-11 02:56:33 +03:00
|
|
|
// By default, Servo walks the DOM by traversing the siblings of the DOM-view
|
|
|
|
// first child. This generally works, but misses anonymous children, which we
|
|
|
|
// want to traverse during styling. To support these cases, we create an
|
2017-06-28 09:56:13 +03:00
|
|
|
// optional stack-allocated iterator in aIterator for nodes that need it.
|
|
|
|
void Gecko_ConstructStyleChildrenIterator(RawGeckoElementBorrowed aElement,
|
|
|
|
RawGeckoStyleChildrenIteratorBorrowedMut aIterator);
|
|
|
|
void Gecko_DestroyStyleChildrenIterator(RawGeckoStyleChildrenIteratorBorrowedMut aIterator);
|
|
|
|
RawGeckoNodeBorrowedOrNull Gecko_GetNextStyleChild(RawGeckoStyleChildrenIteratorBorrowedMut it);
|
2017-06-20 11:08:10 +03:00
|
|
|
|
2018-02-15 03:39:35 +03:00
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(mozilla::css::SheetLoadDataHolder, SheetLoadDataHolder);
|
|
|
|
|
|
|
|
void Gecko_StyleSheet_FinishAsyncParse(mozilla::css::SheetLoadDataHolder* data,
|
2018-08-21 13:31:11 +03:00
|
|
|
RawServoStyleSheetContentsStrong sheet_contents,
|
|
|
|
StyleUseCountersOwnedOrNull use_counters);
|
2018-02-15 03:39:35 +03:00
|
|
|
|
2018-04-30 18:50:03 +03:00
|
|
|
mozilla::StyleSheet*
|
2017-06-29 20:09:56 +03:00
|
|
|
Gecko_LoadStyleSheet(mozilla::css::Loader* loader,
|
2018-04-30 18:50:03 +03:00
|
|
|
mozilla::StyleSheet* parent,
|
2018-02-28 11:09:00 +03:00
|
|
|
mozilla::css::SheetLoadData* parent_load_data,
|
2017-06-29 20:09:56 +03:00
|
|
|
mozilla::css::LoaderReusableStyleSheets* reusable_sheets,
|
2018-02-15 03:39:35 +03:00
|
|
|
ServoBundledURI url,
|
2017-06-29 20:09:56 +03:00
|
|
|
RawServoMediaListStrong media_list);
|
2016-08-11 02:56:33 +03:00
|
|
|
|
2018-02-15 03:39:35 +03:00
|
|
|
void
|
|
|
|
Gecko_LoadStyleSheetAsync(mozilla::css::SheetLoadDataHolder* parent_data,
|
|
|
|
ServoBundledURI url,
|
|
|
|
RawServoMediaListStrong media_list,
|
|
|
|
RawServoImportRuleStrong import_rule);
|
|
|
|
|
2015-11-25 04:14:39 +03:00
|
|
|
// Selector Matching.
|
2017-03-20 18:54:54 +03:00
|
|
|
uint64_t Gecko_ElementState(RawGeckoElementBorrowed element);
|
2016-08-23 16:11:02 +03:00
|
|
|
bool Gecko_IsRootElement(RawGeckoElementBorrowed element);
|
2017-06-07 07:27:58 +03:00
|
|
|
bool Gecko_MatchLang(RawGeckoElementBorrowed element,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* override_lang, bool has_override_lang,
|
2017-06-07 07:27:58 +03:00
|
|
|
const char16_t* value);
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* Gecko_GetXMLLangValue(RawGeckoElementBorrowed element);
|
2017-06-28 23:09:32 +03:00
|
|
|
nsIDocument::DocumentTheme Gecko_GetDocumentLWTheme(const nsIDocument* aDocument);
|
2018-03-28 01:41:04 +03:00
|
|
|
bool Gecko_IsTableBorderNonzero(RawGeckoElementBorrowed element);
|
|
|
|
bool Gecko_IsBrowserFrame(RawGeckoElementBorrowed element);
|
2017-03-26 23:53:34 +03:00
|
|
|
|
2016-06-30 23:37:52 +03:00
|
|
|
// Attributes.
|
2016-08-23 16:11:02 +03:00
|
|
|
#define SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(prefix_, implementor_) \
|
2018-01-18 18:19:26 +03:00
|
|
|
nsAtom* prefix_##LangValue(implementor_ element); \
|
|
|
|
bool prefix_##HasAttr(implementor_ element, nsAtom* ns, nsAtom* name); \
|
|
|
|
bool prefix_##AttrEquals(implementor_ element, nsAtom* ns, nsAtom* name, \
|
|
|
|
nsAtom* str, bool ignoreCase); \
|
|
|
|
bool prefix_##AttrDashEquals(implementor_ element, nsAtom* ns, \
|
|
|
|
nsAtom* name, nsAtom* str, bool ignore_case); \
|
|
|
|
bool prefix_##AttrIncludes(implementor_ element, nsAtom* ns, \
|
|
|
|
nsAtom* name, nsAtom* str, bool ignore_case); \
|
|
|
|
bool prefix_##AttrHasSubstring(implementor_ element, nsAtom* ns, \
|
|
|
|
nsAtom* name, nsAtom* str, \
|
2017-06-09 00:09:41 +03:00
|
|
|
bool ignore_case); \
|
2018-01-18 18:19:26 +03:00
|
|
|
bool prefix_##AttrHasPrefix(implementor_ element, nsAtom* ns, \
|
|
|
|
nsAtom* name, nsAtom* str, bool ignore_case); \
|
|
|
|
bool prefix_##AttrHasSuffix(implementor_ element, nsAtom* ns, \
|
2018-08-15 02:29:40 +03:00
|
|
|
nsAtom* name, nsAtom* str, bool ignore_case);
|
|
|
|
|
|
|
|
bool Gecko_AssertClassAttrValueIsSane(const nsAttrValue*);
|
|
|
|
const nsAttrValue* Gecko_GetSVGAnimatedClass(RawGeckoElementBorrowed);
|
|
|
|
|
2016-07-19 04:02:55 +03:00
|
|
|
|
2016-08-23 16:11:02 +03:00
|
|
|
SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_, RawGeckoElementBorrowed)
|
2016-07-19 04:02:55 +03:00
|
|
|
SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_Snapshot,
|
2016-11-02 09:11:24 +03:00
|
|
|
const ServoElementSnapshot*)
|
2016-07-19 04:02:55 +03:00
|
|
|
|
|
|
|
#undef SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS
|
2015-11-25 04:14:39 +03:00
|
|
|
|
2016-06-24 06:35:12 +03:00
|
|
|
// Style attributes.
|
2016-10-18 07:29:03 +03:00
|
|
|
RawServoDeclarationBlockStrongBorrowedOrNull
|
2017-01-20 02:56:53 +03:00
|
|
|
Gecko_GetStyleAttrDeclarationBlock(RawGeckoElementBorrowed element);
|
2017-05-31 03:24:40 +03:00
|
|
|
void Gecko_UnsetDirtyStyleAttr(RawGeckoElementBorrowed element);
|
2017-01-20 02:56:53 +03:00
|
|
|
RawServoDeclarationBlockStrongBorrowedOrNull
|
|
|
|
Gecko_GetHTMLPresentationAttrDeclarationBlock(RawGeckoElementBorrowed element);
|
2017-03-26 23:53:34 +03:00
|
|
|
RawServoDeclarationBlockStrongBorrowedOrNull
|
|
|
|
Gecko_GetExtraContentStyleDeclarations(RawGeckoElementBorrowed element);
|
2017-06-01 21:37:02 +03:00
|
|
|
RawServoDeclarationBlockStrongBorrowedOrNull
|
|
|
|
Gecko_GetUnvisitedLinkAttrDeclarationBlock(RawGeckoElementBorrowed element);
|
|
|
|
RawServoDeclarationBlockStrongBorrowedOrNull
|
|
|
|
Gecko_GetVisitedLinkAttrDeclarationBlock(RawGeckoElementBorrowed element);
|
|
|
|
RawServoDeclarationBlockStrongBorrowedOrNull
|
|
|
|
Gecko_GetActiveLinkAttrDeclarationBlock(RawGeckoElementBorrowed element);
|
2016-06-24 06:35:12 +03:00
|
|
|
|
2017-07-23 18:37:46 +03:00
|
|
|
// Visited handling.
|
|
|
|
|
2018-08-14 11:47:25 +03:00
|
|
|
// Returns whether visited styles are enabled for a given document.
|
|
|
|
bool Gecko_VisitedStylesEnabled(const nsIDocument*);
|
2017-07-23 18:37:46 +03:00
|
|
|
|
2017-01-24 10:27:56 +03:00
|
|
|
// Animations
|
2017-03-17 07:23:21 +03:00
|
|
|
bool
|
2017-04-23 00:12:01 +03:00
|
|
|
Gecko_GetAnimationRule(RawGeckoElementBorrowed aElementOrPseudo,
|
2017-03-17 07:23:21 +03:00
|
|
|
mozilla::EffectCompositor::CascadeLevel aCascadeLevel,
|
2017-05-01 12:45:41 +03:00
|
|
|
RawServoAnimationValueMapBorrowedMut aAnimationValues);
|
2017-03-10 05:53:17 +03:00
|
|
|
bool Gecko_StyleAnimationsEquals(RawGeckoStyleAnimationListBorrowed,
|
|
|
|
RawGeckoStyleAnimationListBorrowed);
|
2017-10-10 11:00:28 +03:00
|
|
|
void Gecko_CopyAnimationNames(RawGeckoStyleAnimationListBorrowedMut aDest,
|
|
|
|
RawGeckoStyleAnimationListBorrowed aSrc);
|
|
|
|
// This function takes an already addrefed nsAtom
|
|
|
|
void Gecko_SetAnimationName(mozilla::StyleAnimation* aStyleAnimation,
|
|
|
|
nsAtom* aAtom);
|
2017-04-23 00:12:01 +03:00
|
|
|
void Gecko_UpdateAnimations(RawGeckoElementBorrowed aElementOrPseudo,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowedOrNull aOldComputedValues,
|
|
|
|
ComputedStyleBorrowedOrNull aComputedValues,
|
2017-04-25 06:24:51 +03:00
|
|
|
mozilla::UpdateAnimationsTasks aTasks);
|
2018-06-26 05:08:24 +03:00
|
|
|
size_t Gecko_GetAnimationEffectCount(RawGeckoElementBorrowed aElementOrPseudo);
|
2017-04-23 00:12:01 +03:00
|
|
|
bool Gecko_ElementHasAnimations(RawGeckoElementBorrowed aElementOrPseudo);
|
|
|
|
bool Gecko_ElementHasCSSAnimations(RawGeckoElementBorrowed aElementOrPseudo);
|
|
|
|
bool Gecko_ElementHasCSSTransitions(RawGeckoElementBorrowed aElementOrPseudo);
|
|
|
|
size_t Gecko_ElementTransitions_Length(RawGeckoElementBorrowed aElementOrPseudo);
|
2017-04-17 09:29:31 +03:00
|
|
|
nsCSSPropertyID Gecko_ElementTransitions_PropertyAt(
|
2017-04-23 00:12:01 +03:00
|
|
|
RawGeckoElementBorrowed aElementOrPseudo,
|
2017-04-17 09:29:31 +03:00
|
|
|
size_t aIndex);
|
|
|
|
RawServoAnimationValueBorrowedOrNull Gecko_ElementTransitions_EndValueAt(
|
2017-04-23 00:12:01 +03:00
|
|
|
RawGeckoElementBorrowed aElementOrPseudo,
|
2017-04-17 09:29:31 +03:00
|
|
|
size_t aIndex);
|
2017-04-06 04:34:51 +03:00
|
|
|
double Gecko_GetProgressFromComputedTiming(RawGeckoComputedTimingBorrowed aComputedTiming);
|
|
|
|
double Gecko_GetPositionInSegment(
|
|
|
|
RawGeckoAnimationPropertySegmentBorrowed aSegment,
|
|
|
|
double aProgress,
|
|
|
|
mozilla::ComputedTimingFunction::BeforeFlag aBeforeFlag);
|
2017-04-06 04:34:51 +03:00
|
|
|
// Get servo's AnimationValue for |aProperty| from the cached base style
|
|
|
|
// |aBaseStyles|.
|
|
|
|
// |aBaseStyles| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.
|
2017-08-02 21:24:35 +03:00
|
|
|
// We use RawServoAnimationValueTableBorrowed to avoid exposing nsRefPtrHashtable in FFI.
|
2017-04-06 04:34:51 +03:00
|
|
|
RawServoAnimationValueBorrowedOrNull Gecko_AnimationGetBaseStyle(
|
2017-08-02 21:24:35 +03:00
|
|
|
RawServoAnimationValueTableBorrowed aBaseStyles,
|
2017-04-06 04:34:51 +03:00
|
|
|
nsCSSPropertyID aProperty);
|
2017-04-26 12:41:45 +03:00
|
|
|
void Gecko_StyleTransition_SetUnsupportedProperty(
|
|
|
|
mozilla::StyleTransition* aTransition,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* aAtom);
|
2017-01-24 10:27:56 +03:00
|
|
|
|
2016-05-18 22:05:36 +03:00
|
|
|
// Atoms.
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* Gecko_Atomize(const char* aString, uint32_t aLength);
|
|
|
|
nsAtom* Gecko_Atomize16(const nsAString* aString);
|
|
|
|
void Gecko_AddRefAtom(nsAtom* aAtom);
|
|
|
|
void Gecko_ReleaseAtom(nsAtom* aAtom);
|
2016-05-18 22:05:36 +03:00
|
|
|
|
2016-06-07 22:13:24 +03:00
|
|
|
// Font style
|
|
|
|
void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
|
2017-10-03 01:05:19 +03:00
|
|
|
void Gecko_nsTArray_FontFamilyName_AppendNamed(nsTArray<FontFamilyName>* aNames, nsAtom* aName, bool aQuoted);
|
2017-10-03 07:27:45 +03:00
|
|
|
void Gecko_nsTArray_FontFamilyName_AppendGeneric(nsTArray<FontFamilyName>* aNames, FontFamilyType aType);
|
|
|
|
// Returns an already-AddRefed SharedFontList with an empty mNames array.
|
|
|
|
SharedFontList* Gecko_SharedFontList_Create();
|
|
|
|
size_t Gecko_SharedFontList_SizeOfIncludingThis(SharedFontList* fontlist);
|
|
|
|
size_t Gecko_SharedFontList_SizeOfIncludingThisIfUnshared(SharedFontList* fontlist);
|
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(mozilla::SharedFontList, SharedFontList);
|
2017-03-22 06:38:12 +03:00
|
|
|
// will not run destructors on dst, give it uninitialized memory
|
|
|
|
// font_id is LookAndFeel::FontID
|
|
|
|
void Gecko_nsFont_InitSystem(nsFont* dst, int32_t font_id,
|
|
|
|
const nsStyleFont* font, RawGeckoPresContextBorrowed pres_context);
|
|
|
|
void Gecko_nsFont_Destroy(nsFont* dst);
|
2016-06-07 22:13:24 +03:00
|
|
|
|
2017-08-31 03:08:50 +03:00
|
|
|
// The gfxFontFeatureValueSet returned from this function has zero reference.
|
|
|
|
gfxFontFeatureValueSet* Gecko_ConstructFontFeatureValueSet();
|
2017-08-24 04:05:53 +03:00
|
|
|
nsTArray<unsigned int>* Gecko_AppendFeatureValueHashEntry(
|
2017-10-03 01:05:19 +03:00
|
|
|
gfxFontFeatureValueSet* value_set, nsAtom* family, uint32_t alternate, nsAtom* name);
|
2017-08-24 04:05:53 +03:00
|
|
|
void Gecko_nsFont_SetFontFeatureValuesLookup(nsFont* font,
|
|
|
|
const RawGeckoPresContext* pres_context);
|
|
|
|
void Gecko_nsFont_ResetFontFeatureValuesLookup(nsFont* font);
|
|
|
|
|
2017-06-28 19:48:56 +03:00
|
|
|
// Font variant alternates
|
|
|
|
void Gecko_ClearAlternateValues(nsFont* font, size_t length);
|
2017-10-03 01:05:19 +03:00
|
|
|
void Gecko_AppendAlternateValues(nsFont* font, uint32_t alternate_name, nsAtom* atom);
|
2017-06-28 19:48:56 +03:00
|
|
|
void Gecko_CopyAlternateValuesFrom(nsFont* dest, const nsFont* src);
|
|
|
|
|
2017-04-11 11:32:20 +03:00
|
|
|
// Visibility style
|
|
|
|
void Gecko_SetImageOrientation(nsStyleVisibility* aVisibility,
|
2017-07-10 21:32:08 +03:00
|
|
|
uint8_t aOrientation,
|
2017-04-11 11:32:20 +03:00
|
|
|
bool aFlip);
|
|
|
|
void Gecko_SetImageOrientationAsFromImage(nsStyleVisibility* aVisibility);
|
|
|
|
void Gecko_CopyImageOrientationFrom(nsStyleVisibility* aDst,
|
|
|
|
const nsStyleVisibility* aSrc);
|
|
|
|
|
2016-05-04 03:42:40 +03:00
|
|
|
// Counter style.
|
2017-10-03 01:05:19 +03:00
|
|
|
// This function takes an already addrefed nsAtom
|
|
|
|
void Gecko_SetCounterStyleToName(mozilla::CounterStylePtr* ptr, nsAtom* name,
|
2017-06-14 09:39:47 +03:00
|
|
|
RawGeckoPresContextBorrowed pres_context);
|
2017-05-27 16:33:25 +03:00
|
|
|
void Gecko_SetCounterStyleToSymbols(mozilla::CounterStylePtr* ptr,
|
|
|
|
uint8_t symbols_type,
|
|
|
|
nsACString const* const* symbols,
|
|
|
|
uint32_t symbols_count);
|
2017-05-27 16:33:25 +03:00
|
|
|
void Gecko_SetCounterStyleToString(mozilla::CounterStylePtr* ptr,
|
|
|
|
const nsACString* symbol);
|
2017-05-27 16:33:25 +03:00
|
|
|
void Gecko_CopyCounterStyle(mozilla::CounterStylePtr* dst,
|
|
|
|
const mozilla::CounterStylePtr* src);
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* Gecko_CounterStyle_GetName(const mozilla::CounterStylePtr* ptr);
|
2017-08-29 10:11:13 +03:00
|
|
|
const mozilla::AnonymousCounterStyle*
|
|
|
|
Gecko_CounterStyle_GetAnonymous(const mozilla::CounterStylePtr* ptr);
|
2016-05-04 03:42:40 +03:00
|
|
|
|
2016-05-27 01:18:09 +03:00
|
|
|
// background-image style.
|
|
|
|
void Gecko_SetNullImageValue(nsStyleImage* image);
|
|
|
|
void Gecko_SetGradientImageValue(nsStyleImage* image, nsStyleGradient* gradient);
|
2017-04-28 16:38:27 +03:00
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(mozilla::css::ImageValue, ImageValue);
|
2018-09-11 21:11:02 +03:00
|
|
|
mozilla::css::ImageValue* Gecko_ImageValue_Create(ServoBundledURI aURI,
|
|
|
|
mozilla::CORSMode aCORSMode);
|
2017-09-14 11:48:19 +03:00
|
|
|
size_t Gecko_ImageValue_SizeOfIncludingThis(mozilla::css::ImageValue* aImageValue);
|
2017-05-02 11:20:01 +03:00
|
|
|
void Gecko_SetLayerImageImageValue(nsStyleImage* image,
|
|
|
|
mozilla::css::ImageValue* aImageValue);
|
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
void Gecko_SetImageElement(nsStyleImage* image, nsAtom* atom);
|
2016-05-27 01:18:09 +03:00
|
|
|
void Gecko_CopyImageValueFrom(nsStyleImage* image, const nsStyleImage* other);
|
2017-03-25 21:48:47 +03:00
|
|
|
void Gecko_InitializeImageCropRect(nsStyleImage* image);
|
2016-05-27 01:18:09 +03:00
|
|
|
|
|
|
|
nsStyleGradient* Gecko_CreateGradient(uint8_t shape,
|
|
|
|
uint8_t size,
|
|
|
|
bool repeating,
|
|
|
|
bool legacy_syntax,
|
2017-07-01 09:30:48 +03:00
|
|
|
bool moz_legacy_syntax,
|
2016-05-27 01:18:09 +03:00
|
|
|
uint32_t stops);
|
|
|
|
|
2018-05-16 07:01:25 +03:00
|
|
|
const nsStyleImageRequest* Gecko_GetImageRequest(const nsStyleImage* image);
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* Gecko_GetImageElement(const nsStyleImage* image);
|
2017-07-05 07:53:47 +03:00
|
|
|
const nsStyleGradient* Gecko_GetGradientImageValue(const nsStyleImage* image);
|
|
|
|
|
2016-11-03 04:40:53 +03:00
|
|
|
// list-style-image style.
|
|
|
|
void Gecko_SetListStyleImageNone(nsStyleList* style_struct);
|
2017-05-02 11:20:01 +03:00
|
|
|
void Gecko_SetListStyleImageImageValue(nsStyleList* style_struct,
|
|
|
|
mozilla::css::ImageValue* aImageValue);
|
2016-11-03 04:40:53 +03:00
|
|
|
void Gecko_CopyListStyleImageFrom(nsStyleList* dest, const nsStyleList* src);
|
|
|
|
|
2016-11-21 09:34:17 +03:00
|
|
|
// cursor style.
|
2018-08-14 11:37:37 +03:00
|
|
|
void Gecko_SetCursorArrayLength(nsStyleUI* ui, size_t len);
|
2017-05-02 11:20:01 +03:00
|
|
|
void Gecko_SetCursorImageValue(nsCursorImage* aCursor,
|
|
|
|
mozilla::css::ImageValue* aImageValue);
|
2018-08-14 11:37:37 +03:00
|
|
|
void Gecko_CopyCursorArrayFrom(nsStyleUI* dest, const nsStyleUI* src);
|
2016-11-21 09:34:17 +03:00
|
|
|
|
2017-05-02 11:20:01 +03:00
|
|
|
void Gecko_SetContentDataImageValue(nsStyleContentData* aList,
|
|
|
|
mozilla::css::ImageValue* aImageValue);
|
2017-05-22 17:32:05 +03:00
|
|
|
nsStyleContentData::CounterFunction* Gecko_SetCounterFunction(
|
2018-06-30 16:05:15 +03:00
|
|
|
nsStyleContentData* content_data, mozilla::StyleContentType);
|
2017-03-12 09:40:54 +03:00
|
|
|
|
2016-07-08 10:07:06 +03:00
|
|
|
// Dirtiness tracking.
|
2016-08-23 16:11:02 +03:00
|
|
|
void Gecko_SetNodeFlags(RawGeckoNodeBorrowed node, uint32_t flags);
|
|
|
|
void Gecko_UnsetNodeFlags(RawGeckoNodeBorrowed node, uint32_t flags);
|
2017-07-19 04:04:34 +03:00
|
|
|
void Gecko_NoteDirtyElement(RawGeckoElementBorrowed element);
|
2017-08-31 10:42:26 +03:00
|
|
|
void Gecko_NoteDirtySubtreeForInvalidation(RawGeckoElementBorrowed element);
|
2017-07-19 04:04:34 +03:00
|
|
|
void Gecko_NoteAnimationOnlyDirtyElement(RawGeckoElementBorrowed element);
|
2016-07-08 10:07:06 +03:00
|
|
|
|
2018-02-02 14:15:59 +03:00
|
|
|
bool Gecko_AnimationNameMayBeReferencedFromStyle(
|
|
|
|
RawGeckoPresContextBorrowed pres_context,
|
|
|
|
nsAtom* name);
|
|
|
|
|
2016-07-27 00:22:57 +03:00
|
|
|
// Incremental restyle.
|
2017-05-14 19:39:22 +03:00
|
|
|
mozilla::CSSPseudoElementType Gecko_GetImplementedPseudo(RawGeckoElementBorrowed element);
|
2017-08-15 04:02:01 +03:00
|
|
|
// We'd like to return `nsChangeHint` here, but bindgen bitfield enums don't
|
|
|
|
// work as return values with the Linux 32-bit ABI at the moment because
|
|
|
|
// they wrap the value in a struct.
|
2018-03-22 21:20:41 +03:00
|
|
|
uint32_t Gecko_CalcStyleDifference(ComputedStyleBorrowed old_style,
|
|
|
|
ComputedStyleBorrowed new_style,
|
2018-04-10 08:11:12 +03:00
|
|
|
bool* any_style_struct_changed,
|
2017-09-04 15:50:13 +03:00
|
|
|
bool* reset_only_changed);
|
2016-11-02 09:11:24 +03:00
|
|
|
|
2017-05-07 17:36:47 +03:00
|
|
|
// Get an element snapshot for a given element from the table.
|
|
|
|
const ServoElementSnapshot*
|
|
|
|
Gecko_GetElementSnapshot(const mozilla::ServoElementSnapshotTable* table,
|
|
|
|
RawGeckoElementBorrowed element);
|
|
|
|
|
2017-07-19 03:30:53 +03:00
|
|
|
// Have we seen this pointer before?
|
|
|
|
bool
|
|
|
|
Gecko_HaveSeenPtr(mozilla::SeenPtrs* table, const void* ptr);
|
|
|
|
|
2016-07-14 11:59:37 +03:00
|
|
|
// `array` must be an nsTArray
|
|
|
|
// If changing this signature, please update the
|
|
|
|
// friend function declaration in nsTArray.h
|
|
|
|
void Gecko_EnsureTArrayCapacity(void* array, size_t capacity, size_t elem_size);
|
|
|
|
|
2016-08-12 07:54:14 +03:00
|
|
|
// Same here, `array` must be an nsTArray<T>, for some T.
|
|
|
|
//
|
|
|
|
// Important note: Only valid for POD types, since destructors won't be run
|
|
|
|
// otherwise. This is ensured with rust traits for the relevant structs.
|
|
|
|
void Gecko_ClearPODTArray(void* array, size_t elem_size, size_t elem_align);
|
2016-07-14 11:59:48 +03:00
|
|
|
|
2017-05-18 20:56:21 +03:00
|
|
|
void Gecko_ResizeTArrayForStrings(nsTArray<nsString>* array, uint32_t length);
|
|
|
|
|
2017-08-09 04:30:25 +03:00
|
|
|
void Gecko_SetStyleGridTemplate(mozilla::UniquePtr<nsStyleGridTemplate>* grid_template,
|
|
|
|
nsStyleGridTemplate* value);
|
2017-05-18 20:56:21 +03:00
|
|
|
|
2017-08-09 04:30:25 +03:00
|
|
|
nsStyleGridTemplate* Gecko_CreateStyleGridTemplate(uint32_t track_sizes,
|
|
|
|
uint32_t name_size);
|
2017-06-11 17:17:55 +03:00
|
|
|
|
2017-08-09 04:30:25 +03:00
|
|
|
void Gecko_CopyStyleGridTemplateValues(mozilla::UniquePtr<nsStyleGridTemplate>* grid_template,
|
2017-04-08 10:17:34 +03:00
|
|
|
const nsStyleGridTemplate* other);
|
|
|
|
|
2017-05-04 13:24:01 +03:00
|
|
|
mozilla::css::GridTemplateAreasValue* Gecko_NewGridTemplateAreasValue(uint32_t areas,
|
|
|
|
uint32_t templates,
|
|
|
|
uint32_t columns);
|
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(mozilla::css::GridTemplateAreasValue, GridTemplateAreasValue);
|
|
|
|
|
2017-03-13 07:11:52 +03:00
|
|
|
// Clear the mContents, mCounterIncrements, or mCounterResets field in nsStyleContent. This is
|
|
|
|
// needed to run the destructors, otherwise we'd leak the images, strings, and whatnot.
|
2017-01-28 02:05:16 +03:00
|
|
|
void Gecko_ClearAndResizeStyleContents(nsStyleContent* content,
|
|
|
|
uint32_t how_many);
|
2017-03-13 07:11:52 +03:00
|
|
|
void Gecko_ClearAndResizeCounterIncrements(nsStyleContent* content,
|
|
|
|
uint32_t how_many);
|
|
|
|
void Gecko_ClearAndResizeCounterResets(nsStyleContent* content,
|
|
|
|
uint32_t how_many);
|
2016-08-16 22:07:17 +03:00
|
|
|
void Gecko_CopyStyleContentsFrom(nsStyleContent* content, const nsStyleContent* other);
|
2017-03-13 07:11:52 +03:00
|
|
|
void Gecko_CopyCounterResetsFrom(nsStyleContent* content, const nsStyleContent* other);
|
|
|
|
void Gecko_CopyCounterIncrementsFrom(nsStyleContent* content, const nsStyleContent* other);
|
2016-08-16 22:07:17 +03:00
|
|
|
|
2016-10-11 12:55:15 +03:00
|
|
|
void Gecko_EnsureImageLayersLength(nsStyleImageLayers* layers, size_t len,
|
|
|
|
nsStyleImageLayers::LayerType layer_type);
|
2016-07-12 11:10:39 +03:00
|
|
|
|
2017-01-06 15:45:16 +03:00
|
|
|
void Gecko_EnsureStyleAnimationArrayLength(void* array, size_t len);
|
2017-03-03 02:35:33 +03:00
|
|
|
void Gecko_EnsureStyleTransitionArrayLength(void* array, size_t len);
|
2017-01-06 15:45:16 +03:00
|
|
|
|
2017-03-19 15:36:16 +03:00
|
|
|
void Gecko_ClearWillChange(nsStyleDisplay* display, size_t length);
|
2017-10-03 01:05:19 +03:00
|
|
|
void Gecko_AppendWillChange(nsStyleDisplay* display, nsAtom* atom);
|
2017-03-19 15:36:16 +03:00
|
|
|
void Gecko_CopyWillChangeFrom(nsStyleDisplay* dest, nsStyleDisplay* src);
|
|
|
|
|
2017-05-13 10:34:38 +03:00
|
|
|
// Searches from the beginning of |keyframes| for a Keyframe object with the
|
|
|
|
// specified offset and timing function. If none is found, a new Keyframe object
|
|
|
|
// with the specified |offset| and |timingFunction| will be prepended to
|
|
|
|
// |keyframes|.
|
|
|
|
//
|
|
|
|
// @param keyframes An array of Keyframe objects, sorted by offset.
|
|
|
|
// The first Keyframe in the array, if any, MUST have an
|
|
|
|
// offset greater than or equal to |offset|.
|
|
|
|
// @param offset The offset to search for, or, if no suitable Keyframe is
|
|
|
|
// found, the offset to use for the created Keyframe.
|
|
|
|
// Must be a floating point number in the range [0.0, 1.0].
|
|
|
|
// @param timingFunction The timing function to match, or, if no suitable
|
|
|
|
// Keyframe is found, to set on the created Keyframe.
|
|
|
|
//
|
|
|
|
// @returns The matching or created Keyframe.
|
|
|
|
mozilla::Keyframe* Gecko_GetOrCreateKeyframeAtStart(
|
|
|
|
RawGeckoKeyframeListBorrowedMut keyframes,
|
|
|
|
float offset,
|
|
|
|
const nsTimingFunction* timingFunction);
|
|
|
|
|
2017-05-13 10:34:38 +03:00
|
|
|
// As with Gecko_GetOrCreateKeyframeAtStart except that this method will search
|
|
|
|
// from the beginning of |keyframes| for a Keyframe with matching timing
|
|
|
|
// function and an offset of 0.0.
|
|
|
|
// Furthermore, if a matching Keyframe is not found, a new Keyframe will be
|
|
|
|
// inserted after the *last* Keyframe in |keyframes| with offset 0.0.
|
|
|
|
mozilla::Keyframe* Gecko_GetOrCreateInitialKeyframe(
|
|
|
|
RawGeckoKeyframeListBorrowedMut keyframes,
|
|
|
|
const nsTimingFunction* timingFunction);
|
|
|
|
|
|
|
|
// As with Gecko_GetOrCreateKeyframeAtStart except that this method will search
|
|
|
|
// from the *end* of |keyframes| for a Keyframe with matching timing function
|
|
|
|
// and an offset of 1.0. If a matching Keyframe is not found, a new Keyframe
|
|
|
|
// will be appended to the end of |keyframes|.
|
|
|
|
mozilla::Keyframe* Gecko_GetOrCreateFinalKeyframe(
|
|
|
|
RawGeckoKeyframeListBorrowedMut keyframes,
|
|
|
|
const nsTimingFunction* timingFunction);
|
|
|
|
|
2017-07-20 08:38:54 +03:00
|
|
|
// Appends and returns a new PropertyValuePair to |aProperties| initialized with
|
|
|
|
// its mProperty member set to |aProperty| and all other members initialized to
|
|
|
|
// their default values.
|
|
|
|
mozilla::PropertyValuePair* Gecko_AppendPropertyValuePair(
|
|
|
|
RawGeckoPropertyValuePairListBorrowedMut aProperties,
|
|
|
|
nsCSSPropertyID aProperty);
|
|
|
|
|
2016-07-15 18:26:48 +03:00
|
|
|
// Clean up pointer-based coordinates
|
|
|
|
void Gecko_ResetStyleCoord(nsStyleUnit* unit, nsStyleUnion* value);
|
|
|
|
|
|
|
|
// Set an nsStyleCoord to a computed `calc()` value
|
|
|
|
void Gecko_SetStyleCoordCalcValue(nsStyleUnit* unit, nsStyleUnion* value, nsStyleCoord::CalcValue calc);
|
|
|
|
|
2017-04-12 15:52:38 +03:00
|
|
|
void Gecko_CopyShapeSourceFrom(mozilla::StyleShapeSource* dst, const mozilla::StyleShapeSource* src);
|
2016-08-15 18:48:11 +03:00
|
|
|
|
2017-04-12 15:52:38 +03:00
|
|
|
void Gecko_DestroyShapeSource(mozilla::StyleShapeSource* shape);
|
2017-09-25 13:50:24 +03:00
|
|
|
void Gecko_NewBasicShape(mozilla::StyleShapeSource* shape,
|
|
|
|
mozilla::StyleBasicShapeType type);
|
2017-11-17 11:34:37 +03:00
|
|
|
void Gecko_NewShapeImage(mozilla::StyleShapeSource* shape);
|
2018-03-08 07:08:13 +03:00
|
|
|
void Gecko_StyleShapeSource_SetURLValue(mozilla::StyleShapeSource* shape, mozilla::css::URLValue* uri);
|
2018-07-07 00:31:52 +03:00
|
|
|
void Gecko_NewStyleSVGPath(mozilla::StyleShapeSource* shape);
|
|
|
|
void Gecko_SetStyleMotion(mozilla::UniquePtr<mozilla::StyleMotion>* aMotion,
|
|
|
|
mozilla::StyleMotion* aValue);
|
|
|
|
mozilla::StyleMotion* Gecko_NewStyleMotion();
|
|
|
|
void Gecko_CopyStyleMotions(mozilla::UniquePtr<mozilla::StyleMotion>* motion,
|
|
|
|
const mozilla::StyleMotion* other);
|
2016-08-15 18:48:11 +03:00
|
|
|
|
2016-10-17 09:16:16 +03:00
|
|
|
void Gecko_ResetFilters(nsStyleEffects* effects, size_t new_len);
|
|
|
|
void Gecko_CopyFiltersFrom(nsStyleEffects* aSrc, nsStyleEffects* aDest);
|
2018-03-08 07:08:13 +03:00
|
|
|
void Gecko_nsStyleFilter_SetURLValue(nsStyleFilter* effects, mozilla::css::URLValue* uri);
|
2016-10-17 09:16:16 +03:00
|
|
|
|
2017-02-10 04:43:52 +03:00
|
|
|
void Gecko_nsStyleSVGPaint_CopyFrom(nsStyleSVGPaint* dest, const nsStyleSVGPaint* src);
|
2018-03-08 07:08:13 +03:00
|
|
|
void Gecko_nsStyleSVGPaint_SetURLValue(nsStyleSVGPaint* paint, mozilla::css::URLValue* uri);
|
2017-02-10 04:43:52 +03:00
|
|
|
void Gecko_nsStyleSVGPaint_Reset(nsStyleSVGPaint* paint);
|
|
|
|
|
2017-02-10 04:43:52 +03:00
|
|
|
void Gecko_nsStyleSVG_SetDashArrayLength(nsStyleSVG* svg, uint32_t len);
|
|
|
|
void Gecko_nsStyleSVG_CopyDashArray(nsStyleSVG* dst, const nsStyleSVG* src);
|
2017-05-24 04:15:47 +03:00
|
|
|
void Gecko_nsStyleSVG_SetContextPropertiesLength(nsStyleSVG* svg, uint32_t len);
|
|
|
|
void Gecko_nsStyleSVG_CopyContextProperties(nsStyleSVG* dst, const nsStyleSVG* src);
|
2017-02-10 04:43:52 +03:00
|
|
|
|
2017-02-10 04:43:52 +03:00
|
|
|
mozilla::css::URLValue* Gecko_NewURLValue(ServoBundledURI uri);
|
2018-03-08 07:08:13 +03:00
|
|
|
size_t Gecko_URLValue_SizeOfIncludingThis(mozilla::css::URLValue* url);
|
2018-05-14 13:29:40 +03:00
|
|
|
void Gecko_GetComputedURLSpec(const mozilla::css::URLValueData* url, nsCString* spec);
|
2018-06-21 14:09:35 +03:00
|
|
|
void Gecko_nsIURI_Debug(nsIURI*, nsCString* spec);
|
|
|
|
|
2017-02-10 04:43:52 +03:00
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(mozilla::css::URLValue, CSSURLValue);
|
2017-03-30 10:54:48 +03:00
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(RawGeckoURLExtraData, URLExtraData);
|
2017-02-10 04:43:52 +03:00
|
|
|
|
2017-11-20 08:44:22 +03:00
|
|
|
void Gecko_FillAllImageLayers(nsStyleImageLayers* layers, uint32_t max_len);
|
2016-07-15 18:26:48 +03:00
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsStyleCoord::Calc, Calc);
|
|
|
|
|
2016-08-28 07:41:17 +03:00
|
|
|
nsCSSShadowArray* Gecko_NewCSSShadowArray(uint32_t len);
|
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsCSSShadowArray, CSSShadowArray);
|
|
|
|
|
2016-10-13 14:45:01 +03:00
|
|
|
nsStyleQuoteValues* Gecko_NewStyleQuoteValues(uint32_t len);
|
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsStyleQuoteValues, QuoteValues);
|
|
|
|
|
2016-11-01 02:30:43 +03:00
|
|
|
nsCSSValueSharedList* Gecko_NewCSSValueSharedList(uint32_t len);
|
2017-05-19 11:09:45 +03:00
|
|
|
nsCSSValueSharedList* Gecko_NewNoneTransform();
|
2017-02-03 08:41:29 +03:00
|
|
|
|
|
|
|
// Getter for nsCSSValue
|
|
|
|
nsCSSValueBorrowedMut Gecko_CSSValue_GetArrayItem(nsCSSValueBorrowedMut css_value, int32_t index);
|
|
|
|
// const version of the above function.
|
|
|
|
nsCSSValueBorrowed Gecko_CSSValue_GetArrayItemConst(nsCSSValueBorrowed css_value, int32_t index);
|
|
|
|
nsCSSKeyword Gecko_CSSValue_GetKeyword(nsCSSValueBorrowed aCSSValue);
|
|
|
|
float Gecko_CSSValue_GetNumber(nsCSSValueBorrowed css_value);
|
|
|
|
float Gecko_CSSValue_GetPercentage(nsCSSValueBorrowed css_value);
|
|
|
|
nsStyleCoord::CalcValue Gecko_CSSValue_GetCalc(nsCSSValueBorrowed aCSSValue);
|
|
|
|
|
2016-11-01 02:30:43 +03:00
|
|
|
void Gecko_CSSValue_SetNumber(nsCSSValueBorrowedMut css_value, float number);
|
|
|
|
void Gecko_CSSValue_SetKeyword(nsCSSValueBorrowedMut css_value, nsCSSKeyword keyword);
|
|
|
|
void Gecko_CSSValue_SetPercentage(nsCSSValueBorrowedMut css_value, float percent);
|
2017-09-13 09:27:25 +03:00
|
|
|
void Gecko_CSSValue_SetPixelLength(nsCSSValueBorrowedMut aCSSValue, float aLen);
|
2016-11-01 02:30:43 +03:00
|
|
|
void Gecko_CSSValue_SetCalc(nsCSSValueBorrowedMut css_value, nsStyleCoord::CalcValue calc);
|
2018-04-23 17:52:20 +03:00
|
|
|
void Gecko_CSSValue_SetFontStretch(nsCSSValueBorrowedMut css_value, float stretch);
|
|
|
|
void Gecko_CSSValue_SetFontSlantStyle(nsCSSValueBorrowedMut css_value, float style);
|
2018-04-13 22:34:37 +03:00
|
|
|
void Gecko_CSSValue_SetFontWeight(nsCSSValueBorrowedMut css_value, float weight);
|
2016-11-01 02:30:43 +03:00
|
|
|
void Gecko_CSSValue_SetFunction(nsCSSValueBorrowedMut css_value, int32_t len);
|
2017-03-28 03:52:14 +03:00
|
|
|
void Gecko_CSSValue_SetString(nsCSSValueBorrowedMut css_value,
|
|
|
|
const uint8_t* string, uint32_t len, nsCSSUnit unit);
|
|
|
|
void Gecko_CSSValue_SetStringFromAtom(nsCSSValueBorrowedMut css_value,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* atom, nsCSSUnit unit);
|
|
|
|
// Take an addrefed nsAtom and set it to the nsCSSValue
|
|
|
|
void Gecko_CSSValue_SetAtomIdent(nsCSSValueBorrowedMut css_value, nsAtom* atom);
|
2017-02-18 02:15:55 +03:00
|
|
|
void Gecko_CSSValue_SetArray(nsCSSValueBorrowedMut css_value, int32_t len);
|
2018-03-08 07:08:13 +03:00
|
|
|
void Gecko_CSSValue_SetURL(nsCSSValueBorrowedMut css_value, mozilla::css::URLValue* uri);
|
2017-03-28 03:52:14 +03:00
|
|
|
void Gecko_CSSValue_SetInt(nsCSSValueBorrowedMut css_value, int32_t integer, nsCSSUnit unit);
|
2018-02-14 14:02:05 +03:00
|
|
|
void Gecko_CSSValue_SetFloat(nsCSSValueBorrowedMut css_value, float value, nsCSSUnit unit);
|
2017-05-09 15:36:03 +03:00
|
|
|
void Gecko_CSSValue_SetPair(nsCSSValueBorrowedMut css_value,
|
|
|
|
nsCSSValueBorrowed xvalue, nsCSSValueBorrowed yvalue);
|
2017-05-15 07:20:52 +03:00
|
|
|
void Gecko_CSSValue_SetList(nsCSSValueBorrowedMut css_value, uint32_t len);
|
|
|
|
void Gecko_CSSValue_SetPairList(nsCSSValueBorrowedMut css_value, uint32_t len);
|
2017-06-07 06:21:01 +03:00
|
|
|
void Gecko_CSSValue_InitSharedList(nsCSSValueBorrowedMut css_value, uint32_t len);
|
2017-01-15 19:07:38 +03:00
|
|
|
void Gecko_CSSValue_Drop(nsCSSValueBorrowedMut css_value);
|
2016-11-01 02:30:43 +03:00
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsCSSValueSharedList, CSSValueSharedList);
|
|
|
|
|
2018-04-23 17:52:20 +03:00
|
|
|
float Gecko_FontStretch_ToFloat(mozilla::FontStretch aStretch);
|
|
|
|
void Gecko_FontStretch_SetFloat(mozilla::FontStretch* aStretch,
|
|
|
|
float aFloatValue);
|
|
|
|
float Gecko_FontSlantStyle_ToFloat(mozilla::FontSlantStyle aStyle);
|
|
|
|
void Gecko_FontSlantStyle_SetNormal(mozilla::FontSlantStyle*);
|
|
|
|
void Gecko_FontSlantStyle_SetItalic(mozilla::FontSlantStyle*);
|
|
|
|
void Gecko_FontSlantStyle_SetOblique(mozilla::FontSlantStyle*, float angle_degrees);
|
|
|
|
void Gecko_FontSlantStyle_Get(mozilla::FontSlantStyle,
|
|
|
|
bool* normal,
|
|
|
|
bool* italic,
|
|
|
|
float* oblique_angle);
|
|
|
|
|
2018-04-13 22:34:37 +03:00
|
|
|
float Gecko_FontWeight_ToFloat(mozilla::FontWeight aWeight);
|
|
|
|
void Gecko_FontWeight_SetFloat(mozilla::FontWeight* aWeight,
|
|
|
|
float aFloatValue);
|
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
void Gecko_nsStyleFont_SetLang(nsStyleFont* font, nsAtom* atom);
|
2017-02-13 03:02:29 +03:00
|
|
|
void Gecko_nsStyleFont_CopyLangFrom(nsStyleFont* aFont, const nsStyleFont* aSource);
|
2017-04-22 02:10:50 +03:00
|
|
|
void Gecko_nsStyleFont_FixupNoneGeneric(nsStyleFont* font,
|
|
|
|
RawGeckoPresContextBorrowed pres_context);
|
2017-06-07 03:09:08 +03:00
|
|
|
void Gecko_nsStyleFont_PrefillDefaultForGeneric(nsStyleFont* font,
|
|
|
|
RawGeckoPresContextBorrowed pres_context,
|
|
|
|
uint8_t generic_id);
|
2017-05-24 04:15:47 +03:00
|
|
|
void Gecko_nsStyleFont_FixupMinFontSize(nsStyleFont* font,
|
|
|
|
RawGeckoPresContextBorrowed pres_context);
|
2017-10-03 01:05:19 +03:00
|
|
|
FontSizePrefs Gecko_GetBaseSize(nsAtom* lang);
|
2017-02-13 03:02:29 +03:00
|
|
|
|
2017-06-05 09:00:27 +03:00
|
|
|
// XBL related functions.
|
|
|
|
RawGeckoElementBorrowedOrNull Gecko_GetBindingParent(RawGeckoElementBorrowed aElement);
|
2018-02-12 15:57:26 +03:00
|
|
|
RawServoAuthorStylesBorrowedOrNull Gecko_XBLBinding_GetRawServoStyles(RawGeckoXBLBindingBorrowed aXBLBinding);
|
2017-06-05 09:00:27 +03:00
|
|
|
bool Gecko_XBLBinding_InheritsStyle(RawGeckoXBLBindingBorrowed aXBLBinding);
|
|
|
|
|
2017-04-08 01:49:44 +03:00
|
|
|
struct GeckoFontMetrics
|
|
|
|
{
|
|
|
|
nscoord mChSize;
|
|
|
|
nscoord mXSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
GeckoFontMetrics Gecko_GetFontMetrics(RawGeckoPresContextBorrowed pres_context,
|
|
|
|
bool is_vertical,
|
|
|
|
const nsStyleFont* font,
|
|
|
|
nscoord font_size,
|
|
|
|
bool use_user_font_set);
|
2017-04-25 11:29:46 +03:00
|
|
|
int32_t Gecko_GetAppUnitsPerPhysicalInch(RawGeckoPresContextBorrowed pres_context);
|
2017-04-08 01:49:44 +03:00
|
|
|
void InitializeServo();
|
|
|
|
void ShutdownServo();
|
2017-05-26 01:04:13 +03:00
|
|
|
void AssertIsMainThreadOrServoLangFontPrefsCacheLocked();
|
2017-04-08 01:49:44 +03:00
|
|
|
|
2018-04-30 18:50:03 +03:00
|
|
|
mozilla::StyleSheet* Gecko_StyleSheet_Clone(
|
|
|
|
const mozilla::StyleSheet* aSheet,
|
|
|
|
const mozilla::StyleSheet* aNewParentSheet);
|
|
|
|
void Gecko_StyleSheet_AddRef(const mozilla::StyleSheet* aSheet);
|
|
|
|
void Gecko_StyleSheet_Release(const mozilla::StyleSheet* aSheet);
|
2017-06-29 20:09:56 +03:00
|
|
|
|
2017-04-13 07:24:02 +03:00
|
|
|
nsCSSKeyword Gecko_LookupCSSKeyword(const uint8_t* string, uint32_t len);
|
|
|
|
const char* Gecko_CSSKeywordString(nsCSSKeyword keyword, uint32_t* len);
|
2017-01-15 01:33:40 +03:00
|
|
|
|
2017-09-15 23:54:59 +03:00
|
|
|
bool Gecko_IsDocumentBody(RawGeckoElementBorrowed element);
|
2017-03-16 00:49:35 +03:00
|
|
|
// We use an int32_t here instead of a LookAndFeel::ColorID
|
|
|
|
// because forward-declaring a nested enum/struct is impossible
|
|
|
|
nscolor Gecko_GetLookAndFeelSystemColor(int32_t color_id,
|
|
|
|
RawGeckoPresContextBorrowed pres_context);
|
|
|
|
|
2017-05-19 10:58:47 +03:00
|
|
|
void Gecko_AddPropertyToSet(nsCSSPropertyIDSetBorrowedMut, nsCSSPropertyID);
|
|
|
|
|
2016-04-02 03:04:59 +03:00
|
|
|
// Style-struct management.
|
2018-03-26 12:09:17 +03:00
|
|
|
#define STYLE_STRUCT(name) \
|
|
|
|
void Gecko_Construct_Default_nsStyle##name( \
|
|
|
|
nsStyle##name* ptr, \
|
|
|
|
RawGeckoPresContextBorrowed pres_context); \
|
|
|
|
void Gecko_CopyConstruct_nsStyle##name(nsStyle##name* ptr, \
|
|
|
|
const nsStyle##name* other); \
|
2016-08-19 14:44:43 +03:00
|
|
|
void Gecko_Destroy_nsStyle##name(nsStyle##name* ptr);
|
2016-04-02 03:04:59 +03:00
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
|
|
|
|
2017-04-07 17:44:41 +03:00
|
|
|
void Gecko_RegisterProfilerThread(const char* name);
|
|
|
|
void Gecko_UnregisterProfilerThread();
|
|
|
|
|
2017-04-18 19:59:43 +03:00
|
|
|
bool Gecko_DocumentRule_UseForPresentation(RawGeckoPresContextBorrowed,
|
|
|
|
const nsACString* aPattern,
|
2018-07-19 13:56:27 +03:00
|
|
|
mozilla::css::DocumentMatchingFunction);
|
2017-04-18 19:59:43 +03:00
|
|
|
|
2017-05-10 15:31:51 +03:00
|
|
|
// Allocator hinting.
|
|
|
|
void Gecko_SetJemallocThreadLocalArena(bool enabled);
|
|
|
|
|
2017-10-06 00:51:33 +03:00
|
|
|
void Gecko_AddBufferToCrashReport(const void* addr, size_t len);
|
Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant C++ functions are updated to take a typed enum. JavaScript
calls are unaffected but they will throw if the string argument does not
correspond to one of the known entries in the C++ enum. The existing whitelists
and blacklists of annotations are also generated from the YAML file and all
duplicate code related to them has been consolidated. Once written out to the
.extra file the annotations are converted in string form and are no different
than the existing ones.
All existing annotations have been included in the list (and some obsolete ones
have been removed) and all call sites have been updated including tests where
appropriate.
--HG--
extra : source : 4f6c43f2830701ec5552e08e3f1b06fe6d045860
2018-07-05 16:42:11 +03:00
|
|
|
void Gecko_AnnotateCrashReport(uint32_t key, const char* value_str);
|
2017-10-06 00:51:33 +03:00
|
|
|
|
2017-05-15 17:19:24 +03:00
|
|
|
// Pseudo-element flags.
|
|
|
|
#define CSS_PSEUDO_ELEMENT(name_, value_, flags_) \
|
|
|
|
const uint32_t SERVO_CSS_PSEUDO_ELEMENT_FLAGS_##name_ = flags_;
|
|
|
|
#include "nsCSSPseudoElementList.h"
|
|
|
|
#undef CSS_PSEUDO_ELEMENT
|
|
|
|
|
2016-08-19 14:44:43 +03:00
|
|
|
#define SERVO_BINDING_FUNC(name_, return_, ...) return_ name_(__VA_ARGS__);
|
|
|
|
#include "mozilla/ServoBindingList.h"
|
|
|
|
#undef SERVO_BINDING_FUNC
|
|
|
|
|
2018-06-05 00:05:11 +03:00
|
|
|
bool Gecko_ErrorReportingEnabled(const mozilla::StyleSheet* sheet,
|
|
|
|
const mozilla::css::Loader* loader);
|
|
|
|
void Gecko_ReportUnexpectedCSSError(const mozilla::StyleSheet* sheet,
|
|
|
|
const mozilla::css::Loader* loader,
|
|
|
|
nsIURI* uri,
|
2017-07-11 00:52:00 +03:00
|
|
|
const char* message,
|
|
|
|
const char* param,
|
|
|
|
uint32_t paramLen,
|
2017-08-01 01:40:47 +03:00
|
|
|
const char* prefix,
|
|
|
|
const char* prefixParam,
|
|
|
|
uint32_t prefixParamLen,
|
|
|
|
const char* suffix,
|
2017-07-11 00:52:00 +03:00
|
|
|
const char* source,
|
|
|
|
uint32_t sourceLen,
|
|
|
|
uint32_t lineNumber,
|
2017-08-01 01:40:47 +03:00
|
|
|
uint32_t colNumber);
|
2017-07-11 00:52:00 +03:00
|
|
|
|
2017-10-23 23:36:59 +03:00
|
|
|
// DOM APIs.
|
|
|
|
void Gecko_ContentList_AppendAll(nsSimpleContentList* aContentList,
|
|
|
|
const RawGeckoElement** aElements,
|
|
|
|
size_t aLength);
|
|
|
|
|
2018-05-25 17:56:41 +03:00
|
|
|
// FIXME(emilio): These two below should be a single function that takes a
|
|
|
|
// `const DocumentOrShadowRoot*`, but that doesn't make MSVC builds happy for a
|
|
|
|
// reason I haven't really dug into.
|
|
|
|
const nsTArray<mozilla::dom::Element*>* Gecko_Document_GetElementsWithId(
|
2018-05-28 13:17:34 +03:00
|
|
|
const nsIDocument* aDocument,
|
2017-10-27 12:45:34 +03:00
|
|
|
nsAtom* aId);
|
|
|
|
|
2018-05-25 17:56:41 +03:00
|
|
|
const nsTArray<mozilla::dom::Element*>* Gecko_ShadowRoot_GetElementsWithId(
|
|
|
|
const mozilla::dom::ShadowRoot* aDocument,
|
|
|
|
nsAtom* aId);
|
|
|
|
|
2017-12-09 05:03:34 +03:00
|
|
|
// Check the value of the given bool preference. The pref name needs to
|
|
|
|
// be null-terminated.
|
|
|
|
bool Gecko_GetBoolPrefValue(const char* pref_name);
|
|
|
|
|
2018-01-12 00:48:36 +03:00
|
|
|
// Returns true if we're currently performing the servo traversal.
|
|
|
|
bool Gecko_IsInServoTraversal();
|
|
|
|
|
|
|
|
// Returns true if we're currently on the main thread.
|
|
|
|
bool Gecko_IsMainThread();
|
|
|
|
|
2018-08-15 17:07:11 +03:00
|
|
|
// Media feature helpers.
|
|
|
|
mozilla::StyleDisplayMode Gecko_MediaFeatures_GetDisplayMode(nsIDocument*);
|
|
|
|
uint32_t Gecko_MediaFeatures_GetColorDepth(nsIDocument*);
|
|
|
|
void Gecko_MediaFeatures_GetDeviceSize(nsIDocument*, nscoord* width, nscoord* height);
|
|
|
|
float Gecko_MediaFeatures_GetResolution(nsIDocument*);
|
|
|
|
bool Gecko_MediaFeatures_PrefersReducedMotion(nsIDocument*);
|
|
|
|
float Gecko_MediaFeatures_GetDevicePixelRatio(nsIDocument*);
|
|
|
|
bool Gecko_MediaFeatures_HasSystemMetric(nsIDocument*,
|
|
|
|
nsAtom* metric,
|
|
|
|
bool is_accessible_from_content);
|
|
|
|
bool Gecko_MediaFeatures_IsResourceDocument(nsIDocument*);
|
|
|
|
nsAtom* Gecko_MediaFeatures_GetOperatingSystemVersion(nsIDocument*);
|
|
|
|
|
2015-11-25 04:14:39 +03:00
|
|
|
} // extern "C"
|
|
|
|
|
|
|
|
#endif // mozilla_ServoBindings_h
|