change default value of position styles
Summary: Default value for positions should be undefined not 0px. Fixing this leads to more correct tests. Reviewed By: gkassabli Differential Revision: D4153329 fbshipit-source-id: d0f194f9c47eac93d3815ec7e55568a1016bc7fe
This commit is contained in:
committed by
Facebook Github Bot
parent
e54af5e854
commit
6a6efe0764
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
|
||||
<div id="do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent" style="height: 50px; width: 50px; overflow: hidden; flex-direction: row;">
|
||||
<div style="position: absolute; start: 0; top: 0;">
|
||||
<div style="position: absolute; start: 0px; top: 0px;">
|
||||
<div style="width: 100px; height: 100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -159,10 +159,10 @@ function checkDefaultValues() {
|
||||
{style:'overflow', value:'visible'},
|
||||
{style:'flex-grow', value:'0'},
|
||||
{style:'flex-shrink', value:'0'},
|
||||
{style:'left', value:'0px'},
|
||||
{style:'top', value:'0px'},
|
||||
{style:'right', value:'0px'},
|
||||
{style:'bottom', value:'0px'},
|
||||
{style:'left', value:'undefined'},
|
||||
{style:'top', value:'undefined'},
|
||||
{style:'right', value:'undefined'},
|
||||
{style:'bottom', value:'undefined'},
|
||||
].forEach(function(item) {
|
||||
assert(item.value === getDefaultStyleValue(item.style),
|
||||
item.style + ' should be ' + item.value);
|
||||
@@ -415,6 +415,15 @@ function getDefaultStyleValue(style) {
|
||||
if (style == 'position') {
|
||||
return 'relative';
|
||||
}
|
||||
switch (style) {
|
||||
case 'left':
|
||||
case 'top':
|
||||
case 'right':
|
||||
case 'bottom':
|
||||
case 'start':
|
||||
case 'end':
|
||||
return 'undefined';
|
||||
}
|
||||
var node = document.getElementById('default');
|
||||
return getComputedStyle(node, null).getPropertyValue(style);
|
||||
}
|
||||
|
Reference in New Issue
Block a user