Bug 1389010, part 5 - Assert the line type invariant at the top of nsCSSBorderRenderer::SetupDashedOptions. r=dholbert draft
authorJonathan Watt <jwatt@jwatt.org>
Thu, 10 Aug 2017 09:37:34 +0100
changeset 643944 9721d79a93b5523315545295486281e638f7e933
parent 643943 9d3a85f9c025f1155702df50edd61daff9f30e28
child 643945 52e3e85f87751afe9389cdd067ca93ea38afdfad
push id73266
push userjwatt@jwatt.org
push dateThu, 10 Aug 2017 09:00:54 +0000
reviewersdholbert
bugs1389010
milestone57.0a1
Bug 1389010, part 5 - Assert the line type invariant at the top of nsCSSBorderRenderer::SetupDashedOptions. r=dholbert MozReview-Commit-ID: KUcCSjYRgMg
layout/painting/nsCSSRenderingBorders.cpp
--- a/layout/painting/nsCSSRenderingBorders.cpp
+++ b/layout/painting/nsCSSRenderingBorders.cpp
@@ -1629,16 +1629,20 @@ nsCSSBorderRenderer::DrawBorderSides(int
 }
 
 void
 nsCSSBorderRenderer::SetupDashedOptions(StrokeOptions* aStrokeOptions,
                                         Float aDash[2],
                                         mozilla::Side aSide,
                                         Float aBorderLength, bool isCorner)
 {
+  MOZ_ASSERT(mBorderStyles[aSide] == NS_STYLE_BORDER_STYLE_DASHED ||
+             mBorderStyles[aSide] == NS_STYLE_BORDER_STYLE_DOTTED,
+             "Style should be dashed or dotted.");
+
   uint8_t style = mBorderStyles[aSide];
   Float borderWidth = mBorderWidths[aSide];
 
   // Dashed line starts and ends with half segment in most case.
   //
   // __--+---+---+---+---+---+---+---+---+--__
   //     |###|   |   |###|###|   |   |###|
   //     |###|   |   |###|###|   |   |###|