Skip to content

Commit

Permalink
fix: Skip WebView.XYFocus properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ebariche committed Sep 21, 2021
1 parent 61ba171 commit 3130bbe
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion src/Uno.APISurfaceValidator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private static bool CompareMembers(IEnumerable<MemberReference> referenceMembers

var membersLookup = members.Select(RewriteMember).ToDictionary(m => m.ToString());

foreach (var referenceMember in referenceMembers.Select(RewriteReferenceMember))
foreach (var referenceMember in referenceMembers.Where(IncludeReferenceMember).Select(RewriteReferenceMember))
{
if (!membersLookup.ContainsKey(referenceMember))
{
Expand Down Expand Up @@ -142,6 +142,52 @@ private static string RewriteReferenceMember(MemberReference member)
return member.ToString();
}

private static bool IncludeReferenceMember(MemberReference member)
{
if (member is MethodDefinition methodDefinition)
{
if (methodDefinition.DeclaringType.FullName == "Windows.UI.Xaml.Controls.WebView")
{
switch (methodDefinition.Name)
{
case "get_XYFocusLeft":
case "put_XYFocusLeft":
case "get_XYFocusRight":
case "put_XYFocusRight":
case "get_XYFocusUp":
case "put_XYFocusUp":
case "get_XYFocusDown":
case "put_XYFocusDown":
case "get_XYFocusLeftProperty":
case "get_XYFocusRightProperty":
case "get_XYFocusUpProperty":
case "get_XYFocusDownProperty":
return false;
}
}
}
else if (member is PropertyDefinition propertyDefinition)
{
if (propertyDefinition.DeclaringType.FullName == "Windows.UI.Xaml.Controls.WebView")
{
switch (propertyDefinition.Name)
{
case "XYFocusLeft":
case "XYFocusRight":
case "XYFocusUp":
case "XYFocusDown":
case "XYFocusLeftProperty":
case "XYFocusRightProperty":
case "XYFocusUpProperty":
case "XYFocusDownProperty":
return false;
}
}
}

return true;
}

private static string UnpackArchive(string packagePath)
{
var path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
Expand Down

0 comments on commit 3130bbe

Please sign in to comment.