Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Restore pre-r118852 behavior for EllipsisBox::nodeAtPoint()
https://bugs.webkit.org/show_bug.cgi?id=109277 Reviewed by Simon Fraser. Source/WebCore: Test: fast/flexbox/line-clamp-link-after-ellipsis.html Roll out r118852. Enough time has passed that this can't be done mechanically, so transcribe the old method definition to current WebCore interfaces. * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::markupBox): EllipsisBox no longer has m_markupBox, so break the logic for finding the markup box from paintMarkupBox() into its own function. (WebCore::EllipsisBox::paintMarkupBox): Call markupBox(). (WebCore::EllipsisBox::nodeAtPoint): Transcribe the pre-r118852 implementation. * rendering/EllipsisBox.h: (EllipsisBox): Declare markupBox(). LayoutTests: Remove test added by r118852 and add a test that verifies the original expected behavior. * fast/css/text-overflow-ellipsis-hit-test-expected.txt: Removed. * fast/css/text-overflow-ellipsis-hit-test.html: Removed. * fast/flexbox/line-clamp-link-after-ellipsis-expected.txt: Added. * fast/flexbox/line-clamp-link-after-ellipsis.html: Added. Canonical link: https://commits.webkit.org/127576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
8 changed files
with
126 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,12 @@ | ||
Test that links painted after the ellipsis of a flexbox using -webkit-line-clamp is hit-testable. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS document.getElementsByTagName('a')[0].textContent is "clicked" | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
line one | ||
line twoclicked | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../js/resources/js-test-pre.js"></script> | ||
<style> | ||
span#container { | ||
display: inline-block; /* clamp the width of the enclosing P to its contents */ | ||
} | ||
|
||
div#flexbox { | ||
-webkit-box-orient: vertical; | ||
-webkit-line-clamp: 1; | ||
display: -webkit-box; | ||
overflow-y: hidden; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<span id="container"> | ||
<div id="flexbox">line one<br>line two<a id="link" href="#" onclick="this.textContent='clicked'">not clicked</a></div> | ||
</span> | ||
<script> | ||
description('Test that links painted after the ellipsis of a flexbox using -webkit-line-clamp is hit-testable.'); | ||
|
||
var divRect = document.getElementById("flexbox").getBoundingClientRect(); | ||
var aRect = document.getElementById("link").getBoundingClientRect(); | ||
var clickX = divRect.left + divRect.width - (aRect.width / 2); | ||
var clickY = divRect.top + divRect.height - (aRect.height / 2); | ||
|
||
if (window.eventSender) { | ||
eventSender.mouseMoveTo(clickX, clickY); | ||
eventSender.mouseDown(); | ||
eventSender.mouseUp(); | ||
} | ||
|
||
shouldBeEqualToString("document.getElementsByTagName('a')[0].textContent", "clicked"); | ||
</script> | ||
<script src="../js/resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters