Implement standard interface for toggling experimental features

Summary: We want to start experimenting with changes to the library in a more controlled and easier to measure manner. This diff adds the basics of an experiment layer to csslayout.

Reviewed By: gkassabli

Differential Revision: D4174260

fbshipit-source-id: ad3667183810c02833fba9a1276f89286e848fcd
This commit is contained in:
Emil Sjolander
2016-11-14 03:27:33 -08:00
committed by Facebook Github Bot
parent b99172d28b
commit e6702e1168
8 changed files with 88 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
namespace Facebook.CSSLayout
{
public enum CSSExperimentalFeature
{
}
}

View File

@@ -550,5 +550,17 @@ namespace Facebook.CSSLayout
{
return Native.CSSNodeGetInstanceCount();
}
public static void setExperimentalFeatureEnabled(
CSSExperimentalFeature feature,
bool enabled)
{
return Native.CSSLayoutSetExperimentalFeatureEnabled(feature, enabled);
}
public static bool isExperimentalFeatureEnabled(CSSExperimentalFeature feature)
{
return Native.CSSLayoutIsExperimentalFeatureEnabled(feature);
}
}
}

View File

@@ -37,7 +37,13 @@ namespace Facebook.CSSLayout
public static extern void CSSNodeReset(IntPtr cssNode);
[DllImport(DllName)]
public static extern int CSSNodeGetInstanceCount();
public static extern void CSSLayoutSetExperimentalFeatureEnabled(
CSSExperimentalFeature feature,
bool enabled);
[DllImport(DllName)]
public static extern bool CSSLayoutIsExperimentalFeatureEnabled(
CSSExperimentalFeature feature);
[DllImport(DllName)]
public static extern void CSSNodeInsertChild(IntPtr node, IntPtr child, uint index);