Fix issue in gentest where border-<edge> would add a border to test (#1496)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1496 Gentest code has a problem where we try to apply a border in our test when the web browser is not actually adding one. This happens when we do something like `border-top: 10px`. This will actually set the style of the border to `initial` which is just `none`, so nothing renders. This is causing at least 1 test to pass when it actually fails. I changed it so we ignore setting this value if the style is one of these values. I then re-ran the gentest code and excluded the now failing test (which gets fixed in my static stack). Reviewed By: NickGerleman Differential Revision: D51831754 fbshipit-source-id: a325e4a42b2d7cd6f19efc6cd5a2445574467fb7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7b3b66d288
commit
c93734f579
@@ -93,7 +93,7 @@
|
||||
<div style="width:20%; height:20%; left:20%; top:20%; position: absolute;"></div>
|
||||
</div>
|
||||
|
||||
<div id="absolute_layout_percentage_height_based_on_padded_parent" style="flex-direction:column; width:100px; height:100px; padding-top: 10px; border-top: 10px;">
|
||||
<div id="absolute_layout_percentage_height_based_on_padded_parent" data-disabled="true" style="flex-direction:column; width:100px; height:100px; padding-top: 10px; border-top: 10px solid black;">
|
||||
<div style="width:100px; height:50%; position: absolute;"></div>
|
||||
</div>
|
||||
|
||||
|
@@ -307,7 +307,7 @@
|
||||
|
||||
<div id="flex_direction_row_reverse_inner_border_left" style="height: 100px; width: 100px;">
|
||||
<div style="height: 100px; width: 100px; flex-direction: row-reverse; ">
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-left: 10px"></div>
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-left: 10px solid black"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
</div>
|
||||
@@ -315,7 +315,7 @@
|
||||
|
||||
<div id="flex_direction_row_reverse_inner_border_right" style="height: 100px; width: 100px;">
|
||||
<div style="height: 100px; width: 100px; flex-direction: row-reverse; ">
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-right: 10px"></div>
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-right: 10px solid black"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
</div>
|
||||
@@ -323,7 +323,7 @@
|
||||
|
||||
<div id="flex_direction_col_reverse_inner_border_top" style="height: 100px; width: 100px;">
|
||||
<div style="height: 100px; width: 100px; flex-direction: column-reverse; ">
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-top: 10px"></div>
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-top: 10px solid black"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
</div>
|
||||
@@ -331,7 +331,7 @@
|
||||
|
||||
<div id="flex_direction_col_reverse_inner_border_bottom" style="height: 100px; width: 100px;">
|
||||
<div style="height: 100px; width: 100px; flex-direction: column-reverse; ">
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-bottom: 10px"></div>
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-bottom: 10px solid black"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
</div>
|
||||
@@ -339,7 +339,7 @@
|
||||
|
||||
<div id="flex_direction_row_reverse_inner_border_start" style="height: 100px; width: 100px;">
|
||||
<div style="height: 100px; width: 100px; flex-direction: row-reverse; ">
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-start: 10px"></div>
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-start: 10px solid black"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
</div>
|
||||
@@ -347,7 +347,7 @@
|
||||
|
||||
<div id="flex_direction_row_reverse_inner_border_end" style="height: 100px; width: 100px;">
|
||||
<div style="height: 100px; width: 100px; flex-direction: row-reverse; ">
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-end: 10px"></div>
|
||||
<div style="width: 10px; height: 10px; position: absolute; border-end: 10px solid black"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
<div style="width: 10px;"></div>
|
||||
</div>
|
||||
|
@@ -10,6 +10,8 @@
|
||||
|
||||
const DEFAULT_EXPERIMENTS = ['AbsolutePercentageAgainstPaddingEdge'];
|
||||
|
||||
const INVISIBLE_BORDER_STYLES = ['none', 'initial'];
|
||||
|
||||
window.onload = function () {
|
||||
checkDefaultValues();
|
||||
|
||||
@@ -432,48 +434,72 @@ function setupTestTree(
|
||||
);
|
||||
break;
|
||||
case 'border-left-width':
|
||||
if (genericNode.rawStyle.indexOf('border-start-width:') >= 0) {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeStart,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
} else {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeLeft,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
if (
|
||||
!INVISIBLE_BORDER_STYLES.includes(
|
||||
node.declaredStyle['border-left-style'],
|
||||
)
|
||||
) {
|
||||
if (genericNode.rawStyle.indexOf('border-start-width:') >= 0) {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeStart,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
} else {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeLeft,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'border-top-width':
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeTop,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
break;
|
||||
case 'border-right-width':
|
||||
if (genericNode.rawStyle.indexOf('border-end-width:') >= 0) {
|
||||
if (
|
||||
!INVISIBLE_BORDER_STYLES.includes(
|
||||
node.declaredStyle['border-top-style'],
|
||||
)
|
||||
) {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeEnd,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
} else {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeRight,
|
||||
e.YGEdgeTop,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 'border-right-width':
|
||||
if (
|
||||
!INVISIBLE_BORDER_STYLES.includes(
|
||||
node.declaredStyle['border-right-style'],
|
||||
)
|
||||
) {
|
||||
if (genericNode.rawStyle.indexOf('border-end-width:') >= 0) {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeEnd,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
} else {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeRight,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'border-bottom-width':
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeBottom,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
if (
|
||||
!INVISIBLE_BORDER_STYLES.includes(
|
||||
node.declaredStyle['border-bottom-style'],
|
||||
)
|
||||
) {
|
||||
e.YGNodeStyleSetBorder(
|
||||
nodeName,
|
||||
e.YGEdgeBottom,
|
||||
pointValue(e, node.style[style]),
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 'width':
|
||||
e.YGNodeStyleSetWidth(nodeName, pointValue(e, node.style[style]));
|
||||
|
Reference in New Issue
Block a user