Bug 667010 - "ASSERTION: unexpected block frame" with text-overflow: ellipsis, <fieldset>. r=roc
authorMats Palmgren <matspal@gmail.com>
Mon, 04 Jul 2011 07:47:59 +0200
changeset 72279 dfdbd34cdad48cb999c461d4a908efcaaa522060
parent 72266 dfcbb9671e021cec5726a8a0ba4eadca303f8fd4
child 72280 cdff167e80748a50215a694a02b252373de19a16
push id20688
push usermak77@bonardo.net
push dateMon, 04 Jul 2011 18:26:59 +0000
treeherdermozilla-central@ca5dd1bd60f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs667010
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 667010 - "ASSERTION: unexpected block frame" with text-overflow: ellipsis, <fieldset>. r=roc
layout/generic/TextOverflow.cpp
layout/reftests/text-overflow/clipped-elements-ref.html
layout/reftests/text-overflow/clipped-elements.html
layout/reftests/text-overflow/reftest.list
--- a/layout/generic/TextOverflow.cpp
+++ b/layout/generic/TextOverflow.cpp
@@ -82,24 +82,19 @@ GetSelfOrNearestBlock(nsIFrame* aFrame)
 // Return true if the frame is an atomic inline-level element.
 // It's not supposed to be called for block frames since we never
 // process block descendants for text-overflow.
 static bool
 IsAtomicElement(nsIFrame* aFrame, const nsIAtom* aFrameType)
 {
   NS_PRECONDITION(!aFrame->GetStyleDisplay()->IsBlockOutside(),
                   "unexpected block frame");
-
-  if (aFrame->IsFrameOfType(nsIFrame::eReplaced)) {
-    if (aFrameType != nsGkAtoms::textFrame &&
-        aFrameType != nsGkAtoms::brFrame) {
-      return true;
-    }
-  }
-  return aFrame->GetStyleDisplay()->mDisplay != NS_STYLE_DISPLAY_INLINE;
+  NS_PRECONDITION(aFrameType != nsGkAtoms::placeholderFrame,
+                  "unexpected placeholder frame");
+  return !aFrame->IsFrameOfType(nsIFrame::eLineParticipant);
 }
 
 static bool
 IsFullyClipped(nsTextFrame* aFrame, nscoord aLeft, nscoord aRight,
                nscoord* aSnappedLeft, nscoord* aSnappedRight)
 {
   *aSnappedLeft = aLeft;
   *aSnappedRight = aRight;
@@ -312,17 +307,18 @@ TextOverflow::DidProcessLines()
 void
 TextOverflow::ExamineFrameSubtree(nsIFrame*       aFrame,
                                   const nsRect&   aContentArea,
                                   const nsRect&   aInsideMarkersArea,
                                   FrameHashtable* aFramesToHide,
                                   AlignmentEdges* aAlignmentEdges)
 {
   const nsIAtom* frameType = aFrame->GetType();
-  if (frameType == nsGkAtoms::brFrame) {
+  if (frameType == nsGkAtoms::brFrame ||
+      frameType == nsGkAtoms::placeholderFrame) {
     return;
   }
   const bool isAtomic = IsAtomicElement(aFrame, frameType);
   if (aFrame->GetStyleVisibility()->IsVisible()) {
     nsRect childRect = aFrame->GetScrollableOverflowRect() +
                        aFrame->GetOffsetTo(mBlock);
     bool overflowLeft = childRect.x < aContentArea.x;
     bool overflowRight = childRect.XMost() > aContentArea.XMost();
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-overflow/clipped-elements-ref.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html><html>
+<head><style>
+html,body {
+    color:black; background-color:white; font-size:16px; padding:0; margin:0;
+}
+.test { 
+  overflow: hidden; 
+  text-align:right;
+  width: 50px;
+  margin-bottom:1em;
+  height: 20px;
+  white-space:nowrap;
+/*border:1px solid red;width: 500px;*/
+}
+.rel { position:relative; text-align:left;}
+input,select,fieldset,textarea,hr,span {
+ border:1px solid black;
+ background: white;
+ color: black;
+ padding:0 40px;
+}
+iframe,img { width: 80px; height:10px; }
+select[size="4"],iframe,textarea,hr { height:10px; margin:0; }
+</style></head>
+<body>
+
+<div style="position:absolute; top:0; left:0;">
+  <div class="test">&#x2026;</div>
+  <div class="test">&#x2026;</div>
+  <div class="test"><fieldset style="display:block;"></fieldset></div>
+
+  <div class="test">&#x2026;</div>
+  <div class="test">&#x2026;</div>
+  <div class="test"><input type="button" style="display:list-item;"></div>
+  <div class="test"><input type="button" style="display:block;"></div>
+
+  <div class="test">&#x2026;</div>
+  <div class="test">&#x2026;</div>
+  <div class="test"><input type="text" style="display:block;"></div>
+
+  <div class="test">&#x2026;</div>
+  <div class="test">&#x2026;</div>
+  <div class="test"><textarea style="display:block;"></textarea></div>
+
+  <div class="test">&#x2026;</div>
+  <div class="test"><select size="1" style="display:block;"><option>&nbsp;<option>&nbsp;</select></div>
+
+  <div class="test">&#x2026;</div>
+  <div class="test"><select size="4" style="display:block;"><option>&nbsp;<option>&nbsp;</select></div>
+</div>
+
+<div style="position:absolute; top:0; left:100px;">
+  <div class="test">&#x2026;</div>
+  <div class="test"><iframe src="about:blank" style="display:block"></iframe></div>
+
+  <div class="test" style="text-align:left">&nbsp;&#x2026;</div>
+  <div class="test" style="text-align:left">&nbsp;&#x2026;</div>
+  <div class="test"><img style="display:block;" src="../image/big.png"></div>
+
+  <div class="test"><x style="display:inline-block; height:100px; width:100%; background:lime">&#x2026;</x></div>
+  <div class="test">&#x2026;</div>
+  <div class="test"><hr style="display:block;"></div>
+
+  <div class="test">&#x2026;</div>
+  <div class="test">&#x2026;</div>
+  <div class="test">&#x2026;</div>
+  <div class="test"><span style="display:list-item;"></span></div>
+  <div class="test"><span style="display:block;"></span></div>
+  <div class="test rel">1<span style="position:relative;"></span></div>
+  <div class="test rel">2<span style="position:absolute;"></span></div>
+  <div class="test rel">3</div>
+  <div class="test rel">4</div>
+  <div class="test"><span style="float:left"></span></div>
+  <div class="test"><span style="float:left; margin-left:-10px"></span></div>
+  <div class="test"><span style="float:right; margin-right:-10px"></span></div>
+</div>
+
+</body></html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-overflow/clipped-elements.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html><html>
+<head><style>
+html,body {
+    color:black; background-color:white; font-size:16px; padding:0; margin:0;
+}
+.test { 
+  overflow: hidden; 
+  text-overflow: ellipsis;
+  width: 50px;
+  margin-bottom:1em;
+  height: 20px;
+  white-space:nowrap;
+/*border:1px solid red;width: 500px;*/
+}
+.rel { position:relative;}
+input,select,fieldset,textarea,hr,span {
+ border:1px solid black;
+ background: white;
+ color: black;
+ padding:0 40px;
+}
+iframe,img { width: 80px; height:10px; }
+select[size="4"],iframe,textarea,hr { height:10px; margin:0; }
+
+x {visibility:hidden;display:inline-block;margin-left:-10px;width:1000px;}
+</style></head>
+<body>
+
+<div style="position:absolute; top:0; left:0;">
+  <div class="test"><fieldset style="display:inline;"></fieldset></div>
+  <div class="test"><fieldset style="display:inline-block;"></fieldset></div>
+  <div class="test"><fieldset style="display:block;"></fieldset></div>
+
+  <div class="test"><input type="button"></div>
+  <div class="test"><input type="button" style="display:inline-block;"></div>
+  <div class="test"><input type="button" style="display:list-item;"></div>
+  <div class="test"><input type="button" style="display:block;"></div>
+
+  <div class="test"><input type="text"></div>
+  <div class="test"><input type="text" style="display:inline-block;"></div>
+  <div class="test"><input type="text" style="display:block;"></div>
+
+  <div class="test"><textarea></textarea></div>
+  <div class="test"><textarea style="display:inline-block;"></textarea></div>
+  <div class="test"><textarea style="display:block;"></textarea></div>
+
+  <div class="test"><select size="1" style=""><option>&nbsp;<option>&nbsp;</select></div>
+  <div class="test"><select size="1" style="display:block;"><option>&nbsp;<option>&nbsp;</select></div>
+
+  <div class="test"><select size="4" style=""><option>&nbsp;<option>&nbsp;</select></div>
+  <div class="test"><select size="4" style="display:block;"><option>&nbsp;<option>&nbsp;</select></div>
+</div>
+
+<div style="position:absolute; top:0; left:100px;">
+  <div class="test"><iframe src="about:blank" style=""></iframe></div>
+  <div class="test"><iframe src="about:blank" style="display:block"></iframe></div>
+
+  <div class="test">&nbsp;<img src="../image/big.png"></div>
+  <div class="test">&nbsp;<img style="display:inline-block;" src="../image/big.png"></div>
+  <div class="test"><img style="display:block;" src="../image/big.png"></div>
+
+  <div class="test"><hr style="display:inline;background:lime;vertical-align:top;padding-top:100px;padding-bottom:100px; border-width:0"></div>
+  <div class="test"><hr style="display:inline-block;vertical-align:top"></div>
+  <div class="test"><hr style="display:block;"></div>
+
+  <div class="test"><span style="border-width:0"></span></div>
+  <div class="test"><span style="display:inline-block;"></span></div>
+  <div class="test"><span style="display:inline-table;"></span></div>
+  <div class="test"><span style="display:list-item;"></span></div>
+  <div class="test"><span style="display:block;"></span></div>
+  <div class="test rel">1<span style="position:relative;"></span></div>
+  <div class="test rel">2<span style="position:absolute"></span></div>
+  <div class="test rel">3<span style="position:absolute; left:60px"></span></div>
+  <div class="test rel">4<x></x><span style="position:absolute;">abs4</span></div>
+  <div class="test"><span style="float:left"></span></div>
+  <div class="test"><span style="float:left; margin-left:-10px"></span></div>
+  <div class="test"><span style="float:right; margin-right:-10px"></span></div>
+</div>
+
+</body></html>
--- a/layout/reftests/text-overflow/reftest.list
+++ b/layout/reftests/text-overflow/reftest.list
@@ -9,8 +9,9 @@ HTTP(..) == false-marker-overlap.html fa
 HTTP(..) == visibility-hidden.html visibility-hidden-ref.html
 HTTP(..) == block-padding.html block-padding-ref.html
 HTTP(..) == quirks-decorations.html quirks-decorations-ref.html
 HTTP(..) == quirks-line-height.html quirks-line-height-ref.html
 HTTP(..) == standards-decorations.html standards-decorations-ref.html
 HTTP(..) == standards-line-height.html standards-line-height-ref.html
 HTTP(..) == selection.html selection-ref.html
 HTTP(..) == marker-shadow.html marker-shadow-ref.html
+== clipped-elements.html clipped-elements-ref.html