Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #563 from Microsoft/dev
Browse files Browse the repository at this point in the history
Integrating dev into master
  • Loading branch information
conniey authored Jan 30, 2018
2 parents c6bce6c + a1e63c3 commit 191bd26
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 41 deletions.
7 changes: 6 additions & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
assembly-versioning-scheme: MajorMinorPatchTag
mode: ContinuousDeployment
branches: {}
branches:
master:
tag: alpha
prevent-increment-of-merged-branch-version: true
dev:
tag: unstable
next-version: 2.4
ignore:
sha: []
30 changes: 22 additions & 8 deletions src/Microsoft.Fx.Portability/BreakingChangeParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ private enum ParseState
OriginalBug,
Notes,
SourceAnalyzerStatus,
Categories
Categories,
Comment
}

/// <summary>
Expand Down Expand Up @@ -191,20 +192,26 @@ public static IEnumerable<BreakingChange> FromMarkdown(Stream stream, IEnumerabl
// Comments.
else if (currentLine.StartsWith("<!--", StringComparison.Ordinal))
{
// change IDs are in comments, e.g. <!-- breaking change id: 144 -->
string id = currentLine.Split()
.FirstOrDefault(token => int.TryParse(token, out _));

if (id == null)
if (state == ParseState.Suggestion)
{
// suggestions may contain comments; these are part of the suggestion
ParseNonStateChange(currentBreak, state, currentLine, allowedCategories);
}
else
else if (currentLine.EndsWith("-->", StringComparison.Ordinal))
{
currentBreak.Id = id;
// change IDs are in single-line comments, e.g. <!-- breaking change id: 144 -->
string id = currentLine.Split()
.FirstOrDefault(token => int.TryParse(token, out _));
currentBreak.Id = currentBreak.Id ?? id;
state = ParseState.None;
}
else
{
// this line begins a multi-line comment not part of a suggestion
state = ParseState.Comment;
}
}

// Otherwise, process according to our current state
else
{
Expand Down Expand Up @@ -328,6 +335,13 @@ private static void ParseNonStateChange(BreakingChange currentBreak, ParseState
}
currentBreak.Categories.Add(currentLine);
break;
case ParseState.Comment:
// ignore multi-line comments
if (currentLine.EndsWith("-->", StringComparison.Ordinal))
{
state = ParseState.None;
}
break;
default:
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, LocalizedStrings.InvalidBreakingChangeParserState, state.ToString()));
}
Expand Down
72 changes: 42 additions & 30 deletions tests/Microsoft.Fx.Portability.Tests/BreakingChangeParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public void VanillaParses()
ValidateParse(GetBreakingChangeMarkdown("006- System.Uri.md"), UriBC);
ValidateParse(GetBreakingChangeMarkdown("long-path-support.md"), LongPathSupportBC);
ValidateParse(GetBreakingChangeMarkdown("opt-in-break-to-revert-from-different-4_5-sql-generation-to-simpler-4_0-sql-generation.md"), OptionalBC);
ValidateParse(GetBreakingChangeMarkdown("wpf-pointer-based-touch-stack.md"), PointerStackBC);
ValidateParse(GetBreakingChangeMarkdown("ASPNET-accessibility-improvement.md"), AccessibilityBC);
}

[Fact]
Expand Down Expand Up @@ -154,36 +156,6 @@ public void CategoryWithSpace()
ValidateParse(GetBreakingChangeMarkdown("CategoryWithSpaces.md"), expected);
}

[Fact]
public void BreakingChangeWithComments()
{
var expected = new BreakingChange
{
Title = "ASP.NET Accessibility Improvements in .NET 4.7.3",
ImpactScope = BreakingChangeImpact.Minor,
VersionBroken = Version.Parse("4.7.3"),
SourceAnalyzerStatus = BreakingChangeAnalyzerStatus.NotPlanned,
IsQuirked = true,
IsBuildTime = false,
Details = "Starting with the .NET Framework 4.7.1, ASP.NET has improved how ASP.NET Web Controls work with accessibility technology in Visual Studio to better support ASP.NET customers.",
Suggestion = @"In order for the Visual Studio Designer to benefit from these changes
- Install Visual Studio 2017 15.3 or later, which supports the new accessibility features with the following AppContext Switch by default.
```xml
<?xml version=""1.0"" encoding=""utf-8""?>
<configuration>
<runtime>
...
<!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true|false;key2=true|false -->
<AppContextSwitchOverrides value=""...;Switch.UseLegacyAccessibilityFeatures=false"" />
...
</runtime>
</configuration>
```".Replace(Environment.NewLine, "\n", StringComparison.InvariantCulture)
};

ValidateParse(GetBreakingChangeMarkdown("CommentsInRecommendedChanges.md"), expected);
}

[Fact]
public void BreakingChangeMultipleLinks()
{
Expand Down Expand Up @@ -361,6 +333,46 @@ private Stream GetBreakingChangeMarkdown(string resourceName)
ApplicableApis = new List<string>(),
Categories = new[] { "Entity Framework" }
};

public static BreakingChange PointerStackBC = new BreakingChange
{
Id = "172",
Title = "WPF Pointer-Based Touch Stack",
ImpactScope = BreakingChangeImpact.Edge,
VersionBroken = new Version(4, 7),
Details = "This change adds the ability to enable an optional WM_POINTER based WPF touch/stylus stack. Developers that do not explicitly enable this should see no change in WPF touch/stylus behavior.\n\nCurrent Known Issues With optional WM_POINTER based touch/stylus stack:\n- No support for real-time inking.\n- While inking and StylusPlugins will still work, they will be processed on the UI Thread which can lead to poor performance.\n- Behavioral changes due to changes in promotion from touch/stylus events to mouse events\n- Manipulation may behave differently\n- Drag/Drop will not show appropriate feedback for touch input\n- This does not affect stylus input\n- Drag/Drop can no longer be initiated on touch/stylus events\n- This can potentially hang the application until mouse input is detected.\n- Instead, developers should initiate drag and drop from mouse events.",
IsQuirked = true,
IsBuildTime = false,
SourceAnalyzerStatus = BreakingChangeAnalyzerStatus.NotPlanned,
Suggestion = "Developers who wish to enable this stack can add/merge the following to their application's App.config file:\n\n```xml\n<configuration>\n<runtime>\n<AppContextSwitchOverrides value=\"Switch.System.Windows.Input.Stylus.EnablePointerSupport=true\"/>\n</runtime>\n</configuration>\n```\n\nRemoving this or setting the value to false will turn this optional stack off.\n\nPlease note that this stack is available only on Windows 10 Creators Update and above.",
ApplicableApis = new List<string>(),
Categories = new[] { "Windows Presentation Foundation (WPF)" }
};

public static BreakingChange AccessibilityBC = new BreakingChange
{
Title = "ASP.NET Accessibility Improvements in .NET 4.7.1",
ImpactScope = BreakingChangeImpact.Minor,
VersionBroken = Version.Parse("4.7.1"),
SourceAnalyzerStatus = BreakingChangeAnalyzerStatus.NotPlanned,
IsQuirked = true,
IsBuildTime = false,
Details = "Starting with the .NET Framework 4.7.1, ASP.NET has improved how ASP.NET Web Controls work with accessibility technology in Visual Studio to better support ASP.NET customers.",
Suggestion = @"In order for the Visual Studio Designer to benefit from these changes
- Install Visual Studio 2017 15.3 or later, which supports the new accessibility features with the following AppContext Switch by default.
```xml
<?xml version=""1.0"" encoding=""utf-8""?>
<configuration>
<runtime>
...
<!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true|false;key2=true|false -->
<AppContextSwitchOverrides value=""...;Switch.UseLegacyAccessibilityFeatures=false"" />
...
</runtime>
</configuration>
```".Replace(Environment.NewLine, "\n", StringComparison.InvariantCulture)
};

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## ASP.NET Accessibility Improvements in .NET 4.7.3
## ASP.NET Accessibility Improvements in .NET 4.7.1

### Scope
Minor

### Version Introduced
4.7.3
4.7.1

### Source Analyzer Status
NotPlanned
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## WPF Pointer-Based Touch Stack

### Scope
Edge

### Version Introduced
4.7

### Source Analyzer Status
NotPlanned

### Change Description
This change adds the ability to enable an optional WM_POINTER based WPF touch/stylus stack. Developers that do not explicitly enable this should see no change in WPF touch/stylus behavior.

Current Known Issues With optional WM_POINTER based touch/stylus stack:
- No support for real-time inking.
- While inking and StylusPlugins will still work, they will be processed on the UI Thread which can lead to poor performance.
- Behavioral changes due to changes in promotion from touch/stylus events to mouse events
- Manipulation may behave differently
- Drag/Drop will not show appropriate feedback for touch input
- This does not affect stylus input
- Drag/Drop can no longer be initiated on touch/stylus events
- This can potentially hang the application until mouse input is detected.
- Instead, developers should initiate drag and drop from mouse events.

- [X] Quirked
- [ ] Build-time break

### Recommended Action
Developers who wish to enable this stack can add/merge the following to their application's App.config file:

```xml
<configuration>
<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Input.Stylus.EnablePointerSupport=true"/>
</runtime>
</configuration>
```

Removing this or setting the value to false will turn this optional stack off.

Please note that this stack is available only on Windows 10 Creators Update and above.

### Affected APIs
Not detectable via API analysis

### Category
Windows Presentation Foundation (WPF)

<!--
# Original bug
197685
-->

<!-- breaking change id: 172 -->

0 comments on commit 191bd26

Please sign in to comment.