2016-08-19 11:44:43 +00: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/. */
|
|
|
|
|
|
|
|
/* a list of all Servo binding functions */
|
|
|
|
|
|
|
|
/* This file contains the list of all Servo binding functions. Each
|
|
|
|
* entry is defined as a SERVO_BINDING_FUNC macro with the following
|
|
|
|
* parameters:
|
|
|
|
* - 'name_' the name of the binding function
|
|
|
|
* - 'return_' the return type of the binding function
|
|
|
|
* and the parameter list of the function.
|
|
|
|
*
|
|
|
|
* Users of this list should define a macro
|
|
|
|
* SERVO_BINDING_FUNC(name_, return_, ...)
|
|
|
|
* before including this file.
|
|
|
|
*/
|
|
|
|
|
2016-11-02 06:11:24 +00:00
|
|
|
// Element data
|
|
|
|
SERVO_BINDING_FUNC(Servo_Element_ClearData, void, RawGeckoElementBorrowed node)
|
2016-08-19 11:44:43 +00:00
|
|
|
|
|
|
|
// Styleset and Stylesheet management
|
2016-10-25 17:15:38 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_Empty, RawServoStyleSheetStrong,
|
|
|
|
mozilla::css::SheetParsingMode parsing_mode)
|
2016-08-23 03:14:27 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_FromUTF8Bytes, RawServoStyleSheetStrong,
|
2016-12-17 09:58:56 +00:00
|
|
|
mozilla::css::Loader* loader,
|
|
|
|
mozilla::ServoStyleSheet* gecko_stylesheet,
|
2016-10-24 23:19:45 +00:00
|
|
|
const nsACString* data,
|
2016-08-19 11:44:43 +00:00
|
|
|
mozilla::css::SheetParsingMode parsing_mode,
|
2017-04-11 14:13:16 +00:00
|
|
|
const RawServoMediaList* media_list,
|
2017-04-25 19:01:45 +00:00
|
|
|
RawGeckoURLExtraData* extra_data,
|
2017-05-14 15:11:18 +00:00
|
|
|
uint32_t line_number_offset,
|
|
|
|
nsCompatibility quirks_mode)
|
2016-12-17 09:58:56 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_ImportRule_GetSheet,
|
|
|
|
RawServoStyleSheetStrong,
|
|
|
|
const RawServoImportRuleBorrowed import_rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_ClearAndUpdate,
|
|
|
|
void,
|
|
|
|
RawServoStyleSheetBorrowed stylesheet,
|
|
|
|
mozilla::css::Loader* loader,
|
|
|
|
mozilla::ServoStyleSheet* gecko_stylesheet,
|
|
|
|
const nsACString* data,
|
2017-04-25 19:01:45 +00:00
|
|
|
RawGeckoURLExtraData* extra_data,
|
|
|
|
uint32_t line_number_offset)
|
2016-08-23 03:14:27 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_HasRules, bool,
|
2016-08-19 11:44:43 +00:00
|
|
|
RawServoStyleSheetBorrowed sheet)
|
2016-11-22 23:26:20 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_GetRules, ServoCssRulesStrong,
|
|
|
|
RawServoStyleSheetBorrowed sheet)
|
2017-01-14 22:34:49 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSetOwned, RawGeckoPresContextOwned pres_context)
|
2017-05-15 16:02:59 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_Clear, void,
|
|
|
|
RawServoStyleSetBorrowed set)
|
2017-01-14 22:34:49 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_RebuildData, void,
|
|
|
|
RawServoStyleSetBorrowed set)
|
2016-08-23 13:11:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_Drop, void, RawServoStyleSetOwned set)
|
2016-08-23 03:10:49 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_AppendStyleSheet, void,
|
2017-05-01 23:46:41 +00:00
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawServoStyleSheetBorrowed sheet,
|
2017-05-10 18:20:57 +00:00
|
|
|
uint64_t unique_id)
|
2016-08-23 03:10:49 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_PrependStyleSheet, void,
|
2017-05-01 23:46:41 +00:00
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawServoStyleSheetBorrowed sheet,
|
2017-05-10 18:20:57 +00:00
|
|
|
uint64_t unique_id)
|
2016-08-23 03:10:49 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_RemoveStyleSheet, void,
|
2017-05-01 23:46:41 +00:00
|
|
|
RawServoStyleSetBorrowed set,
|
2017-05-10 18:20:57 +00:00
|
|
|
uint64_t unique_id)
|
2016-08-23 03:10:49 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_InsertStyleSheetBefore, void,
|
2017-05-01 23:46:41 +00:00
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawServoStyleSheetBorrowed sheet,
|
2017-05-10 18:20:57 +00:00
|
|
|
uint64_t unique_id,
|
|
|
|
uint64_t before_unique_id)
|
2016-12-21 23:33:24 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_FlushStyleSheets, void, RawServoStyleSetBorrowed set)
|
2016-12-19 06:30:14 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_NoteStyleSheetsChanged, void,
|
2017-04-11 07:59:44 +00:00
|
|
|
RawServoStyleSetBorrowed set, bool author_style_disabled)
|
2017-05-13 07:34:38 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetKeyframesForName, bool,
|
2017-01-29 03:58:28 +00:00
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
const nsACString* property,
|
2017-03-21 06:29:43 +00:00
|
|
|
nsTimingFunctionBorrowed timing_function,
|
2017-01-29 03:58:28 +00:00
|
|
|
ServoComputedValuesBorrowed computed_values,
|
|
|
|
RawGeckoKeyframeListBorrowedMut keyframe_list)
|
2017-03-27 06:53:27 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetFontFaceRules, void,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawGeckoFontFaceRuleListBorrowedMut list)
|
2017-05-11 04:47:24 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetCounterStyleRule, nsCSSCounterStyleRule*,
|
|
|
|
RawServoStyleSetBorrowed set, nsIAtom* name)
|
2017-04-14 22:37:35 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_ResolveForDeclarations,
|
|
|
|
ServoComputedValuesStrong,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
ServoComputedValuesBorrowedOrNull parent_style,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2016-08-19 11:44:43 +00:00
|
|
|
|
2016-11-22 23:26:20 +00:00
|
|
|
// CSSRuleList
|
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_ListTypes, void,
|
|
|
|
ServoCssRulesBorrowed rules,
|
|
|
|
nsTArrayBorrowed_uintptr_t result)
|
2016-11-29 11:59:55 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_InsertRule, nsresult,
|
|
|
|
ServoCssRulesBorrowed rules,
|
|
|
|
RawServoStyleSheetBorrowed sheet, const nsACString* rule,
|
2017-04-03 10:04:32 +00:00
|
|
|
uint32_t index, bool nested, mozilla::css::Loader* loader,
|
|
|
|
mozilla::ServoStyleSheet* gecko_stylesheet,
|
|
|
|
uint16_t* rule_type)
|
2016-11-29 11:59:55 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_DeleteRule, nsresult,
|
|
|
|
ServoCssRulesBorrowed rules, uint32_t index)
|
2016-11-22 23:26:20 +00:00
|
|
|
|
2016-11-22 23:26:20 +00:00
|
|
|
// CSS Rules
|
2017-05-19 06:12:34 +00:00
|
|
|
#define BASIC_RULE_FUNCS_WITHOUT_GETTER(type_) \
|
|
|
|
SERVO_BINDING_FUNC(Servo_##type_##_Debug, void, \
|
|
|
|
RawServo##type_##Borrowed rule, nsACString* result) \
|
|
|
|
SERVO_BINDING_FUNC(Servo_##type_##_GetCssText, void, \
|
|
|
|
RawServo##type_##Borrowed rule, nsAString* result)
|
2017-03-14 06:52:37 +00:00
|
|
|
#define BASIC_RULE_FUNCS(type_) \
|
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_Get##type_##RuleAt, \
|
|
|
|
RawServo##type_##RuleStrong, \
|
2017-04-25 14:24:39 +00:00
|
|
|
ServoCssRulesBorrowed rules, uint32_t index, \
|
|
|
|
uint32_t* line, uint32_t* column) \
|
2017-05-19 06:12:34 +00:00
|
|
|
BASIC_RULE_FUNCS_WITHOUT_GETTER(type_##Rule)
|
2017-04-26 07:57:57 +00:00
|
|
|
#define GROUP_RULE_FUNCS(type_) \
|
|
|
|
BASIC_RULE_FUNCS(type_) \
|
|
|
|
SERVO_BINDING_FUNC(Servo_##type_##Rule_GetRules, ServoCssRulesStrong, \
|
|
|
|
RawServo##type_##RuleBorrowed rule)
|
2017-03-14 06:52:37 +00:00
|
|
|
BASIC_RULE_FUNCS(Style)
|
2017-05-19 06:12:34 +00:00
|
|
|
BASIC_RULE_FUNCS_WITHOUT_GETTER(Keyframe)
|
|
|
|
BASIC_RULE_FUNCS(Keyframes)
|
2017-04-26 07:57:57 +00:00
|
|
|
GROUP_RULE_FUNCS(Media)
|
2017-03-14 04:44:37 +00:00
|
|
|
BASIC_RULE_FUNCS(Namespace)
|
2017-03-31 02:25:22 +00:00
|
|
|
BASIC_RULE_FUNCS(Page)
|
2017-04-26 07:59:29 +00:00
|
|
|
GROUP_RULE_FUNCS(Supports)
|
2017-05-11 12:11:16 +00:00
|
|
|
GROUP_RULE_FUNCS(Document)
|
2017-04-26 07:57:57 +00:00
|
|
|
#undef GROUP_RULE_FUNCS
|
2017-03-14 06:52:37 +00:00
|
|
|
#undef BASIC_RULE_FUNCS
|
2017-05-19 06:12:34 +00:00
|
|
|
#undef BASIC_RULE_FUNCS_WITHOUT_GETTER
|
2017-03-27 03:49:26 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_GetFontFaceRuleAt, nsCSSFontFaceRule*,
|
|
|
|
ServoCssRulesBorrowed rules, uint32_t index)
|
2017-05-15 04:18:44 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_GetCounterStyleRuleAt, nsCSSCounterStyleRule*,
|
|
|
|
ServoCssRulesBorrowed rules, uint32_t index)
|
2016-11-22 23:26:20 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_GetStyle, RawServoDeclarationBlockStrong,
|
|
|
|
RawServoStyleRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_SetStyle, void,
|
|
|
|
RawServoStyleRuleBorrowed rule,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2016-11-22 23:26:20 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_GetSelectorText, void,
|
|
|
|
RawServoStyleRuleBorrowed rule, nsAString* result)
|
2017-05-19 06:12:34 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_Keyframe_GetKeyText, void,
|
|
|
|
RawServoKeyframeBorrowed keyframe, nsAString* result)
|
|
|
|
// Returns whether it successfully changes the key text.
|
|
|
|
SERVO_BINDING_FUNC(Servo_Keyframe_SetKeyText, bool,
|
|
|
|
RawServoKeyframeBorrowed keyframe, const nsACString* text)
|
|
|
|
SERVO_BINDING_FUNC(Servo_Keyframe_GetStyle, RawServoDeclarationBlockStrong,
|
|
|
|
RawServoKeyframeBorrowed keyframe)
|
|
|
|
SERVO_BINDING_FUNC(Servo_Keyframe_SetStyle, void,
|
|
|
|
RawServoKeyframeBorrowed keyframe,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_GetName, nsIAtom*,
|
|
|
|
RawServoKeyframesRuleBorrowed rule)
|
2017-05-21 19:55:08 +00:00
|
|
|
// This method takes an addrefed nsIAtom.
|
2017-05-19 06:12:34 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_SetName, void,
|
2017-05-21 19:55:08 +00:00
|
|
|
RawServoKeyframesRuleBorrowed rule, nsIAtom* name)
|
2017-05-19 06:12:34 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_GetCount, uint32_t,
|
|
|
|
RawServoKeyframesRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_GetKeyframe, RawServoKeyframeStrong,
|
|
|
|
RawServoKeyframesRuleBorrowed rule, uint32_t index)
|
|
|
|
// Returns the index of the rule, max value of uint32_t if nothing found.
|
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_FindRule, uint32_t,
|
|
|
|
RawServoKeyframesRuleBorrowed rule, const nsACString* key)
|
|
|
|
// Returns whether it successfully appends the rule.
|
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_AppendRule, bool,
|
|
|
|
RawServoKeyframesRuleBorrowed rule,
|
|
|
|
RawServoStyleSheetBorrowed sheet, const nsACString* css)
|
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_DeleteRule, void,
|
|
|
|
RawServoKeyframesRuleBorrowed rule, uint32_t index)
|
2017-03-09 04:10:11 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaRule_GetMedia, RawServoMediaListStrong,
|
|
|
|
RawServoMediaRuleBorrowed rule)
|
2017-03-14 04:44:37 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_NamespaceRule_GetPrefix, nsIAtom*,
|
|
|
|
RawServoNamespaceRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_NamespaceRule_GetURI, nsIAtom*,
|
|
|
|
RawServoNamespaceRuleBorrowed rule)
|
2017-03-31 02:25:22 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_PageRule_GetStyle, RawServoDeclarationBlockStrong,
|
|
|
|
RawServoPageRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_PageRule_SetStyle, void,
|
|
|
|
RawServoPageRuleBorrowed rule,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2017-04-26 07:59:29 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_SupportsRule_GetConditionText, void,
|
|
|
|
RawServoSupportsRuleBorrowed rule, nsAString* result)
|
2017-05-11 12:11:16 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DocumentRule_GetConditionText, void,
|
|
|
|
RawServoDocumentRuleBorrowed rule, nsAString* result)
|
2016-11-22 23:26:20 +00:00
|
|
|
|
2016-09-16 01:24:05 +00:00
|
|
|
// Animations API
|
|
|
|
SERVO_BINDING_FUNC(Servo_ParseProperty,
|
2016-10-18 04:29:03 +00:00
|
|
|
RawServoDeclarationBlockStrong,
|
2017-04-14 22:37:34 +00:00
|
|
|
nsCSSPropertyID property, const nsACString* value,
|
2017-05-10 23:29:36 +00:00
|
|
|
RawGeckoURLExtraData* data,
|
2017-05-14 15:11:18 +00:00
|
|
|
mozilla::ParsingMode parsing_mode,
|
|
|
|
nsCompatibility quirks_mode)
|
2017-03-21 06:27:46 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_ParseEasing, bool,
|
|
|
|
const nsAString* easing,
|
2017-03-30 07:54:48 +00:00
|
|
|
RawGeckoURLExtraData* data,
|
2017-03-21 06:27:46 +00:00
|
|
|
nsTimingFunctionBorrowedMut output)
|
2017-02-23 00:52:43 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetComputedKeyframeValues, void,
|
|
|
|
RawGeckoKeyframeListBorrowed keyframes,
|
|
|
|
ServoComputedValuesBorrowed style,
|
|
|
|
ServoComputedValuesBorrowedOrNull parent_style,
|
2017-03-11 01:40:47 +00:00
|
|
|
RawServoStyleSetBorrowed set,
|
2017-02-23 00:52:43 +00:00
|
|
|
RawGeckoComputedKeyframeValuesListBorrowedMut result)
|
2017-03-17 04:23:21 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValueMap_Push, void,
|
2017-05-01 09:45:41 +00:00
|
|
|
RawServoAnimationValueMapBorrowedMut,
|
2017-03-17 04:23:21 +00:00
|
|
|
nsCSSPropertyID property,
|
|
|
|
RawServoAnimationValueBorrowed value)
|
2017-04-06 01:34:50 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_ExtractAnimationValue,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
ServoComputedValuesBorrowed computed_values,
|
|
|
|
nsCSSPropertyID property)
|
2017-04-12 08:37:09 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_IsAnimatable, bool,
|
|
|
|
nsCSSPropertyID property)
|
2017-04-12 08:31:12 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_IsDiscreteAnimatable, bool,
|
|
|
|
nsCSSPropertyID property)
|
2017-05-19 07:58:47 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetProperties_Overriding_Animation, void,
|
|
|
|
RawGeckoElementBorrowed,
|
|
|
|
RawGeckoCSSPropertyIDListBorrowed,
|
|
|
|
nsCSSPropertyIDSetBorrowedMut)
|
2016-09-16 01:24:05 +00:00
|
|
|
|
2016-12-01 01:34:54 +00:00
|
|
|
// AnimationValues handling
|
2017-01-24 07:21:52 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_Interpolate,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
RawServoAnimationValueBorrowed from,
|
|
|
|
RawServoAnimationValueBorrowed to,
|
|
|
|
double progress)
|
2017-04-12 08:26:59 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_IsInterpolable, bool,
|
|
|
|
RawServoAnimationValueBorrowed from,
|
|
|
|
RawServoAnimationValueBorrowed to)
|
2017-04-21 03:31:41 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_ComputeDistance, double,
|
|
|
|
RawServoAnimationValueBorrowed from,
|
|
|
|
RawServoAnimationValueBorrowed to)
|
2017-02-09 03:33:17 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_Serialize, void,
|
|
|
|
RawServoAnimationValueBorrowed value,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
nsAString* buffer)
|
2017-02-10 04:03:08 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_GetOpacity, float,
|
2017-02-08 03:31:15 +00:00
|
|
|
RawServoAnimationValueBorrowed value)
|
2017-02-10 04:03:08 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_GetTransform, void,
|
2017-02-08 03:36:41 +00:00
|
|
|
RawServoAnimationValueBorrowed value,
|
|
|
|
RefPtr<nsCSSValueSharedList>* list)
|
2017-02-24 07:05:23 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_DeepEqual, bool,
|
|
|
|
RawServoAnimationValueBorrowed,
|
|
|
|
RawServoAnimationValueBorrowed)
|
2017-04-12 07:51:55 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_Uncompute,
|
|
|
|
RawServoDeclarationBlockStrong,
|
|
|
|
RawServoAnimationValueBorrowed value)
|
2017-05-03 03:15:27 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_Compute,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
ServoComputedValuesBorrowed style,
|
|
|
|
ServoComputedValuesBorrowedOrNull parent_style,
|
|
|
|
RawServoStyleSetBorrowed raw_data)
|
2016-12-01 01:34:54 +00:00
|
|
|
|
2016-08-19 11:44:43 +00:00
|
|
|
// Style attribute
|
2016-10-18 04:29:03 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_ParseStyleAttribute, RawServoDeclarationBlockStrong,
|
2017-03-11 02:28:02 +00:00
|
|
|
const nsACString* data,
|
2017-05-05 22:12:03 +00:00
|
|
|
RawGeckoURLExtraData* extra_data,
|
|
|
|
nsCompatibility quirks_mode)
|
2016-11-03 03:41:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_CreateEmpty,
|
|
|
|
RawServoDeclarationBlockStrong)
|
2016-11-03 03:41:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_Clone, RawServoDeclarationBlockStrong,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2016-09-15 07:26:07 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_Equals, bool,
|
2016-10-18 04:29:03 +00:00
|
|
|
RawServoDeclarationBlockBorrowed a,
|
|
|
|
RawServoDeclarationBlockBorrowed b)
|
2016-11-03 03:41:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetCssText, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsAString* result)
|
2016-09-16 00:26:48 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SerializeOneValue, void,
|
2016-10-18 04:29:03 +00:00
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2016-12-15 23:02:48 +00:00
|
|
|
nsCSSPropertyID property, nsAString* buffer)
|
2016-11-03 03:41:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_Count, uint32_t,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetNthProperty, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
uint32_t index, nsAString* result)
|
2016-11-03 03:41:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetPropertyValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2016-12-15 23:02:48 +00:00
|
|
|
const nsACString* property, nsAString* value)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetPropertyValueById, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property, nsAString* value)
|
2016-11-03 03:41:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetPropertyIsImportant, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2016-12-15 23:02:48 +00:00
|
|
|
const nsACString* property)
|
2016-11-03 03:41:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetProperty, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2016-12-15 23:02:48 +00:00
|
|
|
const nsACString* property,
|
2017-02-23 01:19:04 +00:00
|
|
|
const nsACString* value, bool is_important,
|
2017-04-14 03:55:44 +00:00
|
|
|
RawGeckoURLExtraData* data,
|
2017-05-14 15:11:18 +00:00
|
|
|
mozilla::ParsingMode parsing_mode,
|
|
|
|
nsCompatibility quirks_mode)
|
2016-12-15 23:02:48 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetPropertyById, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
2017-02-23 01:19:04 +00:00
|
|
|
const nsACString* value, bool is_important,
|
2017-04-14 03:55:44 +00:00
|
|
|
RawGeckoURLExtraData* data,
|
2017-05-14 15:11:18 +00:00
|
|
|
mozilla::ParsingMode parsing_mode,
|
|
|
|
nsCompatibility quirks_mode)
|
2016-11-03 03:41:02 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemoveProperty, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2016-12-15 23:02:48 +00:00
|
|
|
const nsACString* property)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemovePropertyById, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property)
|
2017-04-14 22:37:34 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_HasCSSWideKeyword, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property)
|
2017-04-06 01:34:51 +00:00
|
|
|
// Compose animation value for a given property.
|
|
|
|
// |base_values| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.
|
|
|
|
// We use void* to avoid exposing nsRefPtrHashtable in FFI.
|
2017-04-06 01:34:51 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationCompose, void,
|
2017-05-01 09:45:41 +00:00
|
|
|
RawServoAnimationValueMapBorrowedMut animation_values,
|
2017-04-06 01:34:51 +00:00
|
|
|
void* base_values,
|
2017-04-06 01:34:51 +00:00
|
|
|
nsCSSPropertyID property,
|
2017-04-06 01:34:51 +00:00
|
|
|
RawGeckoAnimationPropertySegmentBorrowed animation_segment,
|
|
|
|
RawGeckoComputedTimingBorrowed computed_timing)
|
2017-02-13 00:02:29 +00:00
|
|
|
|
|
|
|
// presentation attributes
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_PropertyIsSet, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetIdentStringValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
2017-02-13 00:02:29 +00:00
|
|
|
nsIAtom* value)
|
2017-02-13 00:02:29 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetKeywordValue, void,
|
2017-01-19 23:56:53 +00:00
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
2017-02-13 00:02:29 +00:00
|
|
|
int32_t value)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetIntValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
int32_t value)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetPixelValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
float value)
|
2017-04-10 07:28:48 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetLengthValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
float value,
|
|
|
|
nsCSSUnit unit)
|
2017-04-10 07:28:48 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetNumberValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
float value)
|
2017-02-13 00:02:29 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetPercentValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
float value)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetAutoValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetCurrentColor, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetColorValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
nscolor value)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetFontFamily, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
const nsAString& value)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetTextDecorationColorOverride, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2017-04-10 07:28:48 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetBackgroundImage, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
const nsAString& value,
|
|
|
|
RawGeckoURLExtraData* extra_data)
|
2016-08-19 11:44:43 +00:00
|
|
|
|
2017-03-09 06:56:31 +00:00
|
|
|
// MediaList
|
2017-04-10 00:01:38 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_Create, RawServoMediaListStrong)
|
2017-04-10 06:36:45 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_DeepClone, RawServoMediaListStrong,
|
|
|
|
RawServoMediaListBorrowed list)
|
2017-04-10 02:25:33 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_Matches, bool,
|
|
|
|
RawServoMediaListBorrowed list,
|
|
|
|
RawServoStyleSetBorrowed set)
|
2017-03-09 06:56:31 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_GetText, void,
|
|
|
|
RawServoMediaListBorrowed list, nsAString* result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_SetText, void,
|
|
|
|
RawServoMediaListBorrowed list, const nsACString* text)
|
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_GetLength, uint32_t,
|
|
|
|
RawServoMediaListBorrowed list)
|
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_GetMediumAt, bool,
|
|
|
|
RawServoMediaListBorrowed list, uint32_t index,
|
|
|
|
nsAString* result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_AppendMedium, void,
|
|
|
|
RawServoMediaListBorrowed list, const nsACString* new_medium)
|
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_DeleteMedium, bool,
|
|
|
|
RawServoMediaListBorrowed list, const nsACString* old_medium)
|
|
|
|
|
2016-08-19 11:44:43 +00:00
|
|
|
// CSS supports()
|
2017-01-16 07:09:42 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_CSSSupports2, bool,
|
2016-10-24 23:19:45 +00:00
|
|
|
const nsACString* name, const nsACString* value)
|
2017-01-16 07:09:42 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_CSSSupports, bool,
|
|
|
|
const nsACString* cond)
|
2016-08-19 11:44:43 +00:00
|
|
|
|
|
|
|
// Computed style data
|
2016-08-23 03:14:27 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_GetForAnonymousBox,
|
2016-08-19 11:44:43 +00:00
|
|
|
ServoComputedValuesStrong,
|
2016-08-23 13:11:02 +00:00
|
|
|
ServoComputedValuesBorrowedOrNull parent_style_or_null,
|
2017-05-14 16:39:22 +00:00
|
|
|
nsIAtom* pseudo_tag, bool skip_display_fixup,
|
2017-03-13 16:53:45 +00:00
|
|
|
RawServoStyleSetBorrowed set)
|
2016-08-23 03:14:27 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_Inherit, ServoComputedValuesStrong,
|
2017-01-04 19:52:27 +00:00
|
|
|
RawServoStyleSetBorrowed set,
|
2017-04-28 11:10:00 +00:00
|
|
|
ServoComputedValuesBorrowedOrNull parent_style,
|
|
|
|
mozilla::InheritTarget target)
|
2016-08-19 11:44:43 +00:00
|
|
|
|
|
|
|
// Initialize Servo components. Should be called exactly once at startup.
|
2017-04-04 03:21:16 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_Initialize, void,
|
|
|
|
RawGeckoURLExtraData* dummy_url_data)
|
2016-08-19 11:44:43 +00:00
|
|
|
// Shut down Servo components. Should be called exactly once at shutdown.
|
|
|
|
SERVO_BINDING_FUNC(Servo_Shutdown, void)
|
|
|
|
|
2017-04-06 17:19:00 +00:00
|
|
|
// Gets the source style rules for the element. This returns the result via
|
|
|
|
// rules, which would include a list of unowned pointers to RawServoStyleRule.
|
|
|
|
SERVO_BINDING_FUNC(Servo_Element_GetStyleRuleList, void,
|
|
|
|
RawGeckoElementBorrowed element,
|
|
|
|
RawGeckoServoStyleRuleListBorrowedMut rules)
|
|
|
|
|
2016-11-02 06:11:24 +00:00
|
|
|
// Restyle and change hints.
|
|
|
|
SERVO_BINDING_FUNC(Servo_NoteExplicitHints, void, RawGeckoElementBorrowed element,
|
|
|
|
nsRestyleHint restyle_hint, nsChangeHint change_hint)
|
2017-01-05 21:12:53 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_TakeChangeHint, nsChangeHint, RawGeckoElementBorrowed element)
|
2016-11-02 06:11:24 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_ResolveStyle, ServoComputedValuesStrong,
|
2017-01-04 19:52:27 +00:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-03-28 07:31:41 +00:00
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
bool allow_stale)
|
2016-12-22 01:58:38 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_ResolvePseudoStyle, ServoComputedValuesStrong,
|
2017-05-14 16:39:22 +00:00
|
|
|
RawGeckoElementBorrowed element,
|
|
|
|
mozilla::CSSPseudoElementType pseudo_type,
|
2016-12-22 01:58:38 +00:00
|
|
|
bool is_probe, RawServoStyleSetBorrowed set)
|
2017-05-10 20:11:36 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_HasAuthorSpecifiedRules, bool,
|
|
|
|
RawGeckoElementBorrowed element,
|
|
|
|
uint32_t rule_type_mask,
|
|
|
|
bool author_colors_allowed)
|
2016-08-19 11:44:43 +00:00
|
|
|
|
2016-12-28 07:49:12 +00:00
|
|
|
// Resolves style for an element or pseudo-element without processing pending
|
|
|
|
// restyles first. The Element and its ancestors may be unstyled, have pending
|
|
|
|
// restyles, or be in a display:none subtree. Styles are cached when possible,
|
|
|
|
// though caching is not possible within display:none subtrees, and the styles
|
|
|
|
// may be invalidated by already-scheduled restyles.
|
|
|
|
//
|
|
|
|
// The tree must be in a consistent state such that a normal traversal could be
|
|
|
|
// performed, and this function maintains that invariant.
|
|
|
|
SERVO_BINDING_FUNC(Servo_ResolveStyleLazily, ServoComputedValuesStrong,
|
2017-05-07 14:36:47 +00:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-05-14 16:39:22 +00:00
|
|
|
mozilla::CSSPseudoElementType pseudo_type,
|
2017-05-07 14:36:47 +00:00
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots,
|
2016-12-28 07:49:12 +00:00
|
|
|
RawServoStyleSetBorrowed set)
|
|
|
|
|
2017-01-19 23:56:53 +00:00
|
|
|
// Use ServoStyleSet::PrepareAndTraverseSubtree instead of calling this
|
|
|
|
// directly
|
2017-05-07 14:36:47 +00:00
|
|
|
SERVO_BINDING_FUNC(Servo_TraverseSubtree,
|
|
|
|
bool,
|
|
|
|
RawGeckoElementBorrowed root,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots,
|
2017-04-08 14:57:08 +00:00
|
|
|
mozilla::TraversalRootBehavior root_behavior,
|
|
|
|
mozilla::TraversalRestyleBehavior restyle_behavior)
|
2016-11-02 06:11:24 +00:00
|
|
|
|
|
|
|
// Assert that the tree has no pending or unconsumed restyles.
|
|
|
|
SERVO_BINDING_FUNC(Servo_AssertTreeIsClean, void, RawGeckoElementBorrowed root)
|
2016-08-19 11:44:43 +00:00
|
|
|
|
2017-04-06 01:34:50 +00:00
|
|
|
// Returns computed values for the given element without any animations rules.
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetBaseComputedValuesForElement,
|
|
|
|
ServoComputedValuesStrong,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawGeckoElementBorrowed element,
|
2017-05-07 14:36:47 +00:00
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots,
|
2017-05-14 16:39:22 +00:00
|
|
|
mozilla::CSSPseudoElementType pseudo_type)
|
2017-04-06 01:34:50 +00:00
|
|
|
|
2017-05-19 22:38:26 +00:00
|
|
|
// For canvas font.
|
|
|
|
SERVO_BINDING_FUNC(Servo_SerializeFontValueForCanvas, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsAString* buffer)
|
|
|
|
|
2016-08-19 11:44:43 +00:00
|
|
|
// Style-struct management.
|
|
|
|
#define STYLE_STRUCT(name, checkdata_cb) \
|
|
|
|
struct nsStyle##name; \
|
|
|
|
SERVO_BINDING_FUNC(Servo_GetStyle##name, const nsStyle##name*, \
|
2016-10-06 15:28:01 +00:00
|
|
|
ServoComputedValuesBorrowedOrNull computed_values)
|
2016-08-19 11:44:43 +00:00
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
2016-11-23 00:35:55 +00:00
|
|
|
|
|
|
|
// AddRef / Release functions
|
|
|
|
#define SERVO_ARC_TYPE(name_, type_) \
|
|
|
|
SERVO_BINDING_FUNC(Servo_##name_##_AddRef, void, type_##Borrowed) \
|
|
|
|
SERVO_BINDING_FUNC(Servo_##name_##_Release, void, type_##Borrowed)
|
|
|
|
#include "mozilla/ServoArcTypeList.h"
|
|
|
|
#undef SERVO_ARC_TYPE
|