mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 03:24:26 +00:00
Bug 1040668 part 9 - Compute overflow from text-shadow after text decorations. r=dbaron
--HG-- extra : source : 6827c7ef262e47cd42fea6b1a90e09883a7d24dc
This commit is contained in:
parent
376cdf821b
commit
72495f58ae
@ -5123,10 +5123,6 @@ nsTextFrame::UnionAdditionalOverflow(nsPresContext* aPresContext,
|
||||
nsRect* aVisualOverflowRect,
|
||||
bool aIncludeTextDecorations)
|
||||
{
|
||||
// Text-shadow overflows
|
||||
nsRect shadowRect =
|
||||
nsLayoutUtils::GetTextShadowRectsUnion(*aVisualOverflowRect, this);
|
||||
aVisualOverflowRect->UnionRect(*aVisualOverflowRect, shadowRect);
|
||||
bool verticalRun = mTextRun->IsVertical();
|
||||
bool useVerticalMetrics = verticalRun && mTextRun->UseCenterBaseline();
|
||||
bool inverted = GetWritingMode().IsLineInverted();
|
||||
@ -5300,6 +5296,12 @@ nsTextFrame::UnionAdditionalOverflow(nsPresContext* aPresContext,
|
||||
: nsRect(0, topOrLeft, measure, bottomOrRight - topOrLeft));
|
||||
}
|
||||
}
|
||||
|
||||
// Text-shadow overflows
|
||||
nsRect shadowRect =
|
||||
nsLayoutUtils::GetTextShadowRectsUnion(*aVisualOverflowRect, this);
|
||||
aVisualOverflowRect->UnionRect(*aVisualOverflowRect, shadowRect);
|
||||
|
||||
// When this frame is not selected, the text-decoration area must be in
|
||||
// frame bounds.
|
||||
if (!IsSelected() ||
|
||||
|
25
layout/reftests/text-shadow/overflow-decoration-ref.html
Normal file
25
layout/reftests/text-shadow/overflow-decoration-ref.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.outer {
|
||||
text-decoration: underline;
|
||||
position: absolute;
|
||||
}
|
||||
.outer+.outer {
|
||||
color: green;
|
||||
}
|
||||
.inner {
|
||||
vertical-align: 1em;
|
||||
}
|
||||
.outer+.outer>.inner {
|
||||
position: relative;
|
||||
top: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span class="outer"><span class="inner">x</span></span>
|
||||
<span class="outer"><span class="inner">x</span></span>
|
||||
</body>
|
||||
</html>
|
23
layout/reftests/text-shadow/overflow-decoration.html
Normal file
23
layout/reftests/text-shadow/overflow-decoration.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<style>
|
||||
.outer { text-decoration: underline; }
|
||||
.inner {
|
||||
vertical-align: 1em;
|
||||
text-shadow: 0 1em green;
|
||||
}
|
||||
.reftest-wait .inner {
|
||||
text-shadow: 0 1em red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span class="outer"><span class="inner">x</span></span>
|
||||
<script>
|
||||
document.addEventListener("MozReftestInvalidate", () => {
|
||||
document.documentElement.removeAttribute('class');
|
||||
}, false);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -36,3 +36,5 @@ fails-if(Android||B2G) needs-focus == text-shadow-selected-2.html text-shadow-se
|
||||
# bug 721750
|
||||
needs-focus == text-shadow-on-selection-1.html text-shadow-on-selection-1-ref.html
|
||||
needs-focus == text-shadow-on-selection-2.html text-shadow-on-selection-2-ref.html
|
||||
|
||||
== overflow-decoration.html overflow-decoration-ref.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user