Bug 990655 - Don't apply 'text-overflow' to nsComboboxControlFrame, its anon block deals with it. r=roc, a=lsblakk
authorMats Palmgren <matspal@gmail.com>
Thu, 03 Apr 2014 18:02:09 +0000
changeset 191714 86a35aa4500da40d506895e3b69a13cf02572d6e
parent 191713 a8575f98bb8afa52e5fa645d0950c9c1f122c7ea
child 191715 91e8b45c5f5e9f58d1395af3a836b5ec4f0fa0f7
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs990655
milestone30.0a2
Bug 990655 - Don't apply 'text-overflow' to nsComboboxControlFrame, its anon block deals with it. r=roc, a=lsblakk
layout/generic/TextOverflow.cpp
layout/reftests/text-overflow/combobox-zoom-ref.html
layout/reftests/text-overflow/combobox-zoom.html
layout/reftests/text-overflow/reftest.list
--- a/layout/generic/TextOverflow.cpp
+++ b/layout/generic/TextOverflow.cpp
@@ -676,16 +676,22 @@ TextOverflow::CanHaveTextOverflow(nsDisp
   // or if we're just building items for event processing.
   if ((style->mTextOverflow.mLeft.mType == NS_STYLE_TEXT_OVERFLOW_CLIP &&
        style->mTextOverflow.mRight.mType == NS_STYLE_TEXT_OVERFLOW_CLIP) ||
       IsHorizontalOverflowVisible(aBlockFrame) ||
       aBuilder->IsForEventDelivery()) {
     return false;
   }
 
+  // Skip ComboboxControlFrame because it would clip the drop-down arrow.
+  // Its anon block inherits 'text-overflow' and does what is expected.
+  if (aBlockFrame->GetType() == nsGkAtoms::comboboxControlFrame) {
+    return false;
+  }
+
   // Inhibit the markers if a descendant content owns the caret.
   nsRefPtr<nsCaret> caret = aBlockFrame->PresContext()->PresShell()->GetCaret();
   bool visible = false;
   if (caret && NS_SUCCEEDED(caret->GetCaretVisible(&visible)) && visible) {
     nsCOMPtr<nsISelection> domSelection = caret->GetCaretDOMSelection();
     if (domSelection) {
       nsCOMPtr<nsIDOMNode> node;
       domSelection->GetFocusNode(getter_AddRefs(node));
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-overflow/combobox-zoom-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!--
+    Any copyright is dedicated to the Public Domain.
+    http://creativecommons.org/licenses/publicdomain/
+  -->
+<html reftest-zoom="1.5">
+<head>
+<style>
+@font-face {
+  font-family: DejaVuSansMono;
+  src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+  color:black; background-color:white; padding:0; margin:0;
+}
+* {
+  font-family:DejaVuSansMono!important;
+  font-size:16px!important;
+}
+select {
+  width: 200px;
+  padding-right: 7px;
+
+  -moz-appearance: none;
+}
+</style>
+</head>
+<body>
+<select></select><br>
+
+<select><option>long string long </option></select>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-overflow/combobox-zoom.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!--
+    Any copyright is dedicated to the Public Domain.
+    http://creativecommons.org/licenses/publicdomain/
+  -->
+<html reftest-zoom="1.5">
+<head>
+<style>
+@font-face {
+  font-family: DejaVuSansMono;
+  src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+  color:black; background-color:white; padding:0; margin:0;
+}
+* {
+  font-family:DejaVuSansMono!important;
+  font-size:16px!important;
+}
+select {
+  width: 200px;
+  padding-right: 7px;
+  text-overflow: " ";
+  -moz-appearance: none;
+}
+</style>
+</head>
+<body>
+<select></select><br>
+
+<select><option>long string long string long string long string long string long string long string</option></select>
+
+</body>
+</html>
--- a/layout/reftests/text-overflow/reftest.list
+++ b/layout/reftests/text-overflow/reftest.list
@@ -18,8 +18,9 @@ HTTP(..) == marker-shadow.html marker-sh
 == aligned-baseline.html aligned-baseline-ref.html
 skip-if(Android||B2G) == clipped-elements.html clipped-elements-ref.html
 HTTP(..) == theme-overflow.html theme-overflow-ref.html
 skip-if(B2G) HTTP(..) == table-cell.html table-cell-ref.html
 HTTP(..) == two-value-syntax.html two-value-syntax-ref.html
 skip-if(B2G) HTTP(..) == single-value.html single-value-ref.html 
 skip-if(B2G) HTTP(..) == atomic-under-marker.html atomic-under-marker-ref.html
 fuzzy(1,702) skip-if(Android||B2G) HTTP(..) == xulscroll.html xulscroll-ref.html
+HTTP(..) == combobox-zoom.html combobox-zoom-ref.html