Merge inbound to mozilla-central. a=merge
authorGurzau Raul <rgurzau@mozilla.com>
Mon, 22 Oct 2018 12:48:35 +0300
changeset 490628 43d78c2bd006d7cf7d90508519c8aa88be18ab0c
parent 490627 aa628ce24d80d9966a0bcdfce6bc0469da509c34 (current diff)
parent 490617 716178d41d26ed49d2f7f86ab12bc0f5c088af7c (diff)
child 490629 47db66520bef4128c348f815dd4d75ea98335d0f
child 490643 e96edcd3f54a9adbe4fef23ef9dee31a893e7636
child 490668 6246fbfaed06dfa63fb2ee3a8007521525008caa
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmerge
milestone64.0a1
Merge inbound to mozilla-central. a=merge
testing/web-platform/meta/css/css-display/select-4-option-optgroup-display-none.html.ini
--- a/js/src/frontend/BinSource-auto.cpp
+++ b/js/src/frontend/BinSource-auto.cpp
@@ -3230,19 +3230,23 @@ BinASTParser<Tok>::parseInterfaceEagerFu
 
 #if defined(DEBUG)
     const BinField expected_fields[6] = { BinField::IsAsync, BinField::IsGenerator, BinField::Name, BinField::Length, BinField::Directives, BinField::Contents };
     MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif // defined(DEBUG)
     const auto syntax = FunctionSyntaxKind::Statement;
 
     BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
-
+    if (isAsync) {
+        return raiseError("Async function is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
-
+    if (isGenerator) {
+        return raiseError("Generator is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(name, parseBindingIdentifier());
 
     BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
 
     BINJS_MOZ_TRY_DECL(directives, parseListOfDirective());
 
     BINJS_MOZ_TRY_DECL(funbox, buildFunctionBox(
         isGenerator ? GeneratorKind::Generator
@@ -3282,19 +3286,23 @@ BinASTParser<Tok>::parseInterfaceEagerFu
 
 #if defined(DEBUG)
     const BinField expected_fields[6] = { BinField::IsAsync, BinField::IsGenerator, BinField::Name, BinField::Length, BinField::Directives, BinField::Contents };
     MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif // defined(DEBUG)
     const auto syntax = FunctionSyntaxKind::Expression;
 
     BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
-
+    if (isAsync) {
+        return raiseError("Async function is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
-
+    if (isGenerator) {
+        return raiseError("Generator is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(name, parseOptionalBindingIdentifier());
 
     BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
 
     BINJS_MOZ_TRY_DECL(directives, parseListOfDirective());
 
     BINJS_MOZ_TRY_DECL(funbox, buildFunctionBox(
         isGenerator ? GeneratorKind::Generator
@@ -3384,19 +3392,23 @@ BinASTParser<Tok>::parseInterfaceEagerMe
 #if defined(DEBUG)
     const BinField expected_fields[6] = { BinField::IsAsync, BinField::IsGenerator, BinField::Name, BinField::Length, BinField::Directives, BinField::Contents };
     MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif // defined(DEBUG)
     const auto syntax = FunctionSyntaxKind::Method;
     const auto accessorType = AccessorType::None;
 
     BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
-
+    if (isAsync) {
+        return raiseError("Async function is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
-
+    if (isGenerator) {
+        return raiseError("Generator is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(name, parsePropertyName());
 
     BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
 
     BINJS_MOZ_TRY_DECL(directives, parseListOfDirective());
 
     BINJS_MOZ_TRY_DECL(funbox, buildFunctionBox(
         isGenerator ? GeneratorKind::Generator
@@ -4103,19 +4115,23 @@ BinASTParser<Tok>::parseInterfaceLazyFun
 
 #if defined(DEBUG)
     const BinField expected_fields[7] = { BinField::IsAsync, BinField::IsGenerator, BinField::Name, BinField::Length, BinField::Directives, BinField::ContentsSkip, BinField::Contents };
     MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif // defined(DEBUG)
     const auto syntax = FunctionSyntaxKind::Statement;
 
     BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
-
+    if (isAsync) {
+        return raiseError("Async function is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
-
+    if (isGenerator) {
+        return raiseError("Generator is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(name, parseBindingIdentifier());
 
     BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
 
     BINJS_MOZ_TRY_DECL(directives, parseListOfDirective());
 
     BINJS_MOZ_TRY_DECL(contentsSkip, tokenizer_->readSkippableSubTree());
     // Don't parse the contents until we delazify.
@@ -4157,19 +4173,23 @@ BinASTParser<Tok>::parseInterfaceLazyFun
 
 #if defined(DEBUG)
     const BinField expected_fields[7] = { BinField::IsAsync, BinField::IsGenerator, BinField::Name, BinField::Length, BinField::Directives, BinField::ContentsSkip, BinField::Contents };
     MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
 #endif // defined(DEBUG)
     const auto syntax = FunctionSyntaxKind::Expression;
 
     BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
-
+    if (isAsync) {
+        return raiseError("Async function is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
-
+    if (isGenerator) {
+        return raiseError("Generator is not supported in this preview release");
+    }
     BINJS_MOZ_TRY_DECL(name, parseOptionalBindingIdentifier());
 
     BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
 
     BINJS_MOZ_TRY_DECL(directives, parseListOfDirective());
 
     BINJS_MOZ_TRY_DECL(contentsSkip, tokenizer_->readSkippableSubTree());
     // Don't parse the contents until we delazify.
--- a/js/src/frontend/BinSource.cpp
+++ b/js/src/frontend/BinSource.cpp
@@ -374,17 +374,18 @@ BinASTParser<Tok>::buildFunction(const s
         }
 
         BINJS_TRY(usedNames_.noteUse(cx_, dotGenerator, parseContext_->scriptId(),
                                      parseContext_->innermostScope()->id()));
 
         BINJS_TRY_DECL(dotGen, factory_.newName(dotGenerator,
                                                 tokenizer_->pos(tokenizer_->offset()), cx_));
 
-        BINJS_TRY(factory_.prependInitialYield(&body->as<ListNode>(), dotGen));
+        ListNode* stmtList = &body->as<LexicalScopeNode>().scopeBody()->as<ListNode>();
+        BINJS_TRY(factory_.prependInitialYield(stmtList, dotGen));
     }
 
     // Check all our bindings after maybe adding function metavars.
     MOZ_TRY(checkFunctionClosedVars());
 
     BINJS_TRY_DECL(bindings,
              NewFunctionScopeData(cx_, parseContext_->functionScope(),
                                   /* hasParameterExprs = */ false, alloc_, parseContext_));
--- a/js/src/frontend/BinSource.yaml
+++ b/js/src/frontend/BinSource.yaml
@@ -706,16 +706,26 @@ SetterContents:
               BINJS_TRY_DECL(params, new_<ListNode>(ParseNodeKind::ParamsBody, param->pn_pos));
               factory_.addList(params, param);
               MOZ_TRY(checkPositionalParameterIndices(positionalParams, params));
 
 EagerFunctionExpression:
     init: |
         const auto syntax = FunctionSyntaxKind::Expression;
     fields:
+        isGenerator:
+            after: |
+                if (isGenerator) {
+                    return raiseError("Generator is not supported in this preview release");
+                }
+        isAsync:
+            after: |
+                if (isAsync) {
+                    return raiseError("Async function is not supported in this preview release");
+                }
         contents:
             before: |
                 BINJS_MOZ_TRY_DECL(funbox, buildFunctionBox(
                     isGenerator ? GeneratorKind::Generator
                                 : GeneratorKind::NotGenerator,
                     isAsync ? FunctionAsyncKind::AsyncFunction
                             : FunctionAsyncKind::SyncFunction,
                     syntax,
@@ -742,16 +752,26 @@ EagerFunctionExpression:
         BINJS_TRY_DECL(lexicalScopeData, NewLexicalScopeData(cx_, lexicalScope, alloc_, parseContext_));
         BINJS_TRY_VAR(body, factory_.newLexicalScope(*lexicalScopeData, body));
         BINJS_MOZ_TRY_DECL(result, buildFunction(start, kind, name, params, body, funbox));
 
 LazyFunctionExpression:
     init: |
         const auto syntax = FunctionSyntaxKind::Expression;
     fields:
+        isGenerator:
+            after: |
+                if (isGenerator) {
+                    return raiseError("Generator is not supported in this preview release");
+                }
+        isAsync:
+            after: |
+                if (isAsync) {
+                    return raiseError("Async function is not supported in this preview release");
+                }
         contents:
             block:
                 replace:
                     // Don't parse the contents until we delazify.
     build: |
         BINJS_MOZ_TRY_DECL(funbox, buildFunctionBox(
             isGenerator ? GeneratorKind::Generator
                         : GeneratorKind::NotGenerator,
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -1333,29 +1333,36 @@ public:
 
 protected:
   nsComboboxControlFrame* mComboBox;
 };
 
 NS_IMPL_FRAMEARENA_HELPERS(nsComboboxDisplayFrame)
 
 void
-nsComboboxDisplayFrame::Reflow(nsPresContext*           aPresContext,
-                               ReflowOutput&     aDesiredSize,
+nsComboboxDisplayFrame::Reflow(nsPresContext*     aPresContext,
+                               ReflowOutput&      aDesiredSize,
                                const ReflowInput& aReflowInput,
-                               nsReflowStatus&          aStatus)
+                               nsReflowStatus&    aStatus)
 {
   MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
 
   ReflowInput state(aReflowInput);
   if (state.ComputedBSize() == NS_INTRINSICSIZE) {
-    // Note that the only way we can have a computed block size here is
-    // if the combobox had a specified block size.  If it didn't, size
-    // based on what our rows look like, for lack of anything better.
-    state.SetComputedBSize(mComboBox->mListControlFrame->GetBSizeOfARow());
+    float inflation = nsLayoutUtils::FontSizeInflationFor(mComboBox);
+    // We intentionally use the combobox frame's style here, which has
+    // the 'line-height' specified by the author, if any.
+    // (This frame has 'line-height: -moz-block-height' in the UA
+    // sheet which is suitable when there's a specified block-size.)
+    auto lh = ReflowInput::CalcLineHeight(mComboBox->GetContent(),
+                                          mComboBox->Style(),
+                                          aPresContext,
+                                          NS_UNCONSTRAINEDSIZE,
+                                          inflation);
+    state.SetComputedBSize(lh);
   }
   WritingMode wm = aReflowInput.GetWritingMode();
   nscoord computedISize = mComboBox->mDisplayISize -
     state.ComputedLogicalBorderPadding().IStartEnd(wm);
   if (computedISize < 0) {
     computedISize = 0;
   }
   state.SetComputedISize(computedISize);
--- a/layout/forms/test/test_bug348236.html
+++ b/layout/forms/test/test_bug348236.html
@@ -21,17 +21,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=348236">Mozilla Bug 348236</a>
 <p id="display"></p>
 <div id="content">
 
   <select id="eSelect" size="1" onchange="++this.onchangeCount">
     <option selected>1</option>
     <option>2</option>
-    <option>3</option>
+    <option id="option3">3</option>
   </select>
 </div>
 <pre id="test">
 <script type="text/javascript">
 
   /** Test for Bug 348236 **/
 
 SimpleTest.waitForExplicitFinish()
@@ -54,18 +54,20 @@ addLoadEvent(function test() {
         eSelect.selectedIndex = 0
         eSelect.onchangeCount = 0
 
         // Drop the SELECT down.
         keypressOnSelect(key)
         // This timeout and the following are necessary to let the sent events take effect.
         setTimeout(cont1, timeout)
         function cont1() {
-            // Move the mouse over option 3 (90 = 3 (rows) * 24 (row height) + 18).
-            WinUtils.sendMouseEvent("mousemove", 355, 92, 0, 0, 0, true)
+            // Move the mouse over option 3.
+            let option3 = document.getElementById("option3");
+            let rect = option3.getBoundingClientRect();
+            WinUtils.sendMouseEvent("mousemove", rect.left + 4, rect.top + 4, 0, 0, 0, true)
             setTimeout(cont2, timeout)
         }
         function cont2() {
             // Close the select.
             keypressOnSelect(key)
             setTimeout(cont3, timeout)
         }
         function cont3() {
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -1813,16 +1813,22 @@ public:
   nscoord BSize() const { return mBSize; }
 
   nscoord Ascent() const { return mAscent; }
 };
 
 NS_DECLARE_FRAME_PROPERTY_DELETABLE(CachedFlexMeasuringReflow,
                                     CachedMeasuringReflowResult);
 
+void
+nsFlexContainerFrame::MarkCachedFlexMeasurementsDirty(nsIFrame* aItemFrame)
+{
+  aItemFrame->DeleteProperty(CachedFlexMeasuringReflow());
+}
+
 const CachedMeasuringReflowResult&
 nsFlexContainerFrame::MeasureAscentAndBSizeForFlexItem(
   FlexItem& aItem,
   nsPresContext* aPresContext,
   ReflowInput& aChildReflowInput)
 {
   if (const auto* cachedResult =
         aItem.Frame()->GetProperty(CachedFlexMeasuringReflow())) {
--- a/layout/generic/nsFlexContainerFrame.h
+++ b/layout/generic/nsFlexContainerFrame.h
@@ -227,16 +227,21 @@ public:
    * See https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-auto
    *
    * @param aFlexBasis the computed 'flex-basis' for a flex item.
    * @param aMainSize the computed main-size property for a flex item.
    */
   static bool IsUsedFlexBasisContent(const nsStyleCoord* aFlexBasis,
                                      const nsStyleCoord* aMainSize);
 
+  /**
+   * Callback for nsFrame::MarkIntrinsicISizesDirty() on a flex item.
+   */
+  static void MarkCachedFlexMeasurementsDirty(nsIFrame* aItemFrame);
+
 protected:
   // Protected constructor & destructor
   explicit nsFlexContainerFrame(ComputedStyle* aStyle)
     : nsContainerFrame(aStyle, kClassID)
     , mCachedMinISize(NS_INTRINSIC_WIDTH_UNKNOWN)
     , mCachedPrefISize(NS_INTRINSIC_WIDTH_UNKNOWN)
     , mBaselineFromLastReflow(NS_INTRINSIC_WIDTH_UNKNOWN)
     , mLastBaselineFromLastReflow(NS_INTRINSIC_WIDTH_UNKNOWN)
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -5215,17 +5215,17 @@ nsFrame::MarkIntrinsicISizesDirty()
     CoordNeedsRecalc(metrics->mFlex);
     CoordNeedsRecalc(metrics->mAscent);
   }
 
   // If we're a flex item, clear our flex-item-specific cached measurements
   // (which likely depended on our now-stale intrinsic isize).
   auto* parentFrame = GetParent();
   if (parentFrame && parentFrame->IsFlexContainerFrame()) {
-    DeleteProperty(CachedFlexMeasuringReflow());
+    nsFlexContainerFrame::MarkCachedFlexMeasurementsDirty(this);
   }
 
   if (GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) {
     nsFontInflationData::MarkFontInflationDataTextDirty(this);
   }
 }
 
 /* virtual */ nscoord
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -363,21 +363,19 @@ private:
   bool mNextInFlowNeedsReflow : 1;
   bool mTruncated : 1;
   bool mFirstLetterComplete : 1;
 };
 
 #define NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics) \
   aStatus.UpdateTruncated(aReflowInput, aMetrics);
 
-#ifdef DEBUG
 // Convert nsReflowStatus to a human-readable string.
 std::ostream&
 operator<<(std::ostream& aStream, const nsReflowStatus& aStatus);
-#endif
 
 //----------------------------------------------------------------------
 
 /**
  * When there is no scrollable overflow rect, the visual overflow rect
  * may be stored as four 1-byte deltas each strictly LESS THAN 0xff, for
  * the four edges of the rectangle, or the four bytes may be read as a
  * single 32-bit "overflow-rect type" value including at least one 0xff
--- a/layout/reftests/native-theme/combobox-nonnative-when-styled-ref.html
+++ b/layout/reftests/native-theme/combobox-nonnative-when-styled-ref.html
@@ -1,9 +1,12 @@
 <!DOCTYPE HTML>
+<style>
+  select { inline-size: 2.5em }
+</style>
 <div style="position:relative">
 <!-- mask the dropdown button -->
 <div style="position:absolute; width:50px; left:7px; top:0; bottom:0; background:black;"></div>
 <!-- these should make the select non-native -->
 <select size="1" style="-moz-appearance: none; border-width: 0"></select><br>
 <select size="1" style="-moz-appearance: none; border-width: 1px"></select><br>
 <select size="1" style="-moz-appearance: none; border-width: 2px"></select><br>
 <select size="1" style="-moz-appearance: none; border-width: 3px"></select><br>
--- a/layout/reftests/native-theme/combobox-nonnative-when-styled.html
+++ b/layout/reftests/native-theme/combobox-nonnative-when-styled.html
@@ -1,9 +1,12 @@
 <!DOCTYPE HTML>
+<style>
+  select { inline-size: 2.5em }
+</style>
 <div style="position:relative">
 <!-- mask the dropdown button -->
 <div style="position:absolute; width:50px; left:7px; top:0; bottom:0; background:black;"></div>
 <!-- these should make the select non-native -->
 <select size="1" style="border-width: 0"></select><br>
 <select size="1" style="border-width: 1px"></select><br>
 <select size="1" style="border-width: 2px"></select><br>
 <select size="1" style="border-width: 3px"></select><br>
--- a/layout/style/res/forms.css
+++ b/layout/style/res/forms.css
@@ -220,23 +220,17 @@ textarea:-moz-read-write {
 }
 
 select {
   margin: 0;
   border-color: ThreeDLightShadow;
   background-color: -moz-Combobox;
   color: -moz-ComboboxText;
   font: -moz-list;
-  /*
-   * Note that the "UA !important" tests in
-   * layout/style/test/test_animations.html depend on this rule, because
-   * they need some UA !important rule to test.  If this changes, use a
-   * different one there.
-   */
-  line-height: normal !important;
+  line-height: initial;
   white-space: nowrap !important;
   word-wrap: normal !important;
   text-align: start;
   cursor: default;
   box-sizing: border-box;
   -moz-user-select: none;
   -moz-appearance: menulist;
   border-width: 2px;
@@ -313,20 +307,16 @@ select > button[orientation="right"] {
 select > button[orientation="left"]:active {
   background-image: url("arrowd-left.gif") !important;
 }
 
 select > button[orientation="right"]:active {
   background-image: url("arrowd-right.gif") !important;
 }
 
-select:empty {
-  inline-size: 2.5em;
-}
-
 *|*::-moz-display-comboboxcontrol-frame {
   overflow: -moz-hidden-unscrollable;
   /* This block-start/end padding plus the combobox block-start/end border need to
      add up to the block-start/end borderpadding of text inputs and buttons */
   padding-block-start: 1px;
   padding-block-end: 1px;
   padding-inline-start: 4px;
   padding-inline-end: 0;
@@ -340,16 +330,22 @@ select:empty {
   line-height: -moz-block-height;
 }
 
 option {
   display: block;
   float: none !important;
   position: static !important;
   min-block-size: 1em;
+  /*
+   * Note that the "UA !important" tests in
+   * layout/style/test/test_animations.html depend on this rule, because
+   * they need some UA !important rule to test.  If this changes, use a
+   * different one there.
+   */
   line-height: normal !important;
   -moz-user-select: none;
   text-indent: 0;
   white-space: nowrap !important;
   word-wrap: normal !important;
   text-align: match-parent;
 }
 
--- a/layout/style/test/test_animations.html
+++ b/layout/style/test/test_animations.html
@@ -1374,23 +1374,23 @@ is(cs.marginRight, "10px", "bug 651456 a
 advance_clock(0); // still forces a refresh
 is(cs.marginRight, "10px", "bug 651456 at 100ms (2)");
 advance_clock(100);
 is(cs.marginRight, "20px", "bug 651456 at 200ms");
 done_div();
 
 // Test that UA !important rules override animations.
 // This test depends on forms.css having a rule
-//   select { line-height: !important }
+//   option { line-height: !important }
 // If that rule changes, we should rewrite it to depend on a different rule.
-var select;
-[ select, cs ] = new_element("select", "");
+var option;
+[ option, cs ] = new_element("option", "");
 var default_line_height = cs.lineHeight;
 done_element();
-[ select, cs ] = new_element("select",
+[ option, cs ] = new_element("option",
                              "animation: uaoverride 2s linear infinite");
 is(cs.lineHeight, default_line_height,
    "animations should not override UA !important at 0ms");
 is(cs.marginTop, "20px",
    "rest of animation should still work when UA !important present at 0ms");
 advance_clock(200);
 is(cs.lineHeight, default_line_height,
    "animations should not override UA !important at 200ms");
deleted file mode 100644
--- a/testing/web-platform/meta/css/css-display/select-4-option-optgroup-display-none.html.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[select-4-option-optgroup-display-none.html]
-  expected: FAIL
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/the-select-element/select-1-block-size-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+  <meta charset="utf-8">
+  <title>Reference: Combobox block-size test</title>
+  <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
+  <style>
+html,body {
+  color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
+}
+
+select { -webkit-appearance: none; }
+
+.big { font-size: 48pt;  min-height: 40pt; }
+.lh { line-height: 48pt; min-height: 40pt; }
+
+.mask { position:fixed; left:20px; right:0; top:0; bottom:0; background: black; }
+  </style>
+</head>
+<body>
+
+<!-- mask off differences on the right side -->
+<div class="mask"></div>
+
+<select><optgroup label="label"><option>option</option></select><br>
+<select class="big"><optgroup label="label"><option>option</option></select><br>
+<select class="lh"><optgroup label="label"><option>option</option></select><br>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/the-select-element/select-1-block-size.html
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML>
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+  <meta charset="utf-8">
+  <title>Test: Combobox block-size test</title>
+  <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
+  <link rel="match" href="select-1-block-size-ref.html">
+  <link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2">
+  <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1499578">
+  <style>
+html,body {
+  color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
+}
+
+select { -webkit-appearance: none; }
+
+optgroup { font-size: 32pt; }
+option { font-size: 24pt; }
+.big { font-size: 48pt; }
+.lh { line-height: 48pt; }
+
+.mask { position:fixed; left:20px; right:0; top:0; bottom:0; background: black; }
+  </style>
+</head>
+<body>
+
+<!-- mask off differences on the right side -->
+<div class="mask"></div>
+
+<select><optgroup label="label"><option>option</option></select><br>
+<select class="big"><optgroup label="label"><option>option</option></select><br>
+<select class="lh"><optgroup label="label"><option>option</option></select><br>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/the-select-element/select-empty-ref.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+  <meta charset="utf-8">
+  <title>Reference: empty SELECT</title>
+  <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
+  <style>
+
+.none { display: none; }
+
+  </style>
+</head>
+<body>
+
+<table border="1" cellpadding="10">
+<tr>
+<td><select size="4"><option class="none"></select>
+<td><select size="4" style="-webkit-appearance: none"><option class="none">option</select>
+<td><select size="4" style="-webkit-appearance: none; border: 1px solid black"><option class="none">option</select>
+<td><select size="4" style="border: 1px solid black"><option class="none">option</select>
+</table>
+
+<table border="1" cellpadding="10">
+<tr>
+<td><select size="1"><option class="none"></select>
+<td><select size="1" style="-webkit-appearance: none"><option class="none"></select>
+<td><select size="1" style="-webkit-appearance: none; border: 1px solid black"><option class="none"></select>
+<td><select size="1" style="border: 1px solid black"><option class="none"></select>
+</table>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/the-select-element/select-empty.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+  <meta charset="utf-8">
+  <title>Test: empty SELECT</title>
+  <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
+  <link rel="match" href="select-empty-ref.html">
+  <link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2">
+  <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1499230">
+</head>
+<body>
+
+<table border="1" cellpadding="10">
+<tr>
+<td><select size="4"></select>
+<td><select size="4" style="-webkit-appearance: none"></select>
+<td><select size="4" style="-webkit-appearance: none; border: 1px solid black"></select>
+<td><select size="4" style="border: 1px solid black"></select>
+</table>
+
+<table border="1" cellpadding="10">
+<tr>
+<td><select size="1"></select>
+<td><select size="1" style="-webkit-appearance: none"></select>
+<td><select size="1" style="-webkit-appearance: none; border: 1px solid black"></select>
+<td><select size="1" style="border: 1px solid black"></select>
+</table>
+
+</body>
+</html>