2016-08-19 14:44:43 +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/. */
|
|
|
|
|
|
|
|
/* 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 09:11:24 +03:00
|
|
|
// Element data
|
|
|
|
SERVO_BINDING_FUNC(Servo_Element_ClearData, void, RawGeckoElementBorrowed node)
|
Bug 1387956 - Overhaul ComputedValues measurement, and add style structs measurement. r=bholley.
This patch moves measurement of ComputedValues objects from Rust to C++.
Measurement now happens (a) via DOM elements and (b) remaining elements via
the frame tree. Likewise for the style structs hanging off ComputedValues
objects.
Here is an example of the output.
> ├──27,600,448 B (26.49%) -- active/window(https://en.wikipedia.org/wiki/Barack_Obama)
> │ ├──12,772,544 B (12.26%) -- layout
> │ │ ├───4,483,744 B (04.30%) -- frames
> │ │ │ ├──1,653,552 B (01.59%) ── nsInlineFrame
> │ │ │ ├──1,415,760 B (01.36%) ── nsTextFrame
> │ │ │ ├────431,376 B (00.41%) ── nsBlockFrame
> │ │ │ ├────340,560 B (00.33%) ── nsHTMLScrollFrame
> │ │ │ ├────302,544 B (00.29%) ── nsContinuingTextFrame
> │ │ │ ├────156,408 B (00.15%) ── nsBulletFrame
> │ │ │ ├─────73,024 B (00.07%) ── nsPlaceholderFrame
> │ │ │ ├─────27,656 B (00.03%) ── sundries
> │ │ │ ├─────23,520 B (00.02%) ── nsTableCellFrame
> │ │ │ ├─────16,704 B (00.02%) ── nsImageFrame
> │ │ │ ├─────15,488 B (00.01%) ── nsTableRowFrame
> │ │ │ ├─────13,776 B (00.01%) ── nsTableColFrame
> │ │ │ └─────13,376 B (00.01%) ── nsTableFrame
> │ │ ├───3,412,192 B (03.28%) -- servo-style-structs
> │ │ │ ├──1,288,224 B (01.24%) ── Display
> │ │ │ ├────742,400 B (00.71%) ── Position
> │ │ │ ├────308,736 B (00.30%) ── Font
> │ │ │ ├────226,512 B (00.22%) ── Background
> │ │ │ ├────218,304 B (00.21%) ── TextReset
> │ │ │ ├────214,896 B (00.21%) ── Text
> │ │ │ ├────130,560 B (00.13%) ── Border
> │ │ │ ├─────81,408 B (00.08%) ── UIReset
> │ │ │ ├─────61,440 B (00.06%) ── Padding
> │ │ │ ├─────38,176 B (00.04%) ── UserInterface
> │ │ │ ├─────29,232 B (00.03%) ── Margin
> │ │ │ ├─────21,824 B (00.02%) ── sundries
> │ │ │ ├─────20,080 B (00.02%) ── Color
> │ │ │ ├─────20,080 B (00.02%) ── Column
> │ │ │ └─────10,320 B (00.01%) ── Effects
> │ │ ├───2,227,680 B (02.14%) -- computed-values
> │ │ │ ├──1,182,928 B (01.14%) ── non-dom
> │ │ │ └──1,044,752 B (01.00%) ── dom
> │ │ ├───1,500,016 B (01.44%) ── text-runs
> │ │ ├─────492,640 B (00.47%) ── line-boxes
> │ │ ├─────326,688 B (00.31%) ── frame-properties
> │ │ ├─────301,760 B (00.29%) ── pres-shell
> │ │ ├──────27,648 B (00.03%) ── pres-contexts
> │ │ └─────────176 B (00.00%) ── style-sets
The 'servo-style-structs' and 'computed-values' sub-trees are new. (Prior to
this patch, ComputedValues under DOM elements were tallied under the the
'dom/element-nodes' sub-tree, and ComputedValues not under DOM element were
ignored.) 'servo-style-structs/sundries' aggregates all the style structs that
are smaller than 8 KiB.
Other notable things done by the patch are as follows.
- It significantly changes the signatures of the methods measuring nsINode and
its subclasses, in order to handle the tallying of style structs separately
from element-nodes. Likewise for nsIFrame.
- It renames the 'layout/style-structs' sub-tree as
'layout/gecko-style-structs', to clearly distinguish it from the new
'layout/servo-style-structs' sub-tree.
- It adds some FFI functions to access various Rust-side data structures from
C++ code.
- There is a nasty hack used twice to measure Arcs, by stepping backwards from
an interior pointer to a base pointer. It works, but I want to replace it
with something better eventually. The "XXX WARNING" comments have details.
- It makes DMD print a line to the console if it sees a pointer it doesn't
recognise. This is useful for detecting when we are measuring an interior
pointer instead of a base pointer, which is bad but easy to do when Arcs are
involved.
- It removes the Rust code for measuring CVs, because it's now all done on the
C++ side.
MozReview-Commit-ID: BKebACLKtCi
--HG--
extra : rebase_source : 4d9a8c6b198a0ff025b811759a6bfa9f33a260ba
2017-08-11 09:37:33 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Element_SizeOfExcludingThisAndCVs, size_t,
|
2017-09-18 06:54:30 +03:00
|
|
|
mozilla::MallocSizeOf malloc_size_of,
|
|
|
|
mozilla::MallocSizeOf malloc_enclosing_size_of,
|
|
|
|
mozilla::SeenPtrs* seen_ptrs, RawGeckoElementBorrowed node)
|
Bug 1387956 - Overhaul ComputedValues measurement, and add style structs measurement. r=bholley.
This patch moves measurement of ComputedValues objects from Rust to C++.
Measurement now happens (a) via DOM elements and (b) remaining elements via
the frame tree. Likewise for the style structs hanging off ComputedValues
objects.
Here is an example of the output.
> ├──27,600,448 B (26.49%) -- active/window(https://en.wikipedia.org/wiki/Barack_Obama)
> │ ├──12,772,544 B (12.26%) -- layout
> │ │ ├───4,483,744 B (04.30%) -- frames
> │ │ │ ├──1,653,552 B (01.59%) ── nsInlineFrame
> │ │ │ ├──1,415,760 B (01.36%) ── nsTextFrame
> │ │ │ ├────431,376 B (00.41%) ── nsBlockFrame
> │ │ │ ├────340,560 B (00.33%) ── nsHTMLScrollFrame
> │ │ │ ├────302,544 B (00.29%) ── nsContinuingTextFrame
> │ │ │ ├────156,408 B (00.15%) ── nsBulletFrame
> │ │ │ ├─────73,024 B (00.07%) ── nsPlaceholderFrame
> │ │ │ ├─────27,656 B (00.03%) ── sundries
> │ │ │ ├─────23,520 B (00.02%) ── nsTableCellFrame
> │ │ │ ├─────16,704 B (00.02%) ── nsImageFrame
> │ │ │ ├─────15,488 B (00.01%) ── nsTableRowFrame
> │ │ │ ├─────13,776 B (00.01%) ── nsTableColFrame
> │ │ │ └─────13,376 B (00.01%) ── nsTableFrame
> │ │ ├───3,412,192 B (03.28%) -- servo-style-structs
> │ │ │ ├──1,288,224 B (01.24%) ── Display
> │ │ │ ├────742,400 B (00.71%) ── Position
> │ │ │ ├────308,736 B (00.30%) ── Font
> │ │ │ ├────226,512 B (00.22%) ── Background
> │ │ │ ├────218,304 B (00.21%) ── TextReset
> │ │ │ ├────214,896 B (00.21%) ── Text
> │ │ │ ├────130,560 B (00.13%) ── Border
> │ │ │ ├─────81,408 B (00.08%) ── UIReset
> │ │ │ ├─────61,440 B (00.06%) ── Padding
> │ │ │ ├─────38,176 B (00.04%) ── UserInterface
> │ │ │ ├─────29,232 B (00.03%) ── Margin
> │ │ │ ├─────21,824 B (00.02%) ── sundries
> │ │ │ ├─────20,080 B (00.02%) ── Color
> │ │ │ ├─────20,080 B (00.02%) ── Column
> │ │ │ └─────10,320 B (00.01%) ── Effects
> │ │ ├───2,227,680 B (02.14%) -- computed-values
> │ │ │ ├──1,182,928 B (01.14%) ── non-dom
> │ │ │ └──1,044,752 B (01.00%) ── dom
> │ │ ├───1,500,016 B (01.44%) ── text-runs
> │ │ ├─────492,640 B (00.47%) ── line-boxes
> │ │ ├─────326,688 B (00.31%) ── frame-properties
> │ │ ├─────301,760 B (00.29%) ── pres-shell
> │ │ ├──────27,648 B (00.03%) ── pres-contexts
> │ │ └─────────176 B (00.00%) ── style-sets
The 'servo-style-structs' and 'computed-values' sub-trees are new. (Prior to
this patch, ComputedValues under DOM elements were tallied under the the
'dom/element-nodes' sub-tree, and ComputedValues not under DOM element were
ignored.) 'servo-style-structs/sundries' aggregates all the style structs that
are smaller than 8 KiB.
Other notable things done by the patch are as follows.
- It significantly changes the signatures of the methods measuring nsINode and
its subclasses, in order to handle the tallying of style structs separately
from element-nodes. Likewise for nsIFrame.
- It renames the 'layout/style-structs' sub-tree as
'layout/gecko-style-structs', to clearly distinguish it from the new
'layout/servo-style-structs' sub-tree.
- It adds some FFI functions to access various Rust-side data structures from
C++ code.
- There is a nasty hack used twice to measure Arcs, by stepping backwards from
an interior pointer to a base pointer. It works, but I want to replace it
with something better eventually. The "XXX WARNING" comments have details.
- It makes DMD print a line to the console if it sees a pointer it doesn't
recognise. This is useful for detecting when we are measuring an interior
pointer instead of a base pointer, which is bad but easy to do when Arcs are
involved.
- It removes the Rust code for measuring CVs, because it's now all done on the
C++ side.
MozReview-Commit-ID: BKebACLKtCi
--HG--
extra : rebase_source : 4d9a8c6b198a0ff025b811759a6bfa9f33a260ba
2017-08-11 09:37:33 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Element_HasPrimaryComputedValues, bool,
|
|
|
|
RawGeckoElementBorrowed node)
|
|
|
|
SERVO_BINDING_FUNC(Servo_Element_GetPrimaryComputedValues,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleStrong,
|
Bug 1387956 - Overhaul ComputedValues measurement, and add style structs measurement. r=bholley.
This patch moves measurement of ComputedValues objects from Rust to C++.
Measurement now happens (a) via DOM elements and (b) remaining elements via
the frame tree. Likewise for the style structs hanging off ComputedValues
objects.
Here is an example of the output.
> ├──27,600,448 B (26.49%) -- active/window(https://en.wikipedia.org/wiki/Barack_Obama)
> │ ├──12,772,544 B (12.26%) -- layout
> │ │ ├───4,483,744 B (04.30%) -- frames
> │ │ │ ├──1,653,552 B (01.59%) ── nsInlineFrame
> │ │ │ ├──1,415,760 B (01.36%) ── nsTextFrame
> │ │ │ ├────431,376 B (00.41%) ── nsBlockFrame
> │ │ │ ├────340,560 B (00.33%) ── nsHTMLScrollFrame
> │ │ │ ├────302,544 B (00.29%) ── nsContinuingTextFrame
> │ │ │ ├────156,408 B (00.15%) ── nsBulletFrame
> │ │ │ ├─────73,024 B (00.07%) ── nsPlaceholderFrame
> │ │ │ ├─────27,656 B (00.03%) ── sundries
> │ │ │ ├─────23,520 B (00.02%) ── nsTableCellFrame
> │ │ │ ├─────16,704 B (00.02%) ── nsImageFrame
> │ │ │ ├─────15,488 B (00.01%) ── nsTableRowFrame
> │ │ │ ├─────13,776 B (00.01%) ── nsTableColFrame
> │ │ │ └─────13,376 B (00.01%) ── nsTableFrame
> │ │ ├───3,412,192 B (03.28%) -- servo-style-structs
> │ │ │ ├──1,288,224 B (01.24%) ── Display
> │ │ │ ├────742,400 B (00.71%) ── Position
> │ │ │ ├────308,736 B (00.30%) ── Font
> │ │ │ ├────226,512 B (00.22%) ── Background
> │ │ │ ├────218,304 B (00.21%) ── TextReset
> │ │ │ ├────214,896 B (00.21%) ── Text
> │ │ │ ├────130,560 B (00.13%) ── Border
> │ │ │ ├─────81,408 B (00.08%) ── UIReset
> │ │ │ ├─────61,440 B (00.06%) ── Padding
> │ │ │ ├─────38,176 B (00.04%) ── UserInterface
> │ │ │ ├─────29,232 B (00.03%) ── Margin
> │ │ │ ├─────21,824 B (00.02%) ── sundries
> │ │ │ ├─────20,080 B (00.02%) ── Color
> │ │ │ ├─────20,080 B (00.02%) ── Column
> │ │ │ └─────10,320 B (00.01%) ── Effects
> │ │ ├───2,227,680 B (02.14%) -- computed-values
> │ │ │ ├──1,182,928 B (01.14%) ── non-dom
> │ │ │ └──1,044,752 B (01.00%) ── dom
> │ │ ├───1,500,016 B (01.44%) ── text-runs
> │ │ ├─────492,640 B (00.47%) ── line-boxes
> │ │ ├─────326,688 B (00.31%) ── frame-properties
> │ │ ├─────301,760 B (00.29%) ── pres-shell
> │ │ ├──────27,648 B (00.03%) ── pres-contexts
> │ │ └─────────176 B (00.00%) ── style-sets
The 'servo-style-structs' and 'computed-values' sub-trees are new. (Prior to
this patch, ComputedValues under DOM elements were tallied under the the
'dom/element-nodes' sub-tree, and ComputedValues not under DOM element were
ignored.) 'servo-style-structs/sundries' aggregates all the style structs that
are smaller than 8 KiB.
Other notable things done by the patch are as follows.
- It significantly changes the signatures of the methods measuring nsINode and
its subclasses, in order to handle the tallying of style structs separately
from element-nodes. Likewise for nsIFrame.
- It renames the 'layout/style-structs' sub-tree as
'layout/gecko-style-structs', to clearly distinguish it from the new
'layout/servo-style-structs' sub-tree.
- It adds some FFI functions to access various Rust-side data structures from
C++ code.
- There is a nasty hack used twice to measure Arcs, by stepping backwards from
an interior pointer to a base pointer. It works, but I want to replace it
with something better eventually. The "XXX WARNING" comments have details.
- It makes DMD print a line to the console if it sees a pointer it doesn't
recognise. This is useful for detecting when we are measuring an interior
pointer instead of a base pointer, which is bad but easy to do when Arcs are
involved.
- It removes the Rust code for measuring CVs, because it's now all done on the
C++ side.
MozReview-Commit-ID: BKebACLKtCi
--HG--
extra : rebase_source : 4d9a8c6b198a0ff025b811759a6bfa9f33a260ba
2017-08-11 09:37:33 +03:00
|
|
|
RawGeckoElementBorrowed node)
|
|
|
|
SERVO_BINDING_FUNC(Servo_Element_HasPseudoComputedValues, bool,
|
|
|
|
RawGeckoElementBorrowed node, size_t index)
|
|
|
|
SERVO_BINDING_FUNC(Servo_Element_GetPseudoComputedValues,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleStrong,
|
Bug 1387956 - Overhaul ComputedValues measurement, and add style structs measurement. r=bholley.
This patch moves measurement of ComputedValues objects from Rust to C++.
Measurement now happens (a) via DOM elements and (b) remaining elements via
the frame tree. Likewise for the style structs hanging off ComputedValues
objects.
Here is an example of the output.
> ├──27,600,448 B (26.49%) -- active/window(https://en.wikipedia.org/wiki/Barack_Obama)
> │ ├──12,772,544 B (12.26%) -- layout
> │ │ ├───4,483,744 B (04.30%) -- frames
> │ │ │ ├──1,653,552 B (01.59%) ── nsInlineFrame
> │ │ │ ├──1,415,760 B (01.36%) ── nsTextFrame
> │ │ │ ├────431,376 B (00.41%) ── nsBlockFrame
> │ │ │ ├────340,560 B (00.33%) ── nsHTMLScrollFrame
> │ │ │ ├────302,544 B (00.29%) ── nsContinuingTextFrame
> │ │ │ ├────156,408 B (00.15%) ── nsBulletFrame
> │ │ │ ├─────73,024 B (00.07%) ── nsPlaceholderFrame
> │ │ │ ├─────27,656 B (00.03%) ── sundries
> │ │ │ ├─────23,520 B (00.02%) ── nsTableCellFrame
> │ │ │ ├─────16,704 B (00.02%) ── nsImageFrame
> │ │ │ ├─────15,488 B (00.01%) ── nsTableRowFrame
> │ │ │ ├─────13,776 B (00.01%) ── nsTableColFrame
> │ │ │ └─────13,376 B (00.01%) ── nsTableFrame
> │ │ ├───3,412,192 B (03.28%) -- servo-style-structs
> │ │ │ ├──1,288,224 B (01.24%) ── Display
> │ │ │ ├────742,400 B (00.71%) ── Position
> │ │ │ ├────308,736 B (00.30%) ── Font
> │ │ │ ├────226,512 B (00.22%) ── Background
> │ │ │ ├────218,304 B (00.21%) ── TextReset
> │ │ │ ├────214,896 B (00.21%) ── Text
> │ │ │ ├────130,560 B (00.13%) ── Border
> │ │ │ ├─────81,408 B (00.08%) ── UIReset
> │ │ │ ├─────61,440 B (00.06%) ── Padding
> │ │ │ ├─────38,176 B (00.04%) ── UserInterface
> │ │ │ ├─────29,232 B (00.03%) ── Margin
> │ │ │ ├─────21,824 B (00.02%) ── sundries
> │ │ │ ├─────20,080 B (00.02%) ── Color
> │ │ │ ├─────20,080 B (00.02%) ── Column
> │ │ │ └─────10,320 B (00.01%) ── Effects
> │ │ ├───2,227,680 B (02.14%) -- computed-values
> │ │ │ ├──1,182,928 B (01.14%) ── non-dom
> │ │ │ └──1,044,752 B (01.00%) ── dom
> │ │ ├───1,500,016 B (01.44%) ── text-runs
> │ │ ├─────492,640 B (00.47%) ── line-boxes
> │ │ ├─────326,688 B (00.31%) ── frame-properties
> │ │ ├─────301,760 B (00.29%) ── pres-shell
> │ │ ├──────27,648 B (00.03%) ── pres-contexts
> │ │ └─────────176 B (00.00%) ── style-sets
The 'servo-style-structs' and 'computed-values' sub-trees are new. (Prior to
this patch, ComputedValues under DOM elements were tallied under the the
'dom/element-nodes' sub-tree, and ComputedValues not under DOM element were
ignored.) 'servo-style-structs/sundries' aggregates all the style structs that
are smaller than 8 KiB.
Other notable things done by the patch are as follows.
- It significantly changes the signatures of the methods measuring nsINode and
its subclasses, in order to handle the tallying of style structs separately
from element-nodes. Likewise for nsIFrame.
- It renames the 'layout/style-structs' sub-tree as
'layout/gecko-style-structs', to clearly distinguish it from the new
'layout/servo-style-structs' sub-tree.
- It adds some FFI functions to access various Rust-side data structures from
C++ code.
- There is a nasty hack used twice to measure Arcs, by stepping backwards from
an interior pointer to a base pointer. It works, but I want to replace it
with something better eventually. The "XXX WARNING" comments have details.
- It makes DMD print a line to the console if it sees a pointer it doesn't
recognise. This is useful for detecting when we are measuring an interior
pointer instead of a base pointer, which is bad but easy to do when Arcs are
involved.
- It removes the Rust code for measuring CVs, because it's now all done on the
C++ side.
MozReview-Commit-ID: BKebACLKtCi
--HG--
extra : rebase_source : 4d9a8c6b198a0ff025b811759a6bfa9f33a260ba
2017-08-11 09:37:33 +03:00
|
|
|
RawGeckoElementBorrowed node, size_t index)
|
2017-07-19 04:38:47 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Element_IsDisplayNone,
|
|
|
|
bool,
|
|
|
|
RawGeckoElementBorrowed element)
|
Bug 1303605: Remove the undisplayed maps. r=bz,mats
This is mostly code removal, changing GetDisplayContentsStyle(..) checks by an
FFI call to Servo.
The tricky parts are:
* MaybeCreateLazily, which I fixed to avoid setting bits under display: none
stuff. This was a pre-existing problem, which was wallpapered by the
sc->IsInDisplayNoneSubtree() check, which effectively made the whole
assertion useless (see bug 1381017 for the only crashtest that hit this
though).
* ContentRemoved, where we can no longer know for sure whether the element is
actually display: contents if we're removing it as a response to a style
change. See the comment there. That kinda sucks, but that case is relatively
weird, and it's better than adding tons of complexity to handle that.
* GetParentComputedStyle, which also has a comment there. Also, this function
has only one caller now, so we should maybe try to remove it.
The different assertions after DestroyFramesForAndRestyle are changed for a
single assertion in the function itself, and the node bit used as an
optimization to avoid hashtable lookups is taken back.
MozReview-Commit-ID: AZm822QnhF9
2018-03-29 04:49:26 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Element_IsDisplayContents,
|
|
|
|
bool,
|
|
|
|
RawGeckoElementBorrowed element)
|
2017-09-20 07:43:31 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Element_IsPrimaryStyleReusedViaRuleNode,
|
|
|
|
bool,
|
|
|
|
RawGeckoElementBorrowed element)
|
2018-01-16 17:14:39 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_InvalidateStyleForDocStateChanges,
|
|
|
|
void,
|
|
|
|
RawGeckoElementBorrowed root,
|
2018-02-12 15:57:26 +03:00
|
|
|
RawServoStyleSetBorrowed doc_styles,
|
|
|
|
const nsTArray<RawServoAuthorStylesBorrowed>* non_document_styles,
|
2018-01-16 17:14:39 +03:00
|
|
|
uint64_t aStatesChanged)
|
2016-08-19 14:44:43 +03:00
|
|
|
|
|
|
|
// Styleset and Stylesheet management
|
2017-08-29 16:01:42 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_FromUTF8Bytes,
|
|
|
|
RawServoStyleSheetContentsStrong,
|
2016-12-17 12:58:56 +03:00
|
|
|
mozilla::css::Loader* loader,
|
2018-04-30 18:50:03 +03:00
|
|
|
mozilla::StyleSheet* gecko_stylesheet,
|
2018-02-28 11:09:00 +03:00
|
|
|
mozilla::css::SheetLoadData* load_data,
|
2018-02-14 04:23:59 +03:00
|
|
|
const nsACString* bytes,
|
2016-08-19 14:44:43 +03:00
|
|
|
mozilla::css::SheetParsingMode parsing_mode,
|
2017-04-25 22:01:45 +03:00
|
|
|
RawGeckoURLExtraData* extra_data,
|
2017-05-14 18:11:18 +03:00
|
|
|
uint32_t line_number_offset,
|
2017-08-22 23:53:53 +03:00
|
|
|
nsCompatibility quirks_mode,
|
|
|
|
mozilla::css::LoaderReusableStyleSheets* reusable_sheets)
|
2018-02-15 03:39:35 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_FromUTF8BytesAsync,
|
|
|
|
void,
|
|
|
|
mozilla::css::SheetLoadDataHolder* load_data,
|
|
|
|
RawGeckoURLExtraData* extra_data,
|
|
|
|
const nsACString* bytes,
|
|
|
|
mozilla::css::SheetParsingMode parsing_mode,
|
|
|
|
uint32_t line_number_offset,
|
|
|
|
nsCompatibility quirks_mode)
|
2017-06-29 04:07:06 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_Empty, RawServoStyleSheetContentsStrong,
|
|
|
|
mozilla::css::SheetParsingMode parsing_mode)
|
2016-08-23 06:14:27 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_HasRules, bool,
|
2017-06-29 04:07:06 +03:00
|
|
|
RawServoStyleSheetContentsBorrowed sheet)
|
2016-11-23 02:26:20 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_GetRules, ServoCssRulesStrong,
|
2017-06-29 04:07:06 +03:00
|
|
|
RawServoStyleSheetContentsBorrowed sheet)
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_Clone, RawServoStyleSheetContentsStrong,
|
2017-06-29 20:09:56 +03:00
|
|
|
RawServoStyleSheetContentsBorrowed sheet,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet* reference_sheet);
|
2017-05-30 04:03:51 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_SizeOfIncludingThis, size_t,
|
2017-06-29 04:07:06 +03:00
|
|
|
mozilla::MallocSizeOf malloc_size_of,
|
2017-09-18 06:54:30 +03:00
|
|
|
mozilla::MallocSizeOf malloc_enclosing_size_of,
|
2017-06-29 04:07:06 +03:00
|
|
|
RawServoStyleSheetContentsBorrowed sheet)
|
2017-08-09 22:33:24 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_GetSourceMapURL, void,
|
|
|
|
RawServoStyleSheetContentsBorrowed sheet, nsAString* result)
|
2017-09-14 23:59:32 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_GetSourceURL, void,
|
|
|
|
RawServoStyleSheetContentsBorrowed sheet, nsAString* result)
|
2017-08-22 02:42:40 +03:00
|
|
|
// We'd like to return `OriginFlags` 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.
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSheet_GetOrigin, uint8_t,
|
2017-08-12 13:34:34 +03:00
|
|
|
RawServoStyleSheetContentsBorrowed sheet)
|
2017-08-15 01:21:51 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSet*, RawGeckoPresContextOwned pres_context)
|
2017-08-02 15:39:32 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_RebuildCachedData, void,
|
2017-05-24 03:31:59 +03:00
|
|
|
RawServoStyleSetBorrowed set)
|
2018-02-12 15:57:26 +03:00
|
|
|
|
2017-08-16 01:10:13 +03:00
|
|
|
// We'd like to return `OriginFlags` 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-02-06 18:52:22 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_MediumFeaturesChanged,
|
|
|
|
MediumFeaturesChangedResult,
|
|
|
|
RawServoStyleSetBorrowed document_set,
|
2018-02-12 15:57:26 +03:00
|
|
|
nsTArray<RawServoAuthorStylesBorrowedMut>* non_document_sets,
|
2018-02-06 17:17:10 +03:00
|
|
|
bool may_affect_default_style)
|
2017-09-04 12:57:00 +03:00
|
|
|
// We'd like to return `OriginFlags` 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.
|
2016-08-23 16:11:02 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_Drop, void, RawServoStyleSetOwned set)
|
2017-06-10 17:22:23 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_CompatModeChanged, void,
|
|
|
|
RawServoStyleSetBorrowed raw_data)
|
2016-08-23 06:10:49 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_AppendStyleSheet, void,
|
2017-05-02 02:46:41 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet* gecko_sheet)
|
2016-08-23 06:10:49 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_PrependStyleSheet, void,
|
2017-05-02 02:46:41 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet* gecko_sheet)
|
2016-08-23 06:10:49 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_RemoveStyleSheet, void,
|
2017-05-02 02:46:41 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet* gecko_sheet)
|
2016-08-23 06:10:49 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_InsertStyleSheetBefore, void,
|
2017-05-02 02:46:41 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet* gecko_sheet,
|
|
|
|
const mozilla::StyleSheet* before)
|
2018-01-25 04:53:49 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_FlushStyleSheets, void,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawGeckoElementBorrowedOrNull doc_elem,
|
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots)
|
2018-02-08 15:05:28 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_SetAuthorStyleDisabled, void,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
bool author_style_disabled)
|
2016-12-19 09:30:14 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_NoteStyleSheetsChanged, void,
|
2017-08-12 13:19:22 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
mozilla::OriginFlags changed_origins)
|
2017-05-13 10:34:38 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetKeyframesForName, bool,
|
2017-01-29 06:58:28 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
2018-05-01 08:09:12 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2018-07-06 06:19:10 +03:00
|
|
|
ComputedStyleBorrowed style,
|
2017-10-10 11:00:28 +03:00
|
|
|
nsAtom* name,
|
2017-03-21 09:29:43 +03:00
|
|
|
nsTimingFunctionBorrowed timing_function,
|
2017-01-29 06:58:28 +03:00
|
|
|
RawGeckoKeyframeListBorrowedMut keyframe_list)
|
2017-03-27 09:53:27 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetFontFaceRules, void,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawGeckoFontFaceRuleListBorrowedMut list)
|
2018-04-05 01:41:28 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetCounterStyleRule,
|
|
|
|
const RawServoCounterStyleRule*,
|
2017-10-03 01:05:19 +03:00
|
|
|
RawServoStyleSetBorrowed set, nsAtom* name)
|
2017-08-31 03:08:50 +03:00
|
|
|
// This function may return nullptr or gfxFontFeatureValueSet with zero reference.
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_BuildFontFeatureValueSet,
|
|
|
|
gfxFontFeatureValueSet*,
|
|
|
|
RawServoStyleSetBorrowed set)
|
2017-04-15 01:37:35 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_ResolveForDeclarations,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleStrong,
|
2017-04-15 01:37:35 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowedOrNull parent_style,
|
2017-07-07 00:56:06 +03:00
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2017-10-02 13:07:11 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SelectorList_Drop, void,
|
2017-10-10 01:57:34 +03:00
|
|
|
RawServoSelectorListOwned selector_list)
|
2017-10-02 13:07:11 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SelectorList_Parse,
|
|
|
|
RawServoSelectorList*,
|
|
|
|
const nsACString* selector_list)
|
2017-11-13 08:33:46 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SourceSizeList_Parse,
|
|
|
|
RawServoSourceSizeList*,
|
|
|
|
const nsACString* value)
|
|
|
|
SERVO_BINDING_FUNC(Servo_SourceSizeList_Evaluate,
|
|
|
|
int32_t,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawServoSourceSizeListBorrowedOrNull)
|
2017-11-13 18:41:59 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SourceSizeList_Drop, void,
|
|
|
|
RawServoSourceSizeListOwned)
|
2017-10-02 13:07:11 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SelectorList_Matches, bool,
|
|
|
|
RawGeckoElementBorrowed, RawServoSelectorListBorrowed)
|
2017-10-14 14:57:33 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SelectorList_Closest, const RawGeckoElement*,
|
2017-10-12 12:42:17 +03:00
|
|
|
RawGeckoElementBorrowed, RawServoSelectorListBorrowed)
|
2017-10-23 23:36:59 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SelectorList_QueryFirst, const RawGeckoElement*,
|
2017-10-30 21:23:59 +03:00
|
|
|
RawGeckoNodeBorrowed, RawServoSelectorListBorrowed,
|
|
|
|
bool may_use_invalidation)
|
2017-10-23 23:36:59 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SelectorList_QueryAll, void,
|
|
|
|
RawGeckoNodeBorrowed, RawServoSelectorListBorrowed,
|
2017-10-30 21:23:59 +03:00
|
|
|
nsSimpleContentList* content_list,
|
|
|
|
bool may_use_invalidation)
|
2017-08-30 11:21:26 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_AddSizeOfExcludingThis, void,
|
|
|
|
mozilla::MallocSizeOf malloc_size_of,
|
Bug 1387958 - Measure the stylist during memory reporting. r=heycam.
Example output from the Obama Wikipedia page:
> ├──2,315,600 B (01.16%) -- stylist
> │ ├──1,916,928 B (00.96%) ── invalidation-map
> │ ├────228,800 B (00.11%) ── rule-tree
> │ ├────142,336 B (00.07%) ── element-and-pseudos-maps
> │ ├─────14,336 B (00.01%) ── revalidation-selectors
> │ ├──────9,648 B (00.00%) ── other
> │ └──────3,552 B (00.00%) ── precomputed-pseudos
This change requires new code to measure HashMaps, which uses the new
'malloc_enclosing_size_of' functions that can measure a heap block from an
interior pointer.
The patch changes MallocSizeOfFn to a newtype, and introduces
MallocEnclosingSizeOfFn alongside.
It also adds new traits: MallocSizeOfBox, MallocSizeOfVec, MallocSizeOfHash.
These each contain a single method that does shallow measurement of the
relevant type, which is often useful. (This is a different style to the
existing MallocSizeOf trait, which does deep measurement, but I'm moving away
from the always-deep-measurement style because it's less flexible.)
MozReview-Commit-ID: FgJCCmdw0ZF
--HG--
extra : rebase_source : c692c2073aa66020224489b97247c49de95a99a4
2017-09-05 04:38:45 +03:00
|
|
|
mozilla::MallocSizeOf malloc_enclosing_size_of,
|
2017-08-30 11:21:26 +03:00
|
|
|
mozilla::ServoStyleSetSizes* sizes,
|
|
|
|
RawServoStyleSetBorrowed set)
|
Bug 1400078 - Measure the UA cache. r=njn.
ServoStyleSetSizes now has two uses, one for the Stylist, and one for the UA
cache, and so the patch removes 'Stylist' from the field names.
Example output from about:memory:
> +----1,359,608 B (00.55%) -- layout
> | +----756,488 B (00.31%) -- style-sheet-cache [2]
> | +----393,968 B (00.16%) -- servo-ua-cache
> | | +--234,496 B (00.10%) -- element-and-pseudos-maps
> | | +---59,648 B (00.02%) -- revalidation-selectors
> | | +---58,320 B (00.02%) -- invalidation-map
> | | +---30,752 B (00.01%) -- other
> | | +---10,752 B (00.00%) -- precomputed-pseudos
MozReview-Commit-ID: 8oxuJO0ojp
--HG--
extra : rebase_source : 7d86216967259b71df7280261d025cc65bf00ba4
2017-09-19 02:25:00 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_UACache_AddSizeOf, void,
|
|
|
|
mozilla::MallocSizeOf malloc_size_of,
|
|
|
|
mozilla::MallocSizeOf malloc_enclosing_size_of,
|
|
|
|
mozilla::ServoStyleSetSizes* sizes)
|
2018-02-12 15:57:26 +03:00
|
|
|
|
|
|
|
// AuthorStyles
|
|
|
|
SERVO_BINDING_FUNC(Servo_AuthorStyles_Create, RawServoAuthorStyles*)
|
2018-02-17 02:02:08 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AuthorStyles_Drop, void,
|
|
|
|
RawServoAuthorStylesOwned self)
|
2018-02-25 20:01:42 +03:00
|
|
|
// TODO(emilio): These will need to take a master style set to implement
|
|
|
|
// invalidation for Shadow DOM.
|
2018-02-12 15:57:26 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AuthorStyles_AppendStyleSheet, void,
|
|
|
|
RawServoAuthorStylesBorrowedMut self,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet* gecko_sheet)
|
2018-02-25 20:01:42 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AuthorStyles_RemoveStyleSheet, void,
|
|
|
|
RawServoAuthorStylesBorrowedMut self,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet* gecko_sheet)
|
2018-02-25 20:01:42 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AuthorStyles_InsertStyleSheetBefore, void,
|
|
|
|
RawServoAuthorStylesBorrowedMut self,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet* gecko_sheet,
|
|
|
|
const mozilla::StyleSheet* before)
|
2018-02-16 13:34:12 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AuthorStyles_ForceDirty, void,
|
|
|
|
RawServoAuthorStylesBorrowedMut self)
|
2018-02-25 20:01:42 +03:00
|
|
|
// TODO(emilio): This will need to take an element and a master style set to
|
|
|
|
// implement invalidation for Shadow DOM.
|
2018-02-12 15:57:26 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AuthorStyles_Flush, void,
|
|
|
|
RawServoAuthorStylesBorrowedMut self,
|
|
|
|
RawServoStyleSetBorrowed document_styles)
|
2018-02-16 15:02:28 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AuthorStyles_SizeOfIncludingThis, size_t,
|
|
|
|
mozilla::MallocSizeOf malloc_size_of,
|
|
|
|
mozilla::MallocSizeOf malloc_enclosing_size_of,
|
|
|
|
RawServoAuthorStylesBorrowed self)
|
2018-02-12 15:57:26 +03:00
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedStyle_AddRef, void, ComputedStyleBorrowed ctx);
|
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedStyle_Release, void, ComputedStyleBorrowed ctx);
|
2017-07-18 09:02:13 +03:00
|
|
|
|
2017-05-08 11:04:31 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_MightHaveAttributeDependency, bool,
|
|
|
|
RawServoStyleSetBorrowed set,
|
2017-06-28 08:18:02 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* local_name)
|
2017-05-09 13:13:45 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_HasStateDependency, bool,
|
|
|
|
RawServoStyleSetBorrowed set,
|
2017-06-28 08:18:02 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-05-09 13:13:45 +03:00
|
|
|
uint64_t state)
|
2017-11-01 13:20:39 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_HasDocumentStateDependency, bool,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
uint64_t state)
|
2016-08-19 14:44:43 +03:00
|
|
|
|
2016-11-23 02:26:20 +03:00
|
|
|
// CSSRuleList
|
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_ListTypes, void,
|
|
|
|
ServoCssRulesBorrowed rules,
|
|
|
|
nsTArrayBorrowed_uintptr_t result)
|
2016-11-29 14:59:55 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_InsertRule, nsresult,
|
|
|
|
ServoCssRulesBorrowed rules,
|
2017-06-29 04:07:06 +03:00
|
|
|
RawServoStyleSheetContentsBorrowed sheet,
|
|
|
|
const nsACString* rule,
|
|
|
|
uint32_t index,
|
|
|
|
bool nested,
|
|
|
|
mozilla::css::Loader* loader,
|
2018-04-30 18:50:03 +03:00
|
|
|
mozilla::StyleSheet* gecko_stylesheet,
|
2017-04-03 13:04:32 +03:00
|
|
|
uint16_t* rule_type)
|
2016-11-29 14:59:55 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_DeleteRule, nsresult,
|
|
|
|
ServoCssRulesBorrowed rules, uint32_t index)
|
2016-11-23 02:26:20 +03:00
|
|
|
|
2016-11-23 02:26:20 +03:00
|
|
|
// CSS Rules
|
2017-05-19 09:12:34 +03: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 09:52:37 +03:00
|
|
|
#define BASIC_RULE_FUNCS(type_) \
|
|
|
|
SERVO_BINDING_FUNC(Servo_CssRules_Get##type_##RuleAt, \
|
|
|
|
RawServo##type_##RuleStrong, \
|
2017-04-25 17:24:39 +03:00
|
|
|
ServoCssRulesBorrowed rules, uint32_t index, \
|
|
|
|
uint32_t* line, uint32_t* column) \
|
2017-05-19 09:12:34 +03:00
|
|
|
BASIC_RULE_FUNCS_WITHOUT_GETTER(type_##Rule)
|
2017-04-26 10:57:57 +03:00
|
|
|
#define GROUP_RULE_FUNCS(type_) \
|
|
|
|
BASIC_RULE_FUNCS(type_) \
|
|
|
|
SERVO_BINDING_FUNC(Servo_##type_##Rule_GetRules, ServoCssRulesStrong, \
|
|
|
|
RawServo##type_##RuleBorrowed rule)
|
2018-06-01 13:35:39 +03:00
|
|
|
|
2017-03-14 09:52:37 +03:00
|
|
|
BASIC_RULE_FUNCS(Style)
|
2017-05-30 04:10:25 +03:00
|
|
|
BASIC_RULE_FUNCS(Import)
|
2017-05-19 09:12:34 +03:00
|
|
|
BASIC_RULE_FUNCS_WITHOUT_GETTER(Keyframe)
|
|
|
|
BASIC_RULE_FUNCS(Keyframes)
|
2017-04-26 10:57:57 +03:00
|
|
|
GROUP_RULE_FUNCS(Media)
|
2018-06-05 18:16:51 +03:00
|
|
|
GROUP_RULE_FUNCS(MozDocument)
|
2017-03-14 07:44:37 +03:00
|
|
|
BASIC_RULE_FUNCS(Namespace)
|
2017-03-31 05:25:22 +03:00
|
|
|
BASIC_RULE_FUNCS(Page)
|
2017-04-26 10:59:29 +03:00
|
|
|
GROUP_RULE_FUNCS(Supports)
|
2017-07-26 04:30:15 +03:00
|
|
|
BASIC_RULE_FUNCS(FontFeatureValues)
|
Bug 1449087 part 2 - Use Servo data to back @font-face rule. r=emilio
This patch does the following things:
* Create a new class ServoFontFaceRule for CSSOM of @font-face rule
which mostly follows how nsCSSFontFaceRule was implemented.
* Remove the old nsCSSFontFaceRule and binding code to create it.
* Have FontFace backed by Servo data via making mRule and mDescriptors
of the class hold RawServoFontFaceRule like ServoFontFaceRule.
To keep this patch small, it effectively just delays the conversion
from Servo data to nsCSSValue from parsing to using. This may cause
worse performance if the font set is flushed repeatedly. Supposing we
don't flush font set very frequently, it may not be a big deal.
We may still want to remove the intermediate nsCSSValue conversion at
some point, and have everything converted to their final form directly
when used, but that can happen in followups.
There are some unfortunate bits from this change:
* We lose style sheet for logging in FontFaceSet. This is probably not
all that worse, because we wouldn't have that before either if the
page doesn't use CSSOM to visit it. But we should figure out some
approach to fix it anyway.
* InspectorFontFace no longer shares the same rule object as CSSOM.
This isn't really a problem if the @font-face rule isn't very mutable.
Unless we want to make the rule returned from InspectorFontFace to be
mutable (i.e. via inspector), not using the same object probably isn't
too bad.
This patch switches the code we use to serialize stuff in FontFace and
CSSFontFaceRule, which leads to some failures in tests. Specifically,
the expected changes including:
* Value of font-family now can be serialized to identifier sequence like
font-family property. The old code always serializes it to string,
but it doesn't seem to have different requirement than the property.
Blink can serialize to identifier as well.
* Family name inside local() is also changed to use the same way as
family names elsewhere (i.e. can be identifier sequence). Blink has
the same behavior as the old code, but I don't think it's a big deal.
* The order of descriptors serialized gets changed. I don't think it
matters at all.
* Empty string as font-family via using string syntax is no longer
considered invalid for FontFace. I don't find it is mentioned anywhere
that it should be specifically treated invalid.
MozReview-Commit-ID: 32Fk3Fi9uTs
--HG--
extra : rebase_source : 6221ec8fc56de357b06dd27e770fb175348a2f77
2018-04-04 01:42:10 +03:00
|
|
|
BASIC_RULE_FUNCS(FontFace)
|
2018-04-05 01:41:28 +03:00
|
|
|
BASIC_RULE_FUNCS(CounterStyle)
|
2017-04-26 10:57:57 +03:00
|
|
|
#undef GROUP_RULE_FUNCS
|
2017-03-14 09:52:37 +03:00
|
|
|
#undef BASIC_RULE_FUNCS
|
2017-05-19 09:12:34 +03:00
|
|
|
#undef BASIC_RULE_FUNCS_WITHOUT_GETTER
|
2016-11-23 02:26:20 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_GetStyle, RawServoDeclarationBlockStrong,
|
|
|
|
RawServoStyleRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_SetStyle, void,
|
|
|
|
RawServoStyleRuleBorrowed rule,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2016-11-23 02:26:20 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_GetSelectorText, void,
|
|
|
|
RawServoStyleRuleBorrowed rule, nsAString* result)
|
2017-06-12 15:54:39 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_GetSelectorTextAtIndex, void,
|
2017-06-07 18:48:49 +03:00
|
|
|
RawServoStyleRuleBorrowed rule, uint32_t index,
|
|
|
|
nsAString* result)
|
2017-06-12 15:54:44 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_GetSpecificityAtIndex, void,
|
|
|
|
RawServoStyleRuleBorrowed rule, uint32_t index,
|
|
|
|
uint64_t* specificity)
|
2017-06-07 18:48:49 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_GetSelectorCount, void,
|
|
|
|
RawServoStyleRuleBorrowed rule, uint32_t* count)
|
2017-07-04 16:37:34 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_SelectorMatchesElement, bool,
|
|
|
|
RawServoStyleRuleBorrowed, RawGeckoElementBorrowed,
|
|
|
|
uint32_t index, mozilla::CSSPseudoElementType pseudo_type)
|
2018-04-15 15:24:25 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_StyleRule_SetSelectorText, bool,
|
|
|
|
RawServoStyleSheetContentsBorrowed sheet,
|
2018-04-14 19:05:44 +03:00
|
|
|
RawServoStyleRuleBorrowed rule, const nsAString* text)
|
2017-05-30 04:10:25 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ImportRule_GetHref, void,
|
|
|
|
RawServoImportRuleBorrowed rule, nsAString* result)
|
2017-06-29 04:07:06 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ImportRule_GetSheet,
|
2018-04-30 18:50:03 +03:00
|
|
|
const mozilla::StyleSheet*,
|
2017-05-30 04:10:25 +03:00
|
|
|
RawServoImportRuleBorrowed rule)
|
2018-02-15 03:39:35 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ImportRule_SetSheet,
|
|
|
|
void,
|
|
|
|
RawServoImportRuleBorrowed rule,
|
2018-04-30 18:50:03 +03:00
|
|
|
mozilla::StyleSheet* sheet);
|
2017-05-19 09:12:34 +03: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)
|
2017-10-03 01:05:19 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_GetName, nsAtom*,
|
2017-05-19 09:12:34 +03:00
|
|
|
RawServoKeyframesRuleBorrowed rule)
|
2017-10-03 01:05:19 +03:00
|
|
|
// This method takes an addrefed nsAtom.
|
2017-05-19 09:12:34 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_SetName, void,
|
2017-10-03 01:05:19 +03:00
|
|
|
RawServoKeyframesRuleBorrowed rule, nsAtom* name)
|
2017-05-19 09:12:34 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_GetCount, uint32_t,
|
|
|
|
RawServoKeyframesRuleBorrowed rule)
|
2017-09-04 08:38:23 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_GetKeyframeAt, RawServoKeyframeStrong,
|
|
|
|
RawServoKeyframesRuleBorrowed rule, uint32_t index,
|
|
|
|
uint32_t* line, uint32_t* column)
|
2017-05-19 09:12:34 +03:00
|
|
|
// 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,
|
2017-06-29 04:07:06 +03:00
|
|
|
RawServoStyleSheetContentsBorrowed sheet,
|
|
|
|
const nsACString* css)
|
2017-05-19 09:12:34 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_KeyframesRule_DeleteRule, void,
|
|
|
|
RawServoKeyframesRuleBorrowed rule, uint32_t index)
|
2017-03-09 07:10:11 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaRule_GetMedia, RawServoMediaListStrong,
|
|
|
|
RawServoMediaRuleBorrowed rule)
|
2017-10-03 01:05:19 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_NamespaceRule_GetPrefix, nsAtom*,
|
2017-03-14 07:44:37 +03:00
|
|
|
RawServoNamespaceRuleBorrowed rule)
|
2017-10-03 01:05:19 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_NamespaceRule_GetURI, nsAtom*,
|
2017-03-14 07:44:37 +03:00
|
|
|
RawServoNamespaceRuleBorrowed rule)
|
2017-03-31 05:25:22 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_PageRule_GetStyle, RawServoDeclarationBlockStrong,
|
|
|
|
RawServoPageRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_PageRule_SetStyle, void,
|
|
|
|
RawServoPageRuleBorrowed rule,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2017-04-26 10:59:29 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SupportsRule_GetConditionText, void,
|
|
|
|
RawServoSupportsRuleBorrowed rule, nsAString* result)
|
2018-06-05 18:16:51 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_MozDocumentRule_GetConditionText, void,
|
|
|
|
RawServoMozDocumentRuleBorrowed rule, nsAString* result)
|
2017-07-26 04:30:15 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_FontFeatureValuesRule_GetFontFamily, void,
|
|
|
|
RawServoFontFeatureValuesRuleBorrowed rule,
|
|
|
|
nsAString* result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFeatureValuesRule_GetValueText, void,
|
|
|
|
RawServoFontFeatureValuesRuleBorrowed rule,
|
|
|
|
nsAString* result)
|
Bug 1449087 part 2 - Use Servo data to back @font-face rule. r=emilio
This patch does the following things:
* Create a new class ServoFontFaceRule for CSSOM of @font-face rule
which mostly follows how nsCSSFontFaceRule was implemented.
* Remove the old nsCSSFontFaceRule and binding code to create it.
* Have FontFace backed by Servo data via making mRule and mDescriptors
of the class hold RawServoFontFaceRule like ServoFontFaceRule.
To keep this patch small, it effectively just delays the conversion
from Servo data to nsCSSValue from parsing to using. This may cause
worse performance if the font set is flushed repeatedly. Supposing we
don't flush font set very frequently, it may not be a big deal.
We may still want to remove the intermediate nsCSSValue conversion at
some point, and have everything converted to their final form directly
when used, but that can happen in followups.
There are some unfortunate bits from this change:
* We lose style sheet for logging in FontFaceSet. This is probably not
all that worse, because we wouldn't have that before either if the
page doesn't use CSSOM to visit it. But we should figure out some
approach to fix it anyway.
* InspectorFontFace no longer shares the same rule object as CSSOM.
This isn't really a problem if the @font-face rule isn't very mutable.
Unless we want to make the rule returned from InspectorFontFace to be
mutable (i.e. via inspector), not using the same object probably isn't
too bad.
This patch switches the code we use to serialize stuff in FontFace and
CSSFontFaceRule, which leads to some failures in tests. Specifically,
the expected changes including:
* Value of font-family now can be serialized to identifier sequence like
font-family property. The old code always serializes it to string,
but it doesn't seem to have different requirement than the property.
Blink can serialize to identifier as well.
* Family name inside local() is also changed to use the same way as
family names elsewhere (i.e. can be identifier sequence). Blink has
the same behavior as the old code, but I don't think it's a big deal.
* The order of descriptors serialized gets changed. I don't think it
matters at all.
* Empty string as font-family via using string syntax is no longer
considered invalid for FontFace. I don't find it is mentioned anywhere
that it should be specifically treated invalid.
MozReview-Commit-ID: 32Fk3Fi9uTs
--HG--
extra : rebase_source : 6221ec8fc56de357b06dd27e770fb175348a2f77
2018-04-04 01:42:10 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_CreateEmpty, RawServoFontFaceRuleStrong)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_Clone, RawServoFontFaceRuleStrong,
|
|
|
|
RawServoFontFaceRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_GetSourceLocation, void,
|
|
|
|
RawServoFontFaceRuleBorrowed rule,
|
|
|
|
uint32_t* line, uint32_t* column)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_Length, uint32_t,
|
|
|
|
RawServoFontFaceRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_IndexGetter, nsCSSFontDesc,
|
|
|
|
RawServoFontFaceRuleBorrowed rule, uint32_t index)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_GetDeclCssText, void,
|
|
|
|
RawServoFontFaceRuleBorrowed rule, nsAString* result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_GetDescriptor, void,
|
|
|
|
RawServoFontFaceRuleBorrowed rule,
|
|
|
|
nsCSSFontDesc desc, nsCSSValueBorrowedMut result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_GetDescriptorCssText, void,
|
|
|
|
RawServoFontFaceRuleBorrowed rule,
|
|
|
|
nsCSSFontDesc desc, nsAString* result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_SetDescriptor, bool,
|
|
|
|
RawServoFontFaceRuleBorrowed rule,
|
|
|
|
nsCSSFontDesc desc, const nsACString* value,
|
|
|
|
RawGeckoURLExtraData* data)
|
|
|
|
SERVO_BINDING_FUNC(Servo_FontFaceRule_ResetDescriptor, void,
|
|
|
|
RawServoFontFaceRuleBorrowed rule,
|
|
|
|
nsCSSFontDesc desc)
|
2018-04-05 01:41:28 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_GetName, nsAtom*,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_SetName, bool,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule,
|
|
|
|
const nsACString* name)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_GetGeneration, uint32_t,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_GetSystem, uint8_t,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_GetExtended, nsAtom*,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_GetFixedFirstValue, int32_t,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_GetFallback, nsAtom*,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_GetDescriptor, void,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule,
|
|
|
|
nsCSSCounterDesc desc, nsCSSValueBorrowedMut result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_GetDescriptorCssText, void,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule,
|
|
|
|
nsCSSCounterDesc desc, nsAString* result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_CounterStyleRule_SetDescriptor, bool,
|
|
|
|
RawServoCounterStyleRuleBorrowed rule,
|
|
|
|
nsCSSCounterDesc desc, const nsACString* value)
|
2016-11-23 02:26:20 +03:00
|
|
|
|
2016-09-16 04:24:05 +03:00
|
|
|
// Animations API
|
|
|
|
SERVO_BINDING_FUNC(Servo_ParseProperty,
|
2016-10-18 07:29:03 +03:00
|
|
|
RawServoDeclarationBlockStrong,
|
2017-04-15 01:37:34 +03:00
|
|
|
nsCSSPropertyID property, const nsACString* value,
|
2017-05-11 02:29:36 +03:00
|
|
|
RawGeckoURLExtraData* data,
|
2017-05-14 18:11:18 +03:00
|
|
|
mozilla::ParsingMode parsing_mode,
|
2017-07-11 00:52:00 +03:00
|
|
|
nsCompatibility quirks_mode,
|
|
|
|
mozilla::css::Loader* loader)
|
2017-03-21 09:27:46 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ParseEasing, bool,
|
|
|
|
const nsAString* easing,
|
2017-03-30 10:54:48 +03:00
|
|
|
RawGeckoURLExtraData* data,
|
2017-03-21 09:27:46 +03:00
|
|
|
nsTimingFunctionBorrowedMut output)
|
2017-02-23 03:52:43 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetComputedKeyframeValues, void,
|
|
|
|
RawGeckoKeyframeListBorrowed keyframes,
|
2017-06-02 03:38:22 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed style,
|
2017-03-11 04:40:47 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
2017-02-23 03:52:43 +03:00
|
|
|
RawGeckoComputedKeyframeValuesListBorrowedMut result)
|
2017-04-06 04:34:50 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_ExtractAnimationValue,
|
|
|
|
RawServoAnimationValueStrong,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed computed_values,
|
2017-04-06 04:34:50 +03:00
|
|
|
nsCSSPropertyID property)
|
2017-06-26 08:16:18 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_SpecifiesAnimationsOrTransitions, bool,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed computed_values)
|
2017-04-12 11:37:09 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_IsAnimatable, bool,
|
|
|
|
nsCSSPropertyID property)
|
2017-06-15 03:54:06 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_IsTransitionable, bool,
|
|
|
|
nsCSSPropertyID property)
|
2017-04-12 11:31:12 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_IsDiscreteAnimatable, bool,
|
|
|
|
nsCSSPropertyID property)
|
2017-05-19 10:58:47 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetProperties_Overriding_Animation, void,
|
|
|
|
RawGeckoElementBorrowed,
|
|
|
|
RawGeckoCSSPropertyIDListBorrowed,
|
|
|
|
nsCSSPropertyIDSetBorrowedMut)
|
2017-06-07 06:25:14 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_MatrixTransform_Operate, void,
|
|
|
|
nsStyleTransformMatrix::MatrixTransformOperator
|
|
|
|
matrix_operator,
|
|
|
|
const RawGeckoGfxMatrix4x4* from,
|
|
|
|
const RawGeckoGfxMatrix4x4* to,
|
|
|
|
double progress,
|
|
|
|
RawGeckoGfxMatrix4x4* result)
|
2017-06-09 00:19:37 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetAnimationValues, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
RawGeckoElementBorrowed element,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed style,
|
2017-06-09 00:19:37 +03:00
|
|
|
RawServoStyleSetBorrowed style_set,
|
|
|
|
RawGeckoServoAnimationValueListBorrowedMut animation_values)
|
2016-09-16 04:24:05 +03:00
|
|
|
|
2016-12-01 04:34:54 +03:00
|
|
|
// AnimationValues handling
|
2017-01-24 10:21:52 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_Interpolate,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
RawServoAnimationValueBorrowed from,
|
|
|
|
RawServoAnimationValueBorrowed to,
|
|
|
|
double progress)
|
2017-04-12 11:26:59 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_IsInterpolable, bool,
|
|
|
|
RawServoAnimationValueBorrowed from,
|
|
|
|
RawServoAnimationValueBorrowed to)
|
2017-06-05 04:36:27 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_Add,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
RawServoAnimationValueBorrowed a,
|
|
|
|
RawServoAnimationValueBorrowed b)
|
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_Accumulate,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
RawServoAnimationValueBorrowed a,
|
|
|
|
RawServoAnimationValueBorrowed b,
|
|
|
|
uint64_t count)
|
2017-06-05 04:28:17 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_GetZeroValue,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
RawServoAnimationValueBorrowed value_to_match)
|
2017-04-21 06:31:41 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValues_ComputeDistance, double,
|
|
|
|
RawServoAnimationValueBorrowed from,
|
|
|
|
RawServoAnimationValueBorrowed to)
|
2017-02-09 06:33:17 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_Serialize, void,
|
|
|
|
RawServoAnimationValueBorrowed value,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
nsAString* buffer)
|
2017-02-10 07:03:08 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_GetOpacity, float,
|
2017-02-08 06:31:15 +03:00
|
|
|
RawServoAnimationValueBorrowed value)
|
2017-10-27 22:04:52 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_Opacity,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
float)
|
2017-02-10 07:03:08 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_GetTransform, void,
|
2017-02-08 06:36:41 +03:00
|
|
|
RawServoAnimationValueBorrowed value,
|
|
|
|
RefPtr<nsCSSValueSharedList>* list)
|
2017-10-27 22:06:30 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_Transform,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
const nsCSSValueSharedList& list)
|
2017-02-24 10:05:23 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_DeepEqual, bool,
|
|
|
|
RawServoAnimationValueBorrowed,
|
|
|
|
RawServoAnimationValueBorrowed)
|
2017-04-12 10:51:55 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_Uncompute,
|
|
|
|
RawServoDeclarationBlockStrong,
|
|
|
|
RawServoAnimationValueBorrowed value)
|
2017-05-03 06:15:27 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationValue_Compute,
|
|
|
|
RawServoAnimationValueStrong,
|
2017-06-02 03:38:22 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-05-03 06:15:27 +03:00
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed style,
|
2017-05-03 06:15:27 +03:00
|
|
|
RawServoStyleSetBorrowed raw_data)
|
2016-12-01 04:34:54 +03:00
|
|
|
|
2016-08-19 14:44:43 +03:00
|
|
|
// Style attribute
|
2016-10-18 07:29:03 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ParseStyleAttribute, RawServoDeclarationBlockStrong,
|
2017-03-11 05:28:02 +03:00
|
|
|
const nsACString* data,
|
2017-05-06 01:12:03 +03:00
|
|
|
RawGeckoURLExtraData* extra_data,
|
2017-07-11 00:52:00 +03:00
|
|
|
nsCompatibility quirks_mode,
|
|
|
|
mozilla::css::Loader* loader)
|
2016-11-03 06:41:02 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_CreateEmpty,
|
|
|
|
RawServoDeclarationBlockStrong)
|
2016-11-03 06:41:02 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_Clone, RawServoDeclarationBlockStrong,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations)
|
2016-09-15 10:26:07 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_Equals, bool,
|
2016-10-18 07:29:03 +03:00
|
|
|
RawServoDeclarationBlockBorrowed a,
|
|
|
|
RawServoDeclarationBlockBorrowed b)
|
2016-11-03 06:41:02 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetCssText, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsAString* result)
|
2016-09-16 03:26:48 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SerializeOneValue, void,
|
2016-10-18 07:29:03 +03:00
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2017-08-21 06:35:35 +03:00
|
|
|
nsCSSPropertyID property, nsAString* buffer,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowedOrNull computed_values,
|
2017-09-27 10:49:21 +03:00
|
|
|
RawServoDeclarationBlockBorrowedOrNull custom_properties)
|
2016-11-03 06:41:02 +03: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 06:41:02 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetPropertyValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2016-12-16 02:02:48 +03:00
|
|
|
const nsACString* property, nsAString* value)
|
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetPropertyValueById, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property, nsAString* value)
|
2016-11-03 06:41:02 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetPropertyIsImportant, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2016-12-16 02:02:48 +03:00
|
|
|
const nsACString* property)
|
2016-11-03 06:41:02 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetProperty, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2016-12-16 02:02:48 +03:00
|
|
|
const nsACString* property,
|
2017-02-23 04:19:04 +03:00
|
|
|
const nsACString* value, bool is_important,
|
2017-04-14 06:55:44 +03:00
|
|
|
RawGeckoURLExtraData* data,
|
2017-05-14 18:11:18 +03:00
|
|
|
mozilla::ParsingMode parsing_mode,
|
2017-07-11 00:52:00 +03:00
|
|
|
nsCompatibility quirks_mode,
|
2018-06-06 01:04:39 +03:00
|
|
|
mozilla::css::Loader* loader,
|
|
|
|
DeclarationBlockMutationClosure)
|
2018-05-03 19:27:44 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetPropertyToAnimationValue, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
RawServoAnimationValueBorrowed animation_value)
|
2016-12-16 02:02:48 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetPropertyById, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
2017-02-23 04:19:04 +03:00
|
|
|
const nsACString* value, bool is_important,
|
2017-04-14 06:55:44 +03:00
|
|
|
RawGeckoURLExtraData* data,
|
2017-05-14 18:11:18 +03:00
|
|
|
mozilla::ParsingMode parsing_mode,
|
2017-07-11 00:52:00 +03:00
|
|
|
nsCompatibility quirks_mode,
|
2018-06-06 01:04:39 +03:00
|
|
|
mozilla::css::Loader* loader,
|
|
|
|
DeclarationBlockMutationClosure)
|
2018-02-05 08:07:44 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemoveProperty, bool,
|
2016-11-03 06:41:02 +03:00
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2018-06-06 01:04:39 +03:00
|
|
|
const nsACString* property,
|
|
|
|
DeclarationBlockMutationClosure)
|
2017-10-19 10:51:12 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemovePropertyById, bool,
|
2016-12-16 02:02:48 +03:00
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
2018-06-06 01:04:39 +03:00
|
|
|
nsCSSPropertyID property,
|
|
|
|
DeclarationBlockMutationClosure)
|
2017-04-15 01:37:34 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_HasCSSWideKeyword, bool,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property)
|
2017-04-06 04:34:51 +03:00
|
|
|
// Compose animation value for a given property.
|
|
|
|
// |base_values| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.
|
2017-10-27 22:09:11 +03:00
|
|
|
// We use RawServoAnimationValueTableBorrowed to avoid exposing
|
|
|
|
// nsRefPtrHashtable in FFI.
|
2017-04-06 04:34:51 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_AnimationCompose, void,
|
2017-05-01 12:45:41 +03:00
|
|
|
RawServoAnimationValueMapBorrowedMut animation_values,
|
2017-08-02 21:24:35 +03:00
|
|
|
RawServoAnimationValueTableBorrowed base_values,
|
2017-04-06 04:34:51 +03:00
|
|
|
nsCSSPropertyID property,
|
2017-04-06 04:34:51 +03:00
|
|
|
RawGeckoAnimationPropertySegmentBorrowed animation_segment,
|
2017-05-24 05:14:35 +03:00
|
|
|
RawGeckoAnimationPropertySegmentBorrowed last_segment,
|
|
|
|
RawGeckoComputedTimingBorrowed computed_timing,
|
2017-10-27 22:09:11 +03:00
|
|
|
mozilla::dom::IterationCompositeOperation iter_composite)
|
|
|
|
// Calculate the result of interpolating given animation segment at the given
|
|
|
|
// progress and current iteration.
|
|
|
|
// This includes combining the segment endpoints with the underlying value
|
|
|
|
// and/or last value depending the composite modes specified on the
|
|
|
|
// segment endpoints and the supplied iteration composite mode.
|
|
|
|
// The caller is responsible for providing an underlying value and
|
|
|
|
// last value in all situations where there are needed.
|
|
|
|
SERVO_BINDING_FUNC(Servo_ComposeAnimationSegment,
|
|
|
|
RawServoAnimationValueStrong,
|
|
|
|
RawGeckoAnimationPropertySegmentBorrowed animation_segment,
|
|
|
|
RawServoAnimationValueBorrowedOrNull underlying_value,
|
|
|
|
RawServoAnimationValueBorrowedOrNull last_value,
|
|
|
|
mozilla::dom::IterationCompositeOperation iter_composite,
|
|
|
|
double progress,
|
|
|
|
uint64_t current_iteration)
|
2017-02-13 03:02:29 +03: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-10-03 01:05:19 +03:00
|
|
|
nsAtom* value)
|
2017-02-13 03:02:29 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetKeywordValue, void,
|
2017-01-20 02:56:53 +03:00
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
2017-02-13 03:02:29 +03: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 10:28:48 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetLengthValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
float value,
|
|
|
|
nsCSSUnit unit)
|
2017-04-10 10:28:48 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetNumberValue, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsCSSPropertyID property,
|
|
|
|
float value)
|
2017-02-13 03:02:29 +03: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 10:28:48 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetBackgroundImage, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
const nsAString& value,
|
|
|
|
RawGeckoURLExtraData* extra_data)
|
2016-08-19 14:44:43 +03:00
|
|
|
|
2017-03-09 09:56:31 +03:00
|
|
|
// MediaList
|
2017-04-10 03:01:38 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_Create, RawServoMediaListStrong)
|
2017-04-10 09:36:45 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_DeepClone, RawServoMediaListStrong,
|
|
|
|
RawServoMediaListBorrowed list)
|
2017-04-10 05:25:33 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_Matches, bool,
|
|
|
|
RawServoMediaListBorrowed list,
|
|
|
|
RawServoStyleSetBorrowed set)
|
2017-03-09 09:56:31 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_GetText, void,
|
|
|
|
RawServoMediaListBorrowed list, nsAString* result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_SetText, void,
|
2017-10-19 17:16:02 +03:00
|
|
|
RawServoMediaListBorrowed list, const nsACString* text,
|
|
|
|
mozilla::dom::CallerType aCallerType)
|
2017-03-09 09:56:31 +03:00
|
|
|
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)
|
2018-07-06 04:09:12 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_MediaList_SizeOfIncludingThis, size_t,
|
|
|
|
mozilla::MallocSizeOf malloc_size_of,
|
|
|
|
mozilla::MallocSizeOf malloc_enclosing_size_of,
|
|
|
|
RawServoMediaListBorrowed list)
|
2017-03-09 09:56:31 +03:00
|
|
|
|
2016-08-19 14:44:43 +03:00
|
|
|
// CSS supports()
|
2017-01-16 10:09:42 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_CSSSupports2, bool,
|
2016-10-25 02:19:45 +03:00
|
|
|
const nsACString* name, const nsACString* value)
|
2017-01-16 10:09:42 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_CSSSupports, bool,
|
|
|
|
const nsACString* cond)
|
2016-08-19 14:44:43 +03:00
|
|
|
|
|
|
|
// Computed style data
|
2016-08-23 06:14:27 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_GetForAnonymousBox,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleStrong,
|
|
|
|
ComputedStyleBorrowedOrNull parent_style_or_null,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* pseudo_tag,
|
2017-03-13 19:53:45 +03:00
|
|
|
RawServoStyleSetBorrowed set)
|
2018-03-22 21:20:41 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_Inherit, ComputedStyleStrong,
|
2017-01-04 22:52:27 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* pseudo_tag,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowedOrNull parent_style,
|
2017-04-28 14:10:00 +03:00
|
|
|
mozilla::InheritTarget target)
|
2018-05-24 18:49:24 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_GetStyleBits, uint8_t,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed values)
|
2017-07-13 11:49:14 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_EqualCustomProperties, bool,
|
2017-07-21 07:44:02 +03:00
|
|
|
ServoComputedDataBorrowed first,
|
|
|
|
ServoComputedDataBorrowed second)
|
2017-07-10 02:38:58 +03:00
|
|
|
// Gets the source style rules for the computed values. This returns
|
|
|
|
// the result via rules, which would include a list of unowned pointers
|
|
|
|
// to RawServoStyleRule.
|
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_GetStyleRuleList, void,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed values,
|
2017-07-10 02:38:58 +03:00
|
|
|
RawGeckoServoStyleRuleListBorrowedMut rules)
|
2016-08-19 14:44:43 +03:00
|
|
|
|
|
|
|
// Initialize Servo components. Should be called exactly once at startup.
|
2017-04-04 06:21:16 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Initialize, void,
|
|
|
|
RawGeckoURLExtraData* dummy_url_data)
|
2017-09-09 02:50:34 +03:00
|
|
|
// Initialize Servo on a cooperative Quantum DOM thread.
|
|
|
|
SERVO_BINDING_FUNC(Servo_InitializeCooperativeThread, void);
|
2016-08-19 14:44:43 +03:00
|
|
|
// Shut down Servo components. Should be called exactly once at shutdown.
|
|
|
|
SERVO_BINDING_FUNC(Servo_Shutdown, void)
|
|
|
|
|
2016-11-02 09:11:24 +03:00
|
|
|
// Restyle and change hints.
|
|
|
|
SERVO_BINDING_FUNC(Servo_NoteExplicitHints, void, RawGeckoElementBorrowed element,
|
|
|
|
nsRestyleHint restyle_hint, nsChangeHint change_hint)
|
2017-08-15 06:11:53 +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.
|
2017-07-15 07:09:35 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_TakeChangeHint,
|
2017-08-15 06:11:53 +03:00
|
|
|
uint32_t,
|
2017-07-15 07:09:35 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-07-15 07:16:11 +03:00
|
|
|
bool* was_restyled)
|
2018-03-22 21:20:41 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ResolveStyle, ComputedStyleStrong,
|
2017-01-04 22:52:27 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-08-11 22:55:32 +03:00
|
|
|
RawServoStyleSetBorrowed set)
|
2018-03-22 21:20:41 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ResolvePseudoStyle, ComputedStyleStrong,
|
2017-05-14 19:39:22 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
|
|
|
mozilla::CSSPseudoElementType pseudo_type,
|
2017-06-27 09:35:09 +03:00
|
|
|
bool is_probe,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowedOrNull inherited_style,
|
2017-06-27 09:35:09 +03:00
|
|
|
RawServoStyleSetBorrowed set)
|
2017-10-20 13:31:13 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ComputedValues_ResolveXULTreePseudoStyle,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleStrong,
|
2017-10-20 13:31:13 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
|
|
|
nsAtom* pseudo_tag,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed inherited_style,
|
2017-10-20 13:31:13 +03:00
|
|
|
const mozilla::AtomArray* input_word,
|
|
|
|
RawServoStyleSetBorrowed set)
|
2017-06-26 08:16:18 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_SetExplicitStyle, void,
|
|
|
|
RawGeckoElementBorrowed element,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed primary_style)
|
2017-05-10 23:11:36 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_HasAuthorSpecifiedRules, bool,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed style,
|
2017-05-10 23:11:36 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-10-10 10:35:10 +03:00
|
|
|
mozilla::CSSPseudoElementType pseudo_type,
|
2017-05-10 23:11:36 +03:00
|
|
|
uint32_t rule_type_mask,
|
|
|
|
bool author_colors_allowed)
|
2016-08-19 14:44:43 +03:00
|
|
|
|
2016-12-28 10:49:12 +03: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.
|
2018-03-22 21:20:41 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ResolveStyleLazily, ComputedStyleStrong,
|
2017-05-07 17:36:47 +03:00
|
|
|
RawGeckoElementBorrowed element,
|
2017-05-14 19:39:22 +03:00
|
|
|
mozilla::CSSPseudoElementType pseudo_type,
|
2017-05-24 09:37:47 +03:00
|
|
|
mozilla::StyleRuleInclusion rule_inclusion,
|
2017-05-07 17:36:47 +03:00
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots,
|
2018-02-21 15:02:23 +03:00
|
|
|
RawServoStyleSetBorrowed set)
|
2016-12-28 10:49:12 +03:00
|
|
|
|
2017-07-29 04:20:41 +03:00
|
|
|
// Reparents style to the new parents.
|
2018-03-22 21:20:41 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ReparentStyle, ComputedStyleStrong,
|
|
|
|
ComputedStyleBorrowed style_to_reparent,
|
|
|
|
ComputedStyleBorrowed parent_style,
|
|
|
|
ComputedStyleBorrowed parent_style_ignoring_first_line,
|
|
|
|
ComputedStyleBorrowed layout_parent_style,
|
2017-07-29 04:20:41 +03:00
|
|
|
// element is null if there is no content node involved, or
|
|
|
|
// if it's not an element.
|
|
|
|
RawGeckoElementBorrowedOrNull element,
|
|
|
|
RawServoStyleSetBorrowed set);
|
|
|
|
|
2017-01-20 02:56:53 +03:00
|
|
|
// Use ServoStyleSet::PrepareAndTraverseSubtree instead of calling this
|
|
|
|
// directly
|
2017-05-07 17:36:47 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_TraverseSubtree,
|
|
|
|
bool,
|
|
|
|
RawGeckoElementBorrowed root,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots,
|
2017-07-26 04:45:37 +03:00
|
|
|
mozilla::ServoTraversalFlags flags)
|
2016-11-02 09:11:24 +03:00
|
|
|
|
|
|
|
// Assert that the tree has no pending or unconsumed restyles.
|
|
|
|
SERVO_BINDING_FUNC(Servo_AssertTreeIsClean, void, RawGeckoElementBorrowed root)
|
2016-08-19 14:44:43 +03:00
|
|
|
|
2017-09-19 04:26:29 +03:00
|
|
|
// Returns true if the current thread is a Servo parallel worker thread.
|
|
|
|
SERVO_BINDING_FUNC(Servo_IsWorkerThread, bool, )
|
|
|
|
|
2017-06-16 20:20:25 +03:00
|
|
|
// Checks whether the rule tree has crossed its threshold for unused rule nodes,
|
|
|
|
// and if so, frees them.
|
|
|
|
SERVO_BINDING_FUNC(Servo_MaybeGCRuleTree, void, RawServoStyleSetBorrowed set)
|
|
|
|
|
2017-04-06 04:34:50 +03:00
|
|
|
// Returns computed values for the given element without any animations rules.
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetBaseComputedValuesForElement,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleStrong,
|
2017-04-06 04:34:50 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawGeckoElementBorrowed element,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed existing_style,
|
2017-11-22 05:03:40 +03:00
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots)
|
2017-10-19 05:51:55 +03:00
|
|
|
// Returns computed values for the given element by adding an animation value.
|
|
|
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetComputedValuesByAddingAnimation,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleStrong,
|
2017-10-19 05:51:55 +03:00
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawGeckoElementBorrowed element,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed existing_style,
|
2017-10-19 05:51:55 +03:00
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots,
|
|
|
|
RawServoAnimationValueBorrowed animation)
|
2017-04-06 04:34:50 +03:00
|
|
|
|
2017-05-20 01:38:26 +03:00
|
|
|
// For canvas font.
|
|
|
|
SERVO_BINDING_FUNC(Servo_SerializeFontValueForCanvas, void,
|
|
|
|
RawServoDeclarationBlockBorrowed declarations,
|
|
|
|
nsAString* buffer)
|
|
|
|
|
2018-06-07 21:27:57 +03:00
|
|
|
// GetComputedStyle APIs.
|
2017-06-29 05:25:10 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetCustomPropertyValue, bool,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed computed_values,
|
2017-06-22 21:06:57 +03:00
|
|
|
const nsAString* name, nsAString* value)
|
|
|
|
|
2017-06-29 05:25:10 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetCustomPropertiesCount, uint32_t,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed computed_values)
|
2017-06-29 05:25:10 +03:00
|
|
|
|
2017-06-29 05:25:10 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetCustomPropertyNameAt, bool,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyleBorrowed, uint32_t index,
|
2017-06-29 05:25:10 +03:00
|
|
|
nsAString* name)
|
|
|
|
|
2018-06-07 21:27:57 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetPropertyValue, void,
|
|
|
|
ComputedStyleBorrowed computed_values,
|
|
|
|
nsCSSPropertyID property, nsAString* value)
|
2017-07-18 09:02:13 +03:00
|
|
|
|
2017-08-24 10:36:48 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ProcessInvalidations, void,
|
|
|
|
RawServoStyleSetBorrowed set,
|
|
|
|
RawGeckoElementBorrowed element,
|
|
|
|
const mozilla::ServoElementSnapshotTable* snapshots)
|
|
|
|
|
|
|
|
|
2017-09-06 10:42:05 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_HasPendingRestyleAncestor, bool,
|
|
|
|
RawGeckoElementBorrowed element)
|
|
|
|
|
2017-09-15 23:11:37 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_GetArcStringData, void,
|
2017-09-26 05:21:37 +03:00
|
|
|
const RustString*, uint8_t const** chars, uint32_t* len);
|
2017-09-15 23:11:37 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ReleaseArcStringData, void,
|
2017-09-26 04:13:36 +03:00
|
|
|
const mozilla::ServoRawOffsetArc<RustString>* string);
|
2017-09-15 23:11:37 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_CloneArcStringData, mozilla::ServoRawOffsetArc<RustString>,
|
2017-09-26 04:13:36 +03:00
|
|
|
const mozilla::ServoRawOffsetArc<RustString>* string);
|
2017-09-06 10:42:05 +03:00
|
|
|
|
2017-10-16 03:54:47 +03:00
|
|
|
// CSS parsing utility functions.
|
|
|
|
SERVO_BINDING_FUNC(Servo_IsValidCSSColor, bool, const nsAString* value);
|
|
|
|
SERVO_BINDING_FUNC(Servo_ComputeColor, bool,
|
|
|
|
RawServoStyleSetBorrowedOrNull set,
|
|
|
|
nscolor current_color,
|
|
|
|
const nsAString* value,
|
2017-11-30 12:27:18 +03:00
|
|
|
nscolor* result_color,
|
2017-12-04 07:53:57 +03:00
|
|
|
bool* was_current_color,
|
|
|
|
mozilla::css::Loader* loader)
|
2018-04-05 11:27:33 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_IntersectionObserverRootMargin_Parse, bool,
|
|
|
|
const nsAString* value, nsStyleSides* result)
|
|
|
|
SERVO_BINDING_FUNC(Servo_IntersectionObserverRootMargin_ToString, void,
|
|
|
|
const nsStyleSides* rect, nsAString* result)
|
2017-11-27 09:27:56 +03:00
|
|
|
// Returning false means the parsed transform contains relative lengths or
|
|
|
|
// percentage value, so we cannot compute the matrix. In this case, we keep
|
|
|
|
// |result| and |contains_3d_transform| as-is.
|
|
|
|
SERVO_BINDING_FUNC(Servo_ParseTransformIntoMatrix, bool,
|
|
|
|
const nsAString* value,
|
|
|
|
bool* contains_3d_transform,
|
|
|
|
RawGeckoGfxMatrix4x4* result);
|
2017-12-05 08:51:05 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ParseFontShorthandForMatching, bool,
|
|
|
|
const nsAString* value,
|
|
|
|
RawGeckoURLExtraData* data,
|
|
|
|
RefPtr<SharedFontList>* family,
|
|
|
|
nsCSSValueBorrowedMut style,
|
|
|
|
nsCSSValueBorrowedMut stretch,
|
|
|
|
nsCSSValueBorrowedMut weight);
|
|
|
|
|
2018-06-30 16:45:43 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_ResolveLogicalProperty,
|
|
|
|
nsCSSPropertyID,
|
|
|
|
nsCSSPropertyID,
|
|
|
|
ComputedStyleBorrowed);
|
2018-07-30 18:32:17 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_LookupEnabledForAllContent,
|
|
|
|
nsCSSPropertyID,
|
|
|
|
const nsACString* name);
|
2018-07-30 19:04:05 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_GetName,
|
|
|
|
const uint8_t*,
|
|
|
|
nsCSSPropertyID,
|
|
|
|
uint32_t* out_length);
|
2018-03-18 15:56:09 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_IsShorthand, bool,
|
|
|
|
const nsACString* name, bool* found);
|
2018-04-09 07:33:30 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_IsInherited, bool,
|
|
|
|
const nsACString* name);
|
2018-04-26 02:01:02 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_SupportsType, bool,
|
|
|
|
const nsACString* name, uint32_t ty, bool* found);
|
2018-04-29 02:03:31 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_Property_GetCSSValuesForProperty, void,
|
|
|
|
const nsACString* name, bool* found, nsTArray<nsString>* result)
|
2018-03-28 01:41:04 +03:00
|
|
|
SERVO_BINDING_FUNC(Servo_PseudoClass_GetStates, uint64_t,
|
|
|
|
const nsACString* name)
|
2017-10-16 03:54:47 +03:00
|
|
|
|
2016-11-23 03:35:55 +03: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
|