Bug 1278007 - [css-grid] Reset all baseline bits when we decide a grid item doesn't participate in [first|last]-baseline alignment. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Fri, 03 Jun 2016 17:30:00 +0200
changeset 300849 8ee67012a9824caa93912be9e40fc764dde22f96
parent 300848 2b60f0bc5586a3a7c978043426d52340eabcc6b2
child 300850 09ccc45c04f1036440288b772404a9af98dbb99a
push id19599
push usercbook@mozilla.com
push dateWed, 08 Jun 2016 10:16:21 +0000
treeherderfx-team@81f4cc3f6f4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1278007
milestone50.0a1
Bug 1278007 - [css-grid] Reset all baseline bits when we decide a grid item doesn't participate in [first|last]-baseline alignment. r=dholbert
layout/generic/crashtests/1278007.html
layout/generic/crashtests/crashtests.list
layout/generic/nsGridContainerFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/1278007.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html><head>
+  <meta charset="utf-8">
+  <title></title>
+  <style type="text/css">
+.grid {
+  display: grid;
+}
+
+.sfb { align-self:baseline; }
+.slb { align-self:last-baseline; }
+
+.vl { writing-mode: vertical-lr; }
+
+</style>
+</head>
+<body>
+
+<div class="grid"><input class="slb"></div>
+<div class="grid"><input class="sfb"></div>
+
+<div class="grid"><input class="slb vl"></div>
+<div class="grid"><input class="sfb vl"></div>
+
+</body>
+</html>
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -621,8 +621,9 @@ load text-overflow-bug670564.xhtml
 load text-overflow-bug671796.xhtml
 load text-overflow-bug713610.html
 load text-overflow-form-elements.html
 load text-overflow-iframe.html
 asserts-if(Android,2-4) asserts-if(!Android,4) load 1225005.html # bug 682647 and bug 448083
 load 1233191.html
 asserts(2) load 1272983-1.html # bug 586628
 asserts(2) load 1272983-2.html # bug 586628
+load 1278007.html
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -3766,30 +3766,30 @@ nsGridContainerFrame::Tracks::Initialize
           auto frameSize = isInlineAxis ? child->ISize(wm) : child->BSize(wm);
           auto m = child->GetLogicalUsedMargin(wm);
           baseline += isInlineAxis ? m.IStart(wm) : m.BStart(wm);
           auto alignSize = frameSize + (isInlineAxis ? m.IStartEnd(wm)
                                                      : m.BStartEnd(wm));
           firstBaselineItems.AppendElement(ItemBaselineData(
             { baselineTrack, baseline, alignSize, &gridItem }));
         } else {
-          state &= ~ItemState::eFirstBaseline;
+          state &= ~ItemState::eAllBaselineBits;
         }
       } else {
         if (nsLayoutUtils::GetLastLineBaseline(wm, child, &baseline)) {
           auto frameSize = isInlineAxis ? child->ISize(wm) : child->BSize(wm);
           auto m = child->GetLogicalUsedMargin(wm);
           auto descent = frameSize - baseline + (isInlineAxis ? m.IEnd(wm)
                                                               : m.BEnd(wm));
           auto alignSize = frameSize + (isInlineAxis ? m.IStartEnd(wm)
                                                      : m.BStartEnd(wm));
           lastBaselineItems.AppendElement(ItemBaselineData(
             { baselineTrack, descent, alignSize, &gridItem }));
         } else {
-          state &= ~ItemState::eLastBaseline;
+          state &= ~ItemState::eAllBaselineBits;
         }
       }
     }
     MOZ_ASSERT((state &
                 (ItemState::eFirstBaseline | ItemState::eLastBaseline)) !=
                (ItemState::eFirstBaseline | ItemState::eLastBaseline),
                "baseline and last-baseline bits are mutually exclusive");
     MOZ_ASSERT((state &