--- a/layout/generic/nsHTMLContainerFrame.cpp
+++ b/layout/generic/nsHTMLContainerFrame.cpp
@@ -256,18 +256,19 @@ nsHTMLContainerFrame::GetTextDecorations
}
else {
// walk tree
for (nsIFrame *frame = this; frame && decorMask; frame = frame->GetParent()) {
// find text-decorations. "Inherit" from parent *block* frames
nsStyleContext* styleContext = frame->GetStyleContext();
const nsStyleDisplay* styleDisplay = styleContext->GetStyleDisplay();
- if (!styleDisplay->IsBlockOutside() &&
- styleDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) {
+ if (!styleDisplay->IsBlockInside() &&
+ styleDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL &&
+ styleDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CAPTION) {
// If an inline frame is discovered while walking up the tree,
// we should stop according to CSS3 draft. CSS2 is rather vague
// about this.
break;
}
const nsStyleTextReset* styleText = styleContext->GetStyleTextReset();
PRUint8 decors = decorMask & styleText->mTextDecoration;
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -40,16 +40,19 @@ include counters/reftest.list
include first-letter/reftest.list
# first-line/
include first-line/reftest.list
# svg/
include svg/reftest.list
+# text-decoration/
+include text-decoration/reftest.list
+
# text-indent/
include text-indent/reftest.list
# text-transform/
include text-transform/reftest.list
# native-theme/
include native-theme/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/reftest.list
@@ -0,0 +1,18 @@
+== underline-block-quirks.html underline-block-quirks-ref.html
+!= underline-block-quirks.html underline-block-quirks-notref.html
+== underline-inline-block-quirks.html underline-inline-block-quirks-ref.html
+!= underline-inline-block-quirks.html underline-inline-block-quirks-notref.html
+== underline-table-caption-quirks.html underline-table-caption-quirks-ref.html
+!= underline-table-caption-quirks.html underline-table-caption-quirks-notref.html
+== underline-table-cell-quirks.html underline-table-cell-quirks-ref.html
+!= underline-table-cell-quirks.html underline-table-cell-quirks-notref.html
+fails == underline-block-propagation-quirks.html underline-block-propagation-quirks-ref.html # currently too quirky
+== underline-block-standards.html underline-block-standards-ref.html
+!= underline-block-standards.html underline-block-standards-notref.html
+== underline-inline-block-standards.html underline-inline-block-standards-ref.html
+!= underline-inline-block-standards.html underline-inline-block-standards-notref.html
+== underline-table-caption-standards.html underline-table-caption-standards-ref.html
+!= underline-table-caption-standards.html underline-table-caption-standards-notref.html
+== underline-table-cell-standards.html underline-table-cell-standards-ref.html
+!= underline-table-cell-standards.html underline-table-cell-standards-notref.html
+fails == underline-block-propagation-standards.html underline-block-propagation-standards-ref.html # bug that we propagate to floats
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-quirks-ref.html
@@ -0,0 +1,12 @@
+<title>text-decoration: underline test</title>
+<div>
+<span style="text-decoration:underline">This text should be underlined.</span>
+
+<div style="float:left;width:10em">This text should not be underlined.</div>
+
+<div style="clear:both; margin: 1px 2px 3px 4px; border: medium solid; padding: 6px 8px 10px 12px"><span style="text-decoration:underline">This text should be underlined.</span></div>
+
+<div style="position:absolute; top: 400px;left:400px">This should not be underlined.</div>
+
+<span style="text-decoration:underline">This should be underlined but <span style="display:inline:block">this should<br>not have a <br>separate underline</span>.</span>
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-quirks.html
@@ -0,0 +1,12 @@
+<title>text-decoration: underline test</title>
+<div style="text-decoration:underline">
+This text should be underlined.
+
+<div style="float:left;width:10em">This text should not be underlined.</div>
+
+<div style="clear:both; margin: 1px 2px 3px 4px; border: medium solid; padding: 6px 8px 10px 12px">This text should be underlined.</div>
+
+<div style="position:absolute; top: 400px;left:400px">This should not be underlined.</div>
+
+This should be underlined but <span style="display:inline:block">this should<br>not have a <br>separate underline</span>.
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-standards-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div>
+<span style="text-decoration:underline">This text should be underlined.</span>
+
+<div style="float:left;width:10em">This text should not be underlined.</div>
+
+<div style="clear:both; margin: 1px 2px 3px 4px; border: medium solid; padding: 6px 8px 10px 12px"><span style="text-decoration:underline">This text should be underlined.</span></div>
+
+<div style="position:absolute; top: 400px;left:400px">This should not be underlined.</div>
+
+<span style="text-decoration:underline">This should be underlined but <span style="display:inline:block">this should<br>not have a <br>separate underline</span>.</span>
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-standards.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div style="text-decoration:underline">
+This text should be underlined.
+
+<div style="float:left;width:10em">This text should not be underlined.</div>
+
+<div style="clear:both; margin: 1px 2px 3px 4px; border: medium solid; padding: 6px 8px 10px 12px">This text should be underlined.</div>
+
+<div style="position:absolute; top: 400px;left:400px">This should not be underlined.</div>
+
+This should be underlined but <span style="display:inline:block">this should<br>not have a <br>separate underline</span>.
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-quirks-notref.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<div>This text should be underlined.</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-quirks-ref.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<div><span style="text-decoration:underline">This text should be underlined.</span></div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-quirks.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<div style="text-decoration:underline">This text should be underlined.</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-standards-notref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div>This text should be underlined.</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-standards-ref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div><span style="text-decoration:underline">This text should be underlined.</span></div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-standards.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div style="text-decoration:underline">This text should be underlined.</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-quirks-notref.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block">inline<br>block</span> in it.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-quirks-ref.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block"><span style="text-decoration:underline">inline</span><br><span style="text-decoration:underline">block</span></span> in it.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-quirks.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block;text-decoration:underline">inline<br>block</span> in it.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-standards-notref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block">inline<br>block</span> in it.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-standards-ref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block"><span style="text-decoration:underline">inline</span><br><span style="text-decoration:underline">block</span></span> in it.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-standards.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block;text-decoration:underline">inline<br>block</span> in it.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-quirks-notref.html
@@ -0,0 +1,12 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <caption>This is the table caption</caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-quirks-ref.html
@@ -0,0 +1,12 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <caption><span style="text-decoration: underline">This is the table caption</span></caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-quirks.html
@@ -0,0 +1,12 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <caption style="text-decoration: underline">This is the table caption</caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-standards-notref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <caption>This is the table caption</caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-standards-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <caption><span style="text-decoration: underline">This is the table caption</span></caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-standards.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <caption style="text-decoration: underline">This is the table caption</caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-quirks-notref.html
@@ -0,0 +1,11 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-quirks-ref.html
@@ -0,0 +1,11 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td><span style="text-decoration: underline">Row 1, Cell 1</span></td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-quirks.html
@@ -0,0 +1,11 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td style="text-decoration: underline">Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-standards-notref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-standards-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td><span style="text-decoration: underline">Row 1, Cell 1</span></td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-standards.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td style="text-decoration: underline">Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>