mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
When we compute style for elements inside a UA-internal shadow tree that represent a pseudo-element (e.g ::placeholder), we actually run the StyleComputer machinery for (host element :: pseudo-element). While that lets us match the correct selectors, it was incorrectly applying CSS inheritance, since we'd also then inherit from whatever was above the host element in the tree. This patch fixes the issue by introducing an inheritance override in AbstractElement and then using that to force inheritance from whatever is actually directly above in the DOM for these elements instead of jumping all the way up past the host. This fixes an issue where `text-align: center` on input type=text elements would render the main text centered but placeholder text was still left-aligned.
9 lines
156 B
HTML
9 lines
156 B
HTML
<!doctype html><style>
|
|
input {
|
|
width: 400px;
|
|
height: 100px;
|
|
outline: 1px solid red;
|
|
text-align: center;
|
|
}
|
|
</style><input placeholder="abc">
|