Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[IFC] text-overflow: ellipsis doesn't work with overflow: clip
https://bugs.webkit.org/show_bug.cgi?id=258265
<rdar://problem/111182654>

Reviewed by Simon Fraser.

https://drafts.csswg.org/css-overflow/#text-overflow
"
This property specifies rendering when inline content overflows its end line box edge
in the inline progression direction of its block container element ("the block") that
has overflow other than visible.
"

* LayoutTests/fast/css/empty-pseudo-class.html:
* LayoutTests/fast/inline/overflow-with-text-ellipsis-expected.html: Added.
* LayoutTests/fast/inline/overflow-with-text-ellipsis.html: Added.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::lineEndingEllipsisPolicy):

imported/w3c/web-platform-tests/css/css-ui/text-overflow-021.html: this never worked (revealing content as being scrolled in).

Canonical link: https://commits.webkit.org/265445@main
  • Loading branch information
alanbaradlay committed Jun 23, 2023
1 parent bb99bf0 commit ca99365
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions LayoutTests/TestExpectations
Expand Up @@ -4639,6 +4639,7 @@ webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-menuli
webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/outline-025.html [ ImageOnlyFailure ]
webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/outline-026.html [ ImageOnlyFailure ]
webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/text-overflow-ruby.html [ ImageOnlyFailure ]
webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/text-overflow-021.html [ ImageOnlyFailure ]
webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-menulist-button-002.tentative.html [ ImageOnlyFailure ]
webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/resize-child-will-change-transform.html [ ImageOnlyFailure ]
webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/resize-generated-content.html [ ImageOnlyFailure ]
Expand Down
19 changes: 19 additions & 0 deletions LayoutTests/fast/inline/overflow-with-text-ellipsis-expected.html
@@ -0,0 +1,19 @@
<style>
div {
width: 30px;
text-overflow: ellipsis;
white-space: nowrap;
font-family: Monospace;
font-size: 20px;
}

div::-webkit-scrollbar {
width: 0px;
height: 0px;
}
</style>
PASS if ellipsis show
<div style="overflow: hidden">X&#8230;</div>
<div style="overflow: clip">X&#8230;</div>
<div style="overflow-x: scroll">X&#8230;</div>
<div style="overflow: scroll">X&#8230;</div>
19 changes: 19 additions & 0 deletions LayoutTests/fast/inline/overflow-with-text-ellipsis.html
@@ -0,0 +1,19 @@
<style>
div {
width: 30px;
text-overflow: ellipsis;
white-space: nowrap;
font-family: Monospace;
font-size: 20px;
}
div::-webkit-scrollbar {
width: 0px;
height: 0px;
}

</style>
PASS if ellipsis show
<div style="overflow: hidden">XXXX</div>
<div style="overflow: clip">XXXX</div>
<div style="overflow: auto">XXXX</div>
<div style="overflow: scroll">XXXX</div>
Expand Up @@ -553,7 +553,7 @@ static LineEndingEllipsisPolicy lineEndingEllipsisPolicy(const RenderStyle& root
return LineEndingEllipsisPolicy::WhenContentOverflowsInBlockDirection;
}
// Truncation is in effect when the block container has overflow other than visible.
if (rootStyle.overflowX() == Overflow::Hidden && rootStyle.textOverflow() == TextOverflow::Ellipsis)
if (rootStyle.overflowX() != Overflow::Visible && rootStyle.textOverflow() == TextOverflow::Ellipsis)
return LineEndingEllipsisPolicy::WhenContentOverflowsInInlineDirection;
return LineEndingEllipsisPolicy::No;
}
Expand Down

0 comments on commit ca99365

Please sign in to comment.