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-07-19 04:02:55 +03:00
|
|
|
#include "mozilla/ServoElementSnapshot.h"
|
2016-04-28 02:15:56 +03:00
|
|
|
#include "mozilla/css/SheetParsingMode.h"
|
2016-07-19 04:02:55 +03:00
|
|
|
#include "nsChangeHint.h"
|
|
|
|
#include "nsColor.h"
|
2016-05-21 03:02:54 +03:00
|
|
|
#include "nsProxyRelease.h"
|
2016-07-19 04:02:55 +03:00
|
|
|
#include "nsStyleCoord.h"
|
|
|
|
#include "nsStyleStruct.h"
|
|
|
|
#include "stdint.h"
|
2015-11-25 04:14:39 +03:00
|
|
|
|
2016-08-16 08:10:05 +03:00
|
|
|
#define DECL_STRONG_REF_TYPE(name, T) \
|
2016-08-16 08:08:46 +03:00
|
|
|
struct MOZ_MUST_USE_TYPE name { \
|
|
|
|
T* mPtr; \
|
|
|
|
already_AddRefed<T> Consume(); \
|
|
|
|
}
|
|
|
|
|
2016-08-16 08:10:05 +03:00
|
|
|
#define DECL_BORROWED_REF_TYPE(name, T) \
|
|
|
|
struct name { \
|
|
|
|
T* mPtr; \
|
|
|
|
MOZ_IMPLICIT \
|
|
|
|
name(T* x): mPtr(x) {}; \
|
|
|
|
MOZ_IMPLICIT \
|
|
|
|
name(const RefPtr<T>& aPtr) : mPtr(aPtr.get()) {}; \
|
|
|
|
operator T*() const & { \
|
|
|
|
return mPtr; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2015-11-25 04:14:39 +03:00
|
|
|
/*
|
|
|
|
* API for Servo to access Gecko data structures. This file must compile as valid
|
|
|
|
* C code in order for the binding generator to parse it.
|
|
|
|
*
|
|
|
|
* Functions beginning with Gecko_ are implemented in Gecko and invoked from Servo.
|
|
|
|
* Functions beginning with Servo_ are implemented in Servo and invoked from Gecko.
|
|
|
|
*/
|
|
|
|
|
2016-03-18 23:14:07 +03:00
|
|
|
class nsIAtom;
|
2015-11-25 04:14:39 +03:00
|
|
|
class nsINode;
|
|
|
|
typedef nsINode RawGeckoNode;
|
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;
|
|
|
|
enum FontFamilyType : uint32_t;
|
|
|
|
namespace dom { class Element; }
|
|
|
|
}
|
|
|
|
using mozilla::FontFamilyList;
|
|
|
|
using mozilla::FontFamilyType;
|
2015-11-25 04:14:39 +03:00
|
|
|
using mozilla::dom::Element;
|
2016-07-19 04:02:55 +03:00
|
|
|
using mozilla::ServoElementSnapshot;
|
2015-11-25 04:14:39 +03:00
|
|
|
typedef mozilla::dom::Element RawGeckoElement;
|
|
|
|
class nsIDocument;
|
|
|
|
typedef nsIDocument RawGeckoDocument;
|
2016-02-24 04:28:50 +03:00
|
|
|
struct ServoNodeData;
|
2016-03-19 02:56:47 +03:00
|
|
|
struct ServoComputedValues;
|
2016-08-16 08:10:05 +03:00
|
|
|
DECL_STRONG_REF_TYPE(ServoComputedValuesStrong, ServoComputedValues);
|
|
|
|
DECL_BORROWED_REF_TYPE(ServoComputedValuesBorrowed, ServoComputedValues);
|
2016-02-26 04:51:01 +03:00
|
|
|
struct RawServoStyleSheet;
|
2016-08-16 08:10:05 +03:00
|
|
|
DECL_STRONG_REF_TYPE(RawServoStyleSheetStrong, RawServoStyleSheet);
|
|
|
|
DECL_BORROWED_REF_TYPE(RawServoStyleSheetBorrowed, RawServoStyleSheet);
|
2016-01-27 05:02:04 +03:00
|
|
|
struct RawServoStyleSet;
|
2016-06-24 06:35:12 +03:00
|
|
|
class nsHTMLCSSStyleSheet;
|
2016-05-27 01:18:09 +03:00
|
|
|
struct nsStyleList;
|
|
|
|
struct nsStyleImage;
|
|
|
|
struct nsStyleGradientStop;
|
|
|
|
class nsStyleGradient;
|
|
|
|
class nsStyleCoord;
|
|
|
|
struct nsStyleDisplay;
|
2016-06-24 06:35:12 +03:00
|
|
|
struct ServoDeclarationBlock;
|
2015-11-25 04:14:39 +03:00
|
|
|
|
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); }
|
|
|
|
|
|
|
|
#define NS_DECL_HOLDER_FFI_REFCOUNTING(class_, name_) \
|
|
|
|
typedef nsMainThreadPtrHolder<class_> ThreadSafe##name_##Holder; \
|
|
|
|
void Gecko_AddRef##name_##ArbitraryThread(ThreadSafe##name_##Holder* aPtr); \
|
|
|
|
void Gecko_Release##name_##ArbitraryThread(ThreadSafe##name_##Holder* aPtr);
|
|
|
|
#define NS_IMPL_HOLDER_FFI_REFCOUNTING(class_, name_) \
|
|
|
|
void Gecko_AddRef##name_##ArbitraryThread(ThreadSafe##name_##Holder* aPtr) \
|
|
|
|
{ NS_ADDREF(aPtr); } \
|
|
|
|
void Gecko_Release##name_##ArbitraryThread(ThreadSafe##name_##Holder* aPtr) \
|
|
|
|
{ NS_RELEASE(aPtr); } \
|
|
|
|
|
2015-11-25 04:14:39 +03:00
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
// DOM Traversal.
|
|
|
|
uint32_t Gecko_ChildrenCount(RawGeckoNode* node);
|
2016-03-03 07:27:07 +03:00
|
|
|
bool Gecko_NodeIsElement(RawGeckoNode* node);
|
2015-11-25 04:14:39 +03:00
|
|
|
RawGeckoNode* Gecko_GetParentNode(RawGeckoNode* node);
|
|
|
|
RawGeckoNode* Gecko_GetFirstChild(RawGeckoNode* node);
|
|
|
|
RawGeckoNode* Gecko_GetLastChild(RawGeckoNode* node);
|
|
|
|
RawGeckoNode* Gecko_GetPrevSibling(RawGeckoNode* node);
|
|
|
|
RawGeckoNode* Gecko_GetNextSibling(RawGeckoNode* node);
|
|
|
|
RawGeckoElement* Gecko_GetParentElement(RawGeckoElement* element);
|
|
|
|
RawGeckoElement* Gecko_GetFirstChildElement(RawGeckoElement* element);
|
|
|
|
RawGeckoElement* Gecko_GetLastChildElement(RawGeckoElement* element);
|
|
|
|
RawGeckoElement* Gecko_GetPrevSiblingElement(RawGeckoElement* element);
|
|
|
|
RawGeckoElement* Gecko_GetNextSiblingElement(RawGeckoElement* element);
|
|
|
|
RawGeckoElement* Gecko_GetDocumentElement(RawGeckoDocument* document);
|
|
|
|
|
|
|
|
// Selector Matching.
|
2016-02-24 04:51:47 +03:00
|
|
|
uint8_t Gecko_ElementState(RawGeckoElement* element);
|
2016-03-03 07:27:07 +03:00
|
|
|
bool Gecko_IsHTMLElementInHTMLDocument(RawGeckoElement* element);
|
|
|
|
bool Gecko_IsLink(RawGeckoElement* element);
|
|
|
|
bool Gecko_IsTextNode(RawGeckoNode* node);
|
|
|
|
bool Gecko_IsVisitedLink(RawGeckoElement* element);
|
|
|
|
bool Gecko_IsUnvisitedLink(RawGeckoElement* element);
|
|
|
|
bool Gecko_IsRootElement(RawGeckoElement* element);
|
2016-05-18 22:05:36 +03:00
|
|
|
nsIAtom* Gecko_LocalName(RawGeckoElement* element);
|
|
|
|
nsIAtom* Gecko_Namespace(RawGeckoElement* element);
|
2016-05-25 21:16:26 +03:00
|
|
|
nsIAtom* Gecko_GetElementId(RawGeckoElement* element);
|
|
|
|
|
2016-06-30 23:37:52 +03:00
|
|
|
// Attributes.
|
2016-07-19 04:02:55 +03:00
|
|
|
#define SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(prefix_, implementor_) \
|
|
|
|
nsIAtom* prefix_##AtomAttrValue(implementor_* element, nsIAtom* attribute); \
|
|
|
|
bool prefix_##HasAttr(implementor_* element, nsIAtom* ns, nsIAtom* name); \
|
|
|
|
bool prefix_##AttrEquals(implementor_* element, nsIAtom* ns, nsIAtom* name, \
|
|
|
|
nsIAtom* str, bool ignoreCase); \
|
|
|
|
bool prefix_##AttrDashEquals(implementor_* element, nsIAtom* ns, \
|
|
|
|
nsIAtom* name, nsIAtom* str); \
|
|
|
|
bool prefix_##AttrIncludes(implementor_* element, nsIAtom* ns, \
|
|
|
|
nsIAtom* name, nsIAtom* str); \
|
|
|
|
bool prefix_##AttrHasSubstring(implementor_* element, nsIAtom* ns, \
|
|
|
|
nsIAtom* name, nsIAtom* str); \
|
|
|
|
bool prefix_##AttrHasPrefix(implementor_* element, nsIAtom* ns, \
|
|
|
|
nsIAtom* name, nsIAtom* str); \
|
|
|
|
bool prefix_##AttrHasSuffix(implementor_* element, nsIAtom* ns, \
|
|
|
|
nsIAtom* name, nsIAtom* str); \
|
|
|
|
uint32_t prefix_##ClassOrClassList(implementor_* element, nsIAtom** class_, \
|
|
|
|
nsIAtom*** classList);
|
|
|
|
|
|
|
|
SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_, RawGeckoElement)
|
|
|
|
SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_Snapshot,
|
|
|
|
ServoElementSnapshot)
|
|
|
|
|
|
|
|
#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.
|
|
|
|
ServoDeclarationBlock* Gecko_GetServoDeclarationBlock(RawGeckoElement* element);
|
|
|
|
|
2016-02-24 04:28:50 +03:00
|
|
|
// Node data.
|
|
|
|
ServoNodeData* Gecko_GetNodeData(RawGeckoNode* node);
|
|
|
|
void Gecko_SetNodeData(RawGeckoNode* node, ServoNodeData* data);
|
|
|
|
void Servo_DropNodeData(ServoNodeData* data);
|
|
|
|
|
2016-05-18 22:05:36 +03:00
|
|
|
// Atoms.
|
|
|
|
nsIAtom* Gecko_Atomize(const char* aString, uint32_t aLength);
|
|
|
|
void Gecko_AddRefAtom(nsIAtom* aAtom);
|
|
|
|
void Gecko_ReleaseAtom(nsIAtom* aAtom);
|
|
|
|
const uint16_t* Gecko_GetAtomAsUTF16(nsIAtom* aAtom, uint32_t* aLength);
|
|
|
|
bool Gecko_AtomEqualsUTF8(nsIAtom* aAtom, const char* aString, uint32_t aLength);
|
|
|
|
bool Gecko_AtomEqualsUTF8IgnoreCase(nsIAtom* aAtom, const char* aString, uint32_t aLength);
|
|
|
|
|
2016-06-07 22:13:24 +03:00
|
|
|
// Font style
|
|
|
|
void Gecko_FontFamilyList_Clear(FontFamilyList* aList);
|
|
|
|
void Gecko_FontFamilyList_AppendNamed(FontFamilyList* aList, nsIAtom* aName);
|
|
|
|
void Gecko_FontFamilyList_AppendGeneric(FontFamilyList* list, FontFamilyType familyType);
|
|
|
|
void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
|
|
|
|
|
2016-05-04 03:42:40 +03:00
|
|
|
// Counter style.
|
|
|
|
void Gecko_SetListStyleType(nsStyleList* style_struct, uint32_t type);
|
|
|
|
void Gecko_CopyListStyleTypeFrom(nsStyleList* dst, const nsStyleList* src);
|
|
|
|
|
2016-05-27 01:18:09 +03:00
|
|
|
// background-image style.
|
|
|
|
// TODO: support url() values (and maybe element() too?).
|
|
|
|
void Gecko_SetNullImageValue(nsStyleImage* image);
|
|
|
|
void Gecko_SetGradientImageValue(nsStyleImage* image, nsStyleGradient* gradient);
|
|
|
|
void Gecko_CopyImageValueFrom(nsStyleImage* image, const nsStyleImage* other);
|
|
|
|
|
|
|
|
nsStyleGradient* Gecko_CreateGradient(uint8_t shape,
|
|
|
|
uint8_t size,
|
|
|
|
bool repeating,
|
|
|
|
bool legacy_syntax,
|
|
|
|
uint32_t stops);
|
|
|
|
|
2016-05-21 03:02:54 +03:00
|
|
|
// Object refcounting.
|
|
|
|
NS_DECL_HOLDER_FFI_REFCOUNTING(nsIPrincipal, Principal)
|
|
|
|
NS_DECL_HOLDER_FFI_REFCOUNTING(nsIURI, URI)
|
|
|
|
|
2016-05-21 03:02:54 +03:00
|
|
|
// Display style.
|
|
|
|
void Gecko_SetMozBinding(nsStyleDisplay* style_struct,
|
|
|
|
const uint8_t* string_bytes, uint32_t string_length,
|
|
|
|
ThreadSafeURIHolder* base_uri,
|
|
|
|
ThreadSafeURIHolder* referrer,
|
|
|
|
ThreadSafePrincipalHolder* principal);
|
|
|
|
void Gecko_CopyMozBindingFrom(nsStyleDisplay* des, const nsStyleDisplay* src);
|
|
|
|
|
2016-07-08 10:07:06 +03:00
|
|
|
// Dirtiness tracking.
|
|
|
|
uint32_t Gecko_GetNodeFlags(RawGeckoNode* node);
|
|
|
|
void Gecko_SetNodeFlags(RawGeckoNode* node, uint32_t flags);
|
|
|
|
void Gecko_UnsetNodeFlags(RawGeckoNode* node, uint32_t flags);
|
|
|
|
|
2016-07-27 00:22:57 +03:00
|
|
|
// Incremental restyle.
|
2016-07-29 05:20:45 +03:00
|
|
|
// TODO: We would avoid a few ffi calls if we decide to make an API like the
|
|
|
|
// former CalcAndStoreStyleDifference, but that would effectively mean breaking
|
|
|
|
// some safety guarantees in the servo side.
|
|
|
|
//
|
|
|
|
// Also, we might want a ComputedValues to ComputedValues API for animations?
|
|
|
|
// Not if we do them in Gecko...
|
|
|
|
nsStyleContext* Gecko_GetStyleContext(RawGeckoNode* node);
|
|
|
|
nsChangeHint Gecko_CalcStyleDifference(nsStyleContext* oldstyle,
|
2016-08-16 08:10:05 +03:00
|
|
|
ServoComputedValuesBorrowed newstyle);
|
2016-07-29 05:20:45 +03:00
|
|
|
void Gecko_StoreStyleDifference(RawGeckoNode* node, nsChangeHint change);
|
2016-07-27 00:22:57 +03:00
|
|
|
|
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-07-14 11:59:48 +03:00
|
|
|
|
|
|
|
void Gecko_EnsureImageLayersLength(nsStyleImageLayers* layers, size_t len);
|
|
|
|
|
2016-07-12 11:10:39 +03:00
|
|
|
void Gecko_InitializeImageLayer(nsStyleImageLayers::Layer* layer,
|
|
|
|
nsStyleImageLayers::LayerType layer_type);
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsStyleCoord::Calc, Calc);
|
|
|
|
|
2016-01-27 05:02:04 +03:00
|
|
|
// Styleset and Stylesheet management.
|
|
|
|
//
|
|
|
|
// TODO: Make these return already_AddRefed and UniquePtr when the binding
|
|
|
|
// generator is smart enough to handle them.
|
2016-08-16 08:08:46 +03:00
|
|
|
RawServoStyleSheetStrong Servo_StylesheetFromUTF8Bytes(
|
2016-05-21 03:02:54 +03:00
|
|
|
const uint8_t* bytes, uint32_t length,
|
|
|
|
mozilla::css::SheetParsingMode parsing_mode,
|
2016-08-02 12:05:22 +03:00
|
|
|
const uint8_t* base_bytes, uint32_t base_length,
|
2016-05-21 03:02:54 +03:00
|
|
|
ThreadSafeURIHolder* base,
|
|
|
|
ThreadSafeURIHolder* referrer,
|
|
|
|
ThreadSafePrincipalHolder* principal);
|
2016-08-16 08:10:05 +03:00
|
|
|
void Servo_AddRefStyleSheet(RawServoStyleSheetBorrowed sheet);
|
|
|
|
void Servo_ReleaseStyleSheet(RawServoStyleSheetBorrowed sheet);
|
|
|
|
void Servo_AppendStyleSheet(RawServoStyleSheetBorrowed sheet, RawServoStyleSet* set);
|
|
|
|
void Servo_PrependStyleSheet(RawServoStyleSheetBorrowed sheet, RawServoStyleSet* set);
|
|
|
|
void Servo_RemoveStyleSheet(RawServoStyleSheetBorrowed sheet, RawServoStyleSet* set);
|
|
|
|
void Servo_InsertStyleSheetBefore(RawServoStyleSheetBorrowed sheet,
|
|
|
|
RawServoStyleSheetBorrowed reference,
|
2016-04-29 07:01:44 +03:00
|
|
|
RawServoStyleSet* set);
|
2016-08-16 08:10:05 +03:00
|
|
|
bool Servo_StyleSheetHasRules(RawServoStyleSheetBorrowed sheet);
|
2016-01-27 05:02:04 +03:00
|
|
|
RawServoStyleSet* Servo_InitStyleSet();
|
|
|
|
void Servo_DropStyleSet(RawServoStyleSet* set);
|
2016-02-26 04:51:01 +03:00
|
|
|
|
2016-06-24 06:35:12 +03:00
|
|
|
// Style attributes.
|
|
|
|
ServoDeclarationBlock* Servo_ParseStyleAttribute(const uint8_t* bytes,
|
2016-07-18 11:36:59 +03:00
|
|
|
uint32_t length,
|
2016-06-24 06:35:12 +03:00
|
|
|
nsHTMLCSSStyleSheet* cache);
|
|
|
|
void Servo_DropDeclarationBlock(ServoDeclarationBlock* declarations);
|
|
|
|
nsHTMLCSSStyleSheet* Servo_GetDeclarationBlockCache(
|
|
|
|
ServoDeclarationBlock* declarations);
|
|
|
|
void Servo_SetDeclarationBlockImmutable(ServoDeclarationBlock* declarations);
|
|
|
|
void Servo_ClearDeclarationBlockCachePointer(ServoDeclarationBlock* declarations);
|
|
|
|
|
2016-07-18 11:29:04 +03:00
|
|
|
// CSS supports().
|
|
|
|
bool Servo_CSSSupports(const uint8_t* name, uint32_t name_length,
|
|
|
|
const uint8_t* value, uint32_t value_length);
|
|
|
|
|
2016-03-19 02:56:47 +03:00
|
|
|
// Computed style data.
|
2016-08-16 08:08:46 +03:00
|
|
|
ServoComputedValuesStrong Servo_GetComputedValues(RawGeckoNode* node);
|
2016-08-16 08:10:05 +03:00
|
|
|
ServoComputedValuesStrong Servo_GetComputedValuesForAnonymousBox(ServoComputedValuesBorrowed parentStyleOrNull,
|
2016-04-27 00:09:03 +03:00
|
|
|
nsIAtom* pseudoTag,
|
|
|
|
RawServoStyleSet* set);
|
2016-08-16 08:10:05 +03:00
|
|
|
ServoComputedValuesStrong Servo_GetComputedValuesForPseudoElement(ServoComputedValuesBorrowed parent_style,
|
2016-04-29 03:56:37 +03:00
|
|
|
RawGeckoElement* match_element,
|
|
|
|
nsIAtom* pseudo_tag,
|
|
|
|
RawServoStyleSet* set,
|
|
|
|
bool is_probe);
|
2016-08-16 08:10:05 +03:00
|
|
|
ServoComputedValuesStrong Servo_InheritComputedValues(ServoComputedValuesBorrowed parent_style);
|
|
|
|
void Servo_AddRefComputedValues(ServoComputedValuesBorrowed);
|
|
|
|
void Servo_ReleaseComputedValues(ServoComputedValuesBorrowed);
|
2016-03-19 02:56:47 +03:00
|
|
|
|
2016-05-05 01:34:21 +03:00
|
|
|
// Initialize Servo components. Should be called exactly once at startup.
|
|
|
|
void Servo_Initialize();
|
|
|
|
|
2016-08-03 20:34:41 +03:00
|
|
|
// Shut down Servo components. Should be called exactly once at shutdown.
|
|
|
|
void Servo_Shutdown();
|
|
|
|
|
2016-05-25 09:55:49 +03:00
|
|
|
// Restyle the given document or subtree.
|
2016-01-27 05:02:04 +03:00
|
|
|
void Servo_RestyleDocument(RawGeckoDocument* doc, RawServoStyleSet* set);
|
2016-05-25 09:55:49 +03:00
|
|
|
void Servo_RestyleSubtree(RawGeckoNode* node, RawServoStyleSet* set);
|
2015-11-25 04:14:39 +03:00
|
|
|
|
2016-07-19 04:02:55 +03:00
|
|
|
// Restyle hints.
|
|
|
|
nsRestyleHint Servo_ComputeRestyleHint(RawGeckoElement* element,
|
|
|
|
ServoElementSnapshot* snapshot,
|
|
|
|
RawServoStyleSet* set);
|
|
|
|
|
2016-04-02 03:04:59 +03:00
|
|
|
// Style-struct management.
|
2016-07-19 04:02:55 +03:00
|
|
|
#define STYLE_STRUCT(name, checkdata_cb) \
|
|
|
|
struct nsStyle##name; \
|
|
|
|
void Gecko_Construct_nsStyle##name(nsStyle##name* ptr); \
|
|
|
|
void Gecko_CopyConstruct_nsStyle##name(nsStyle##name* ptr, \
|
|
|
|
const nsStyle##name* other); \
|
|
|
|
void Gecko_Destroy_nsStyle##name(nsStyle##name* ptr); \
|
|
|
|
const nsStyle##name* Servo_GetStyle##name( \
|
2016-08-16 08:10:05 +03:00
|
|
|
ServoComputedValuesBorrowed computedValues);
|
2016-04-02 03:04:59 +03:00
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
|
|
|
|
2015-11-25 04:14:39 +03:00
|
|
|
} // extern "C"
|
|
|
|
|
|
|
|
#endif // mozilla_ServoBindings_h
|