-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION: source code viewer on Github renders two overlapping carets
https://bugs.webkit.org/show_bug.cgi?id=259166 rdar://112056259 Reviewed by Aditya Keerthi. The color of the caret should respect both the `caret-color` and the `color` properties. Because every element implicitly has a `color`, the color of the caret should only reflect this property if set by the author. * LayoutTests/fast/css/caret-color-with-color-property-expected.html: Added. * LayoutTests/fast/css/caret-color-with-color-property.html: Added. * LayoutTests/fast/css/caret-color-with-inherited-color-property-expected.html: Added. * LayoutTests/fast/css/caret-color-with-inherited-color-property.html: Added. * Source/WebCore/css/CSSProperties.json: * Source/WebCore/editing/FrameSelection.cpp: (WebCore::CaretBase::computeCaretColor): * Source/WebCore/rendering/style/RenderStyle.h: * Source/WebCore/rendering/style/RenderStyleInlines.h: (WebCore::RenderStyle::hasExplicitlySetColor const): (WebCore::RenderStyle::InheritedFlags::operator== const): * Source/WebCore/rendering/style/RenderStyleSetters.h: (WebCore::RenderStyle::setHasExplicitlySetColor): * Source/WebCore/style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueColor): (WebCore::Style::BuilderCustom::applyInitialColor): * Source/WebCore/style/StyleBuilderState.h: (WebCore::Style::BuilderState::isAuthorOrigin const): Canonical link: https://commits.webkit.org/266070@main
- Loading branch information
Showing
18 changed files
with
177 additions
and
35 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 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
26 changes: 26 additions & 0 deletions
26
LayoutTests/fast/css/caret-color-with-inherited-color-property-expected.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
#test-container { | ||
height: 50px; | ||
width: 50px; | ||
} | ||
|
||
#mock-caret { | ||
width: 50px; | ||
height: 100px; | ||
position: absolute; | ||
top: 100px; | ||
left: 8px; | ||
background-color: green; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>The caret should show as a green flashing square below.</p> | ||
<div id="test-container"> | ||
<div id="mock-caret"></div> | ||
</div> | ||
</body> | ||
</html> |
34 changes: 34 additions & 0 deletions
34
LayoutTests/fast/css/caret-color-with-inherited-color-property.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
#test-container { | ||
height: 150px; | ||
width: 100px; | ||
overflow: hidden; | ||
color: green; | ||
} | ||
|
||
#test { | ||
transform-origin: left top; | ||
transform: scale(50, 50); | ||
clip-path: inset(1px 99px 0px 0px); | ||
font-size: 10px; /* Needed for the caret to render in Firefox. */ | ||
color: inherit; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<p>The caret should show as a green flashing square below.</p> | ||
<div id="test-container"> | ||
<div id="test" contenteditable="true"> | ||
<span> <!-- Needed for the caret to render in Firefox. --></span> | ||
</div> | ||
</div> | ||
<script> | ||
document.getElementById("test").focus(); | ||
window.getSelection().modify("move", "left", "character"); // Place the caret at the start of the <span>. | ||
</script> | ||
</body> | ||
</html> |
26 changes: 26 additions & 0 deletions
26
LayoutTests/fast/css/caret-color-with-initial-color-property-expected.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
#test-container { | ||
height: 50px; | ||
width: 50px; | ||
} | ||
|
||
#mock-caret { | ||
width: 50px; | ||
height: 100px; | ||
position: absolute; | ||
top: 100px; | ||
left: 8px; | ||
background-color: black; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>The caret should show as a black flashing square below.</p> | ||
<div id="test-container"> | ||
<div id="mock-caret"></div> | ||
</div> | ||
</body> | ||
</html> |
33 changes: 33 additions & 0 deletions
33
LayoutTests/fast/css/caret-color-with-initial-color-property.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
#test-container { | ||
height: 150px; | ||
width: 100px; | ||
overflow: hidden; | ||
} | ||
|
||
#test { | ||
transform-origin: left top; | ||
transform: scale(50, 50); | ||
clip-path: inset(1px 99px 0px 0px); | ||
font-size: 10px; /* Needed for the caret to render in Firefox. */ | ||
color: initial; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<p>The caret should show as a black flashing square below.</p> | ||
<div id="test-container"> | ||
<div id="test" contenteditable="true"> | ||
<span> <!-- Needed for the caret to render in Firefox. --></span> | ||
</div> | ||
</div> | ||
<script> | ||
document.getElementById("test").focus(); | ||
window.getSelection().modify("move", "left", "character"); // Place the caret at the start of the <span>. | ||
</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
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
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
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