Import "Fix percent absolute position and size calcuate different with web" behind experimental feature (#1028) (#1201)

Summary:
Fixes https://github.com/facebook/yoga/issues/850

https://github.com/facebook/yoga/issues/850 describes a conformance issue where positioning of an absolute child using percentages is not calculated against the correct box size.

This takes the fix for that in https://github.com/facebook/yoga/pull/1028, regenerates tests, and fixes tests so that the experimental feature can be enabled. Goal is to run this as an experiment internally to see if we can enable by default.

Changelog:
[Internal]

Pull Request resolved: https://github.com/facebook/yoga/pull/1201

Reviewed By: yungsters

Differential Revision: D42282358

Pulled By: NickGerleman

fbshipit-source-id: 57c0dd9b0f1c47cb9335ff6e13d44b4646e5fa58
This commit is contained in:
Nick Gerleman
2023-01-08 13:41:27 -08:00
committed by Facebook GitHub Bot
parent 627255c0e4
commit 7e96b65790
88 changed files with 3077 additions and 67 deletions

View File

@@ -5,6 +5,11 @@
* LICENSE file in the root directory of this source tree.
*/
const DEFAULT_EXPERIMENTS = [
'AbsolutePercentageAgainstPaddingEdge',
'FixAbsoluteTrailingColumnMargin',
];
window.onload = function() {
checkDefaultValues();
@@ -472,7 +477,7 @@ function calculateTree(root, roundToPixelGrid) {
rawStyle: child.getAttribute('style'),
experiments: child.getAttribute('experiments')
? child.getAttribute('experiments').split(' ')
: [],
: DEFAULT_EXPERIMENTS,
};
var size = getRoundedSize(child);