mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1931933: Use CSSMinMax instead of std::clamp in nsTextControlFrame::GetNaturalBaselineBOffset. r=layout-reviewers,emilio
There is no guarantee that the block size is positive, since the size can overflow. Differential Revision: https://phabricator.services.mozilla.com/D229678
This commit is contained in:
parent
2287a05acd
commit
da4c62d200
13
layout/base/crashtests/1931933.html
Normal file
13
layout/base/crashtests/1931933.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<style>
|
||||
div {
|
||||
display: grid;
|
||||
padding: 33554400px;
|
||||
border: 5px solid;
|
||||
}
|
||||
textarea {
|
||||
padding: 33554400px;
|
||||
border: 5px solid;
|
||||
}
|
||||
</style>
|
||||
<div class="container"><textarea></textarea></div>
|
@ -566,3 +566,4 @@ pref(layout.accessiblecaret.enabled,true) load 1819239.html
|
||||
load 1821469.html
|
||||
load 1849898-1.html
|
||||
load 1929445.html
|
||||
asserts(1-3) load 1931933.html
|
||||
|
@ -1243,7 +1243,7 @@ Maybe<nscoord> nsTextControlFrame::GetNaturalBaselineBOffset(
|
||||
}
|
||||
|
||||
if (aBaselineGroup == BaselineSharingGroup::First) {
|
||||
return Some(std::clamp(mFirstBaseline, 0, BSize(aWM)));
|
||||
return Some(CSSMinMax(mFirstBaseline, 0, BSize(aWM)));
|
||||
}
|
||||
// This isn't great, but the content of the root NAC isn't guaranteed
|
||||
// to be loaded, so the best we can do is the edge of the border-box.
|
||||
|
Loading…
Reference in New Issue
Block a user