mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
dom: Use pref macro for IDL conditional guards.
This commit is contained in:
parent
714acb942c
commit
aa80f91399
38 changed files with 8 additions and 109 deletions
|
@ -2662,7 +2662,7 @@ class CGConstructorEnabled(CGAbstractMethod):
|
|||
pref = iface.getExtendedAttribute("Pref")
|
||||
if pref:
|
||||
assert isinstance(pref, list) and len(pref) == 1
|
||||
conditions.append('prefs::pref_map().get("%s").as_bool().unwrap_or(false)' % pref[0])
|
||||
conditions.append('pref!(%s)' % pref[0])
|
||||
|
||||
func = iface.getExtendedAttribute("Func")
|
||||
if func:
|
||||
|
|
|
@ -148,12 +148,12 @@ interface mixin CanvasUserInterface {
|
|||
[Exposed=(PaintWorklet, Window, Worker)]
|
||||
interface mixin CanvasText {
|
||||
// text (see also the CanvasPathDrawingStyles and CanvasTextDrawingStyles interfaces)
|
||||
[Pref="dom.canvas-text.enabled"]
|
||||
[Pref="dom.canvas_text.enabled"]
|
||||
void fillText(DOMString text, unrestricted double x, unrestricted double y,
|
||||
optional unrestricted double maxWidth);
|
||||
//void strokeText(DOMString text, unrestricted double x, unrestricted double y,
|
||||
// optional unrestricted double maxWidth);
|
||||
[Pref="dom.canvas-text.enabled"]
|
||||
[Pref="dom.canvas_text.enabled"]
|
||||
TextMetrics measureText(DOMString text);
|
||||
};
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
// https://w3c.github.io/uievents/#idl-compositionevent
|
||||
[Exposed=Window, Pref="dom.compositionevent.enabled"]
|
||||
[Exposed=Window, Pref="dom.composition_event.enabled"]
|
||||
interface CompositionEvent : UIEvent {
|
||||
[Throws] constructor(DOMString type, optional CompositionEventInit eventInitDict = {});
|
||||
readonly attribute DOMString data;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#customelementregistry
|
||||
[Exposed=Window, Pref="dom.customelements.enabled"]
|
||||
[Exposed=Window, Pref="dom.custom_elements.enabled"]
|
||||
interface CustomElementRegistry {
|
||||
[Throws, CEReactions]
|
||||
void define(DOMString name, CustomElementConstructor constructor_, optional ElementDefinitionOptions options = {});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#textmetrics
|
||||
[Exposed=(PaintWorklet, Window, Worker), Pref="dom.canvas-text.enabled"]
|
||||
[Exposed=(PaintWorklet, Window, Worker), Pref="dom.canvas_text.enabled"]
|
||||
interface TextMetrics {
|
||||
// x-direction
|
||||
readonly attribute double width; // advance width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue