Skip to content

Commit

Permalink
remove use of blacklist/whitelist terminology (#2622)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlacey authored Jun 8, 2020
1 parent 637b380 commit 52c6013
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions dev/CommonStyles/APITests/CommonStylesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ public void VerifyVisualTreeForCommandBarOverflowMenu()
});

var visualTreeDumperFilter = new VisualTreeDumper.DefaultFilter();
visualTreeDumperFilter.PropertyNameWhiteList.Remove("MaxWidth");
visualTreeDumperFilter.PropertyNameWhiteList.Remove("MaxHeight");
visualTreeDumperFilter.PropertyNameAllowedList.Remove("MaxWidth");
visualTreeDumperFilter.PropertyNameAllowedList.Remove("MaxHeight");
VisualTreeTestHelper.VerifyVisualTree(root: overflowContent, masterFilePrefix: "CommandBarOverflowMenu", filter: visualTreeDumperFilter);
}

Expand Down Expand Up @@ -305,9 +305,9 @@ public void VerifyVisualTreeExampleWithCustomerPropertyValueTranslator()
class CustomizedFilter : VisualTreeDumper.IFilter
{

private static readonly string[] _propertyNamePostfixBlackList = new string[] { "Property", "Transitions", "Template", "Style", "Selector" };
private static readonly string[] _propertyNamePostfixBlockList = new string[] { "Property", "Transitions", "Template", "Style", "Selector" };

private static readonly string[] _propertyNameBlackList = new string[] { "Interactions", "ColumnDefinitions", "RowDefinitions",
private static readonly string[] _propertyNameBlockList = new string[] { "Interactions", "ColumnDefinitions", "RowDefinitions",
"Children", "Resources", "Transitions", "Dispatcher", "TemplateSettings", "ContentTemplate", "ContentTransitions",
"ContentTemplateSelector", "Content", "ContentTemplateRoot", "XYFocusUp", "XYFocusRight", "XYFocusLeft", "Parent",
"Triggers", "RequestedTheme", "XamlRoot", "IsLoaded", "BaseUri", "Resources"};
Expand Down Expand Up @@ -394,8 +394,8 @@ public bool ShouldVisitElement(string elementName)

public bool ShouldVisitProperty(string propertyName)
{
return (_propertyNamePostfixBlackList.Where(item => propertyName.EndsWith(item)).Count()) == 0 &&
!_propertyNameBlackList.Contains(propertyName);
return (_propertyNamePostfixBlockList.Where(item => propertyName.EndsWith(item)).Count()) == 0 &&
!_propertyNameBlockList.Contains(propertyName);
}
}

Expand Down
2 changes: 1 addition & 1 deletion dev/PersonPicture/InitialsGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ CharacterType InitialsGenerator::GetCharacterType(const wstring_view &str)

CharacterType InitialsGenerator::GetCharacterType(wchar_t character)
{
// To ensure predictable behavior, we're currently operating on a whitelist of character sets.
// To ensure predictable behavior, we're currently operating on an allowed list of character sets.
//
// Each block below is a HEX range in the official Unicode spec, which defines a set
// of Unicode characters. Changes to the character sets would only be made by Unicode, and
Expand Down
12 changes: 6 additions & 6 deletions test/TestAppUtils/VisualTreeDumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ private static void WalkThroughTree(DependencyObject node, Visitor visitor)
public static readonly string ValueNULL = "[NULL]";
public class DefaultFilter : IFilter
{
private static readonly string[] _propertyNamePostfixWhiteList = new string[] {"Brush", "Thickness"};
private List<string> _propertyNameWhiteList = new List<string> {"Background", "Foreground", "Padding", "Margin", "RenderSize", "Visibility", "Name", "CornerRadius",
private static readonly string[] _propertyNamePostfixAllowedList = new string[] {"Brush", "Thickness"};
private List<string> _propertyNameAllowedList = new List<string> {"Background", "Foreground", "Padding", "Margin", "RenderSize", "Visibility", "Name", "CornerRadius",
"Width", "Height", "MinWidth", "MinHeight", "MaxWidth", "MaxHeight" };
private static readonly Dictionary<string, string> _ignorePropertyValues = new Dictionary<string, string> {
{"MinWidth","0" },
Expand All @@ -151,10 +151,10 @@ public class DefaultFilter : IFilter
{"MaxHeight","∞" },
};

public List<string> PropertyNameWhiteList
public List<string> PropertyNameAllowedList
{
get { return _propertyNameWhiteList; }
set { _propertyNameWhiteList = value; }
get { return _propertyNameAllowedList; }
set { _propertyNameAllowedList = value; }
}

public virtual bool ShouldVisitPropertyValuePair(string propertyName, string value)
Expand All @@ -175,7 +175,7 @@ public virtual bool ShouldVisitElement(string elementName)

public virtual bool ShouldVisitProperty(string propertyName)
{
return (_propertyNamePostfixWhiteList.Where(item => propertyName.EndsWith(item)).Count()) > 0 || _propertyNameWhiteList.Contains(propertyName);
return (_propertyNamePostfixAllowedList.Where(item => propertyName.EndsWith(item)).Count()) > 0 || _propertyNameAllowedList.Contains(propertyName);
}
}

Expand Down

0 comments on commit 52c6013

Please sign in to comment.